[CLJS-685] Cannot call method 'fromArray' of undefined -- Clojurescript 0.0-2030 Created: 17/Nov/13 Updated: 26/Nov/13 Resolved: 22/Nov/13
|Labels:||Compiler, bug, errormsgs|
Linux 3.2.0-52-generic x86_64 GNU/Linux, java 1.7, clojure 1.5.1
This line from compile cljs.core is causing problems:
cljs.core.PersistentQueue.EMPTY = (new cljs.core.PersistentQueue(null, 0, null, cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, cljs.core.PersistentArrayMap.fromArray([new cljs.core.Keyword(null, "end-line", "end-line", 2693041432), 3820, new cljs.core.Keyword(null, "end-column", "end-column", 3799845882), 69], true)), 0));
error message: Uncaught TypeError: Cannot call method 'fromArray' of undefined.
That's the first mention of fromArray in that file. I don't know if it's an ordering problem.
|Comment by John Chijioke [ 17/Nov/13 11:10 PM ]|
I solved it by replacing  with cljs.core.PersistentVector.EMPTY. I think this must be a reader problem.
|Comment by David Nolen [ 17/Nov/13 11:32 PM ]|
This ticket needs more details, how can this error be reproduced?
|Comment by Peter Taoussanis [ 22/Nov/13 3:03 AM ]|
Hi, I'm seeing the same problem with tools.reader 0.8.0.
Any Clojurescript file (even an empty file) will produce the error.
Tried `lein cljsbuild clean`.
Problem is resolved by dropping back to tools.reader 0.7.10.
Update: have created an issue on the tools.reader GitHub page: https://github.com/clojure/tools.reader/issues/7
Update 2: this isn't something specific to Cljs 0.0-2030 btw, tools.reader 0.8.0 seems to produce the same error against at least Cljs 0.0-2060, 0.0-2027, 0.0-2024.
|Comment by Nicola Mometto [ 22/Nov/13 6:49 AM ]|
tools.reader 0.8.0 introduces end-column/end-line metadata, this needs to be elided as per line/column to avoid this bootstrapping issue.
|Comment by David Nolen [ 22/Nov/13 8:02 AM ]|
|Comment by Peter Taoussanis [ 22/Nov/13 10:30 AM ]|
Thanks a lot David, Nicola - much appreciated! Cheers
|Comment by John Chijioke [ 26/Nov/13 6:32 AM ]|
Thanks David. Cheers!