1

这一直困扰着我一段时间。在 repl 我可以输入:

ClojureScript:cljs.user> (js* "window")
==> #<[object DOMWindow]>
ClojureScript:cljs.user> (js* "window.a=1")
==> 1
ClojureScript:cljs.user> (js* "window.a")
==> 1

但如果我输入:

ClojureScript:cljs.user> (js* "c=1")
==> 1
ClojureScript:cljs.user> (js* "c")
=>       ; expect 1 but returns nothing

为什么会这样?

4

1 回答 1

6

js* is an implementation detail, you shouldn't be using it at all.

于 2012-06-05T16:44:32.070 回答