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

+4 votes
in ClojureScript by
edited by

If I bind a symbol from the js namespace to a symbol with the same name, the symbol evaluates to nil, whereas if I bind it to any other name. the value is correctly bound.

Here is a repro using the Getting Started setup from clojurescript.org:

$ clj -M --main cljs.main --compile hello-world.core --repl
ClojureScript 1.11.4
cljs.user=> (defn f1 []
  (let [window js/window]
    window))

(defn f2 []
  (let [vindow js/window]
    vindow))
#'cljs.user/f1
cljs.user=> cljs.user=> #'cljs.user/f2
cljs.user=> (f1)
nil
cljs.user=> (f2)
#object[Window [object Window]]
cljs.user=> 

1 Answer

+1 vote
by
by
Thanks! Complete with my spelling errors. =)
...