Skip to content

Commit b9d6a75

Browse files
author
dnolen
committed
CLJS-1162: Failure to printStackTrace when REPL initialized
1 parent 4a3737b commit b9d6a75

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/clj/cljs/repl.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
[cljs.tagged-literals :as tags]
2525
[cljs.closure :as cljsc]
2626
[cljs.source-map :as sm])
27-
(:import [java.io File PushbackReader FileWriter]
27+
(:import [java.io File PushbackReader FileWriter PrintWriter]
2828
[java.net URL]
2929
[javax.xml.bind DatatypeConverter]
3030
[clojure.lang IExceptionInfo]
@@ -729,7 +729,10 @@
729729
:source-map-inline source-map-inline})))
730730
done? (atom false)]
731731
(env/with-compiler-env (or compiler-env (env/default-compiler-env opts))
732-
(binding [*err* (if bind-err *out* *err*)
732+
(binding [*err* (if bind-err
733+
(cond-> *out*
734+
(not (instance? PrintWriter *out*)) (PrintWriter.))
735+
*err*)
733736
ana/*cljs-ns* ana/*cljs-ns*
734737
*cljs-verbose* repl-verbose
735738
ana/*cljs-warnings*

0 commit comments

Comments
 (0)