Fork me on GitHub

Experiment to have analyzer emit diagnostic in the case where you invoke a literal that is represented as a JavaScript primitive (and thus cannot support IFn):

cljs.user=> (when false
       #_=>   (if true
       #_=>     (1 2)
       #_=>     ("a" 1)))
WARNING: Cannot invoke value 1 as function at line 3 
WARNING: Cannot invoke value "a" as function at line 4
Wondering if something like this would be considered useful. The only overhead is at analysis time (not runtime). Here’s what I’m thinking


I can’t measure any slowdown when running script/test and it analyzes src/main/cljs/cljs/core.cljs with the above change.


Hello folks! (and sorry for repetition) There is issue with encodings and goog.LOCALE. Simple repro requires :closure-defines {"goog.LOCALE" "ru"} option, then

(import '[goog.i18n DateTimeFormat])
(let [fmt (DateTimeFormat. "dd MMMM")]
  (.format fmt (js/Date.)))
;=> "17 ÑнварÑ"
Closure Compiler source code contains note about this behaviour: With usage of (.setOutputCharset compiler-options "UTF-8”) in cljs.closure the code above compiled fine.


@s_zharinov: file an issue in JIRA thanks