ClojureScript

Exceptions are reported at weird locations in the presence of bad quasiquoting

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
     [org.clojure/clojurescript "0.0-2138"]

Description

(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.

Activity

Hide
David Nolen added a comment -

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

Show
David Nolen added a comment - 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

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: