Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix (println 1 1) => "11\n" instead of "1 1\n"

  • Loading branch information...
commit 280ea95938883f97be82267d109342178a2e47aa 1 parent 0f2be41
@brandonbloom brandonbloom authored David Nolen committed
Showing with 12 additions and 12 deletions.
  1. +11 −11 src/cljs/cljs/core.cljs
  2. +1 −1  test/cljs/cljs/core_test.cljs
View
22 src/cljs/cljs/core.cljs
@@ -6146,11 +6146,11 @@ reduces them without incurring seq initialization"
:else (list "#<" (str obj) ">")))))
(defn- pr-sb [objs opts]
- (let [first-obj (first objs)
- sb (gstring/StringBuffer.)]
- (doseq [obj objs]
- (when-not (identical? obj first-obj)
- (.append sb " "))
+ (let [sb (gstring/StringBuffer.)]
+ (doseq [string (pr-seq (first objs) opts)]
+ (.append sb string))
+ (doseq [obj (next objs)]
+ (.append sb " ")
(doseq [string (pr-seq obj opts)]
(.append sb string)))
sb))
@@ -6172,12 +6172,12 @@ reduces them without incurring seq initialization"
"Prints a sequence of objects using string-print, observing all
the options given in opts"
[objs opts]
- (let [first-obj (first objs)]
- (doseq [obj objs]
- (when-not (identical? obj first-obj)
- (string-print " "))
- (doseq [string (pr-seq obj opts)]
- (string-print string)))))
+ (doseq [string (pr-seq (first objs) opts)]
+ (string-print string))
+ (doseq [obj (next objs)]
+ (string-print " ")
+ (doseq [string (pr-seq obj opts)]
+ (string-print string))))
(defn newline [opts]
(string-print "\n")
View
2  test/cljs/cljs/core_test.cljs
@@ -221,7 +221,7 @@
(assert (= (hash-map :foo 5)
(assoc (cljs.core.ObjMap. nil (array) (js-obj)) :foo 5)))
- (assert (= "\"asdf\"" (pr-str "asdf")))
+ (assert (= "\"asdf\" \"asdf\"" (pr-str "asdf" "asdf")))
(assert (= "[1 true {:a 2, :b #\"x\\\"y\"} #<Array [3, 4]>]"
(pr-str [1 true {:a 2 :b #"x\"y"} (array 3 4)])))

0 comments on commit 280ea95

Please sign in to comment.
Something went wrong with that request. Please try again.