binaryage/dirac

"Store as global variable" does not work

p-himik opened this issue · 2 comments

If you invoke a context menu on any CLJS object in the console, you can see two items - "Show as JavaScript object" (works, although there's no way back to the CLJS representation) and "Store as global variable". Clicking on the latter results in something that looks like this:
image
As you can see, temp3 is undefined.
What's interesting, is that temp3 is actually resolvable within JS console.

I have just tested it with latest Dirac under macOS and the feature works properly.

You are simply missing the fact that "a global variable" means "a javascript global variable" and you are inside ClojureScript console prompt. That means that you have to refer to it via js/ pseudo namespace. In your example js/temp3. Unqualified names are scoped to current ClojureScript REPL namespace. See in-ns REPL special function.

We could probably introduce a new context-menu option which would define local variable in current ClojureScript namespace. But I don't think it is worth the effort.

Yeah, I admit that was dumb of me, especially since I noticed the availability in the JS console myself. Thanks for the explanation!