Fork me on GitHub
#cljs-dev
<
2016-01-17
>
mfikes14:01:04

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 https://github.com/mfikes/clojurescript/commit/c6cf2738e3e2fb507e12ba57a8ae50a52b415211

mfikes15:01:38

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

zharinov16:01:04

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: https://github.com/google/closure-compiler/blob/62ca536d0a184a8852646e2bc2db178f700f5cfc/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L163 With usage of (.setOutputCharset compiler-options "UTF-8”) in cljs.closure the code above compiled fine.

dnolen18:01:46

@s_zharinov: file an issue in JIRA thanks