Skip to content

Commit 5e0d80d

Browse files
authored
CLJS-3480: Browser REPL - (println "Expected:") breaks REPL (#314)
- remove the pr-str in clojure.browser/repl-print print etc will set *print-readably* to false, so this can't possibly be right. This appears to be vestigial from the early days of bREPL development - in cljs.repl.browser/handle-post :print, drop edn/read-string the server really doesn't know anything about printing ClojureScript, it should just print the value given. - running tests interactively in bREPL now behaves the same as under the Node.js REPL
1 parent 01a36bd commit 5e0d80d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
(garray/clear print-queue))
5050

5151
(defn repl-print [data]
52-
(.push print-queue (pr-str data))
52+
(.push print-queue data)
5353
(when @parent-connected?
5454
(flush-print-queue! @xpc-connection)))
5555

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,13 @@
306306
[{:keys [repl data order] :as _request-content} conn _]
307307
(constrain-order order
308308
(fn []
309-
(binding [*out* (or (and repl (.get outs repl)) *out*)]
310-
(print (edn/read-string data))
311-
(.flush *out*))))
309+
(try
310+
(binding [*out* (or (and repl (.get outs repl)) *out*)]
311+
(print data))
312+
(catch Throwable t
313+
(print t))
314+
(finally
315+
(.flush *out*)))))
312316
(server/send-and-close conn 200 "ignore__"))
313317

314318
(defmethod handle-post :result

0 commit comments

Comments
 (0)