In clojurescript 1.9.89 and Chrome 50.0.2661.102, I can create a log statement, for example:
(js/console.log "works")
But I canβt create one like:
(def brokenlog js/console.log)
(brokenlog "but not here")
-->
When I try to compare these approaches by typing the value of my own function brokenlog, it looks just like "real", i.e. both brokenlog, and js/console.logevaluate for me as:
#object[log "function log() { [native code] }"]
Similarly, I see this behavior with:
cljs.user=> (js/document.querySelector "body")
cljs.user=> (def l js/document.querySelector)
cljs.user=> (l "body")
nil
Upgrading to Chrome 52 fixes behavior console.log, but not behavior document.querySelector.
I have two questions:
1. What I miss
2. Where should I read white papers that could explain this?
Thank!
source
share