diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index 60078fcf1..c5d186689 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -10470,6 +10470,7 @@ reduces them without incurring seq initialization" (js/isNaN obj) "##NaN" (identical? obj js/Number.POSITIVE_INFINITY) "##Inf" (identical? obj js/Number.NEGATIVE_INFINITY) "##-Inf" + (js/Object.is obj -0.0) "-0.0" :else (str_ obj))) (object? obj) diff --git a/src/test/cljs/cljs/printing_test.cljs b/src/test/cljs/cljs/printing_test.cljs index c114893df..008172ed1 100644 --- a/src/test/cljs/cljs/printing_test.cljs +++ b/src/test/cljs/cljs/printing_test.cljs @@ -74,6 +74,7 @@ (is (= (pr-str 1) "1")) (is (= (pr-str -1) "-1")) (is (= (pr-str -1.5) "-1.5")) + (is (= (pr-str -0.0) "-0.0")) (is (= (pr-str [3 4]) "[3 4]")) (is (= (pr-str "foo") "\"foo\"")) (is (= (pr-str :hello) ":hello"))