<< Back to previous view

[CLJS-759] Exceptions are reported at weird locations in the presence of bad quasiquoting Created: 31/Jan/14  Updated: 03/Jan/15  Resolved: 03/Jan/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Jamie Brandon Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

[org.clojure/clojurescript "0.0-2138"]


(defn foo [x]
`(f ~@(for [i (range 10)] ~i)))

(foo 1)

This code has an extra unquote next to the i causing:

TypeError: Cannot call method 'call' of undefined
at aurora.compiler.foo.cljs.core.with_meta.call.cljs.core.seq.call.cljs.core.concat.call.iter_7602auto_ (/home/jamie/aurora/src/aurora/compiler.cljs[eval362]:229:100)

Compare this to:

(defn foo [x]
(bar x))

(foo 1)

Which causes:

TypeError: Cannot call method 'call' of undefined
at foo (/home/jamie/aurora/src/aurora/compiler.cljs[eval376]:212:67)

In the first case, the symbol is mangled and the line number and column are incorrect.

Comment by David Nolen [ 03/Jan/15 6:30 PM ]

The stack trace can be a bit strange in some environments but the foo does in fact appear when I tested. It did uncover a bug with cljs.core/unquote now resolved in master https://github.com/clojure/clojurescript/commit/baa2e227cd99b9710e7a0af91d44a15b54d60828

Generated at Fri Sep 22 23:00:00 CDT 2017 using JIRA 4.4#649-r158309.