-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catch js/Object e causes Can't qualify symbol in catch
error
#41
Comments
As referenced in the now closed pull request, this doesn't produce correct compiled output.
|
After some digging and some test compilation, it turns out that it works just fine with (fn state-machine#
([] (aset-all! (make-array ~state-arr-size)
~FN-IDX state-machine#
~STATE-IDX ~(:start-block machine)))
([~state-sym]
(let [ret-value# (try (loop []
(let [result# (switch# ~state-sym)]
(if (cljs.core/keyword-identical? result# :recur)
(recur)
result#)))
(catch js/Object ex#
(aset-all! ~state-sym ~CURRENT-EXCEPTION ex#)
(cljs.core.async.impl.ioc-helpers/process-exception ~state-sym)
:recur))]
(if (cljs.core/keyword-identical? ret-value# :recur)
(recur ~state-sym)
ret-value#))))))) It looks like something in the compiler is not quite working right with the emitter from the state machine generator. |
Please note that the code base is over 1 year out of date. If you are feeling (very) ambitious, you could merge it forward. You would learn a LOT about the compiler :-) Regarding the problem, it might be interesting to try and macroexpand the macro. The error may become obvious (or not). |
I've already partially started that process by going ahead and backporting some changes in against The partial backport seems to have done the trick. I'll put up a pull request once I'm confident that the non-trivial changes to the I'm no stranger to compilers and interpreters: https://github.com/ephsec/svforth :) -Wes On Apr 24, 2014, at 12:25 AM, Joel Martin [email protected] wrote:
|
Finally resolve this issue by going back in time and finding the least intrusive change to the |
I am trying to get core.async built with the compiler in the cljsc-in-cljsc tree. It looks like it takes exception to the
js
namespace for catch.https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async.cljs#L700
The output given is:
Looking at the
analyzer.js
code, it looks like we have a few special exceptions for namespace references tojs
-- I will see if I can get this to understand that it can ignore a namespace of 'js', but hints would be appreciated.The text was updated successfully, but these errors were encountered: