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

0 votes
in core.async by
To see the error, run the following:


clojure -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.238"}org.clojure/core.async {:mvn/version "0.4.474"}}}' -m cljs.main -e "(require '[cljs.core.async :refer [chan go]]) (go (js/console.log \"Foo\") (js-debugger) (js/console.log \"Bar\"))"


which will generate a Js error like "SyntaxError: expected expression, got keyword 'debugger'"

The compiled Js output will contain something like:

{code:javascript}var inst_2199 = debugger;

but {{debugger}} is a statement, not an expression that can be assigned.

3 Answers

0 votes
by

Comment made by: alexmiller

Given the nature of go blocks, I don't think this should be expected to work, but I will leave that to dnolen.

0 votes
by

Comment made by: kingmob

I mentioned it to David originally, and he said if I had tried it, others probably had too, and suggested I file the ticket.

Should cljs.core.async be more aware of Js restricted keywords somehow? (FWIW, I saw another issue where someone was using a var named "new" that works normally but breaks in go: https://dev.clojure.org/jira/browse/ASYNC-176)

0 votes
by
Reference: https://clojure.atlassian.net/browse/ASYNC-215 (reported by alex+import)
...