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

0 votes
in ClojureScript by

There is not normally an empty line after an enhanced error printout. See Clojure, and for example, see this example in ClojureScript:

cljs.user=> (require '[cljs.core.specs.alpha]) nil cljs.user=> (let [1]) Syntax error macroexpanding cljs.core/let at (<cljs repl>:1:1). [1] - failed: even-number-of-forms? at: [:bindings] spec: :cljs.core.specs.alpha/bindings cljs.user=>

But, with CLJS-2945 and CLJS-3011 you can see that there is an extra blank line for {{:clojure.error.phase}} {{:execution}} printing.

The attached patch eliminates this extra blank line, making things consistent within ClojureScript and also consistent with Clojure. Here is an example with the patch:

cljs.user=> (ffirst 1) Execution error (Error) at (<cljs repl>:1). 1 is not ISeqable cljs.user=>

and without the patch you would see:

`
cljs.user=> (ffirst 1)
Execution error (Error) at (:1).
1 is not ISeqable

cljs.user=>
`

A slight difficulty is that the enhanced error printing strings have newlines at the end. See for example:

https://github.com/clojure/clojurescript/blob/6ccb629e365f46a9516e4defeced652cce9d4d35/src/main/cljs/cljs/repl.cljs#L188

The display error code is used for other errors, so the fix taken in this patch is to enforce uniformity by employing {{trimr}}.

2 Answers

0 votes
by

Comment made by: mfikes

CLJS-3012.patch passes CI (/)

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-3012 (reported by mfikes)
...