Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Problem for using boolean Closure defines

3 Answers

0 votes
by
_Comment made by: favila_

I am unsure if this is the same issue, but forms like {{^boolean (js/isFinite n)}} also do not seem to analyze correctly: {{if}}, {{and}}, and {{or}} will still emit a call to {{truth_}}.
0 votes
by
_Comment made by: mfikes_

It appears this is no longer reproducible:


$ java -jar cljs.jar -m cljs.repl.node
ClojureScript Node.js REPL server listening on 51236
To quit, type: :cljs/quit
cljs.user=> *clojurescript-version*
"1.9.946"
cljs.user=> (set! *print-fn-bodies* true)
true
cljs.user=> (fn [n] (if ^boolean (js/isFinite n) 1 2))
#object[ret__6224__auto__ "function (n){
if(isFinite(n)){
return (1);
} else {
return (2);
}
}"]
cljs.user=> (fn [n] (if (js/isFinite n) 1 2))
#object[ret__6224__auto__ "function (n){
if(cljs.core.truth_(isFinite(n))){
return (1);
} else {
return (2);
}
}"]
0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-1070 (reported by dnolen)
...