Skip to content

Commit 4a3737b

Browse files
cemerickdnolen
authored andcommitted
CLJS-1161: actually print error stack traces to *err*, allow higher-level rebindings of *cljs-ns*
1 parent 3811756 commit 4a3737b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/clj/cljs/repl.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@
489489
(ana/analyze-file src opts)
490490
(-evaluate repl-env f 1 (cljsc/add-dep-string opts compiled))
491491
(-evaluate repl-env f 1 (cljsc/src-file->goog-require src)))
492-
(binding [ana/*cljs-ns* 'cljs.user]
492+
(binding [ana/*cljs-ns* ana/*cljs-ns*]
493493
(let [res (if (= File/separatorChar (first f)) f (io/resource f))]
494494
(assert res (str "Can't find " f " in classpath"))
495495
(load-stream repl-env f res))))))
@@ -684,8 +684,7 @@
684684
#(prn "Error evaluating:" form :as js)
685685
(constantly nil))
686686
opts)))
687-
(binding [*out* *err*]
688-
(.printStackTrace e))))
687+
(.printStackTrace e *err*)))
689688

690689
(defn repl*
691690
[repl-env {:keys [init need-prompt quit-prompt prompt flush read eval print caught reader
@@ -731,7 +730,7 @@
731730
done? (atom false)]
732731
(env/with-compiler-env (or compiler-env (env/default-compiler-env opts))
733732
(binding [*err* (if bind-err *out* *err*)
734-
ana/*cljs-ns* 'cljs.user
733+
ana/*cljs-ns* ana/*cljs-ns*
735734
*cljs-verbose* repl-verbose
736735
ana/*cljs-warnings*
737736
(assoc ana/*cljs-warnings*

0 commit comments

Comments
 (0)