We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f826c31 commit e024283Copy full SHA for e024283
src/main/cljs/cljs/core.cljs
@@ -902,9 +902,12 @@
902
-1048576
903
2146959360))
904
905
- (true? o) 1
+ ;; note: mirrors Clojure's behavior on the JVM, where the hashCode is
906
+ ;; 1231 for true and 1237 for false
907
+ ;; http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html#hashCode%28%29
908
+ (true? o) 1231
909
- (false? o) 0
910
+ (false? o) 1237
911
912
(string? o)
913
(m3-hash-int (hash-string o))
src/test/cljs/cljs/hashing_test.cljs
@@ -87,4 +87,8 @@
87
(is (== (imul -2 -2) 4))
88
(is (== (imul 0xffffffff 5) -5))
89
(is (== (imul 0xfffffffe 5) -10))
90
- ))
+ ))
91
+
92
+(deftest test-cljs-1818
93
+ (is (= (hash true) 1231))
94
+ (is (= (hash false) 1237)))
0 commit comments