Skip to content

Commit 517f3d8

Browse files
committed
clean up how we set *print-fn* *print-err-fn* so it's easier to debug
1 parent 60631d0 commit 517f3d8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@
186186
"Set *print-fn* to console.log"
187187
[]
188188
(set! *print-newline* false)
189-
(set! *print-fn*
189+
(set-print-fn!
190190
(fn [& args]
191191
(.apply (.-log js/console) js/console (into-array args))))
192-
(set! *print-err-fn*
192+
(set-print-err-fn!
193193
(fn [& args]
194194
(.apply (.-error js/console) js/console (into-array args))))
195195
nil)
@@ -11498,10 +11498,10 @@ reduces them without incurring seq initialization"
1149811498
(identical? *target* "nashorn")
1149911499
(let [system (.type js/Java "java.lang.System")]
1150011500
(set! *print-newline* false)
11501-
(set! *print-fn*
11501+
(set-print-fn!
1150211502
(fn [& args]
1150311503
(.println (.-out system) (.join (into-array args) ""))))
11504-
(set! *print-err-fn*
11504+
(set-print-err-fn!
1150511505
(fn [& args]
1150611506
(.println (.-error system) (.join (into-array args) "")))))))
1150711507

src/main/cljs/cljs/nodejs.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
(defn enable-util-print! []
2020
(set! *print-newline* false)
21-
(set! *print-fn*
21+
(set-print-fn!
2222
(fn [& args]
2323
(.apply (.-log js/console) js/console (into-array args))))
24-
(set! *print-err-fn*
24+
(set-print-err-fn!
2525
(fn [& args]
2626
(.apply (.-error js/console) js/console (into-array args))))
2727
nil)

src/main/cljs/clojure/browser/repl.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
(when-let [conn @xpc-connection]
4444
(flush-print-queue! conn)))
4545

46-
(set! *print-fn* repl-print)
47-
(set! *print-err-fn* repl-print)
4846
(set! *print-newline* true)
47+
(set-print-fn! repl-print)
48+
(set-print-err-fn! repl-print)
4949

5050
(defn get-ua-product []
5151
(cond

0 commit comments

Comments
 (0)