File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1458
1458
(-hash [o]
1459
1459
(goog/getUid o)))
1460
1460
1461
+ (extend-type symbol
1462
+ IHash
1463
+ (-hash [o]
1464
+ (hash (.toString o))))
1465
+
1461
1466
; ;this is primitive because & emits call to array-seq
1462
1467
(defn inc
1463
1468
" Returns a number one greater than num."
Original file line number Diff line number Diff line change 102
102
(is (= (hash 0.5 ) (hash 0.5 )))
103
103
(is (= (hash -0.32553251 ) (hash -0.32553251 )))
104
104
(is (= (hash -0.0000032553251 ) (hash -0.0000032553251 )))))
105
+
106
+ (deftest test-cljs-3290
107
+ (testing " JS Symbol hash"
108
+ (let [s (.for js/Symbol " foo" )]
109
+ (is (number? (hash s)))
110
+ (is (== (hash s) (hash s)))
111
+ (is (not (== (hash s) (hash (.for js/Symbol " bar" )))))
112
+ (let [m {s 2 }]
113
+ (is (== 2 (get m s)))))))
You can’t perform that action at this time.
0 commit comments