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 14581458 (-hash [o]
14591459 (goog/getUid o)))
14601460
1461+ (extend-type symbol
1462+ IHash
1463+ (-hash [o]
1464+ (hash (.toString o))))
1465+
14611466; ;this is primitive because & emits call to array-seq
14621467(defn inc
14631468 " Returns a number one greater than num."
Original file line number Diff line number Diff line change 102102 (is (= (hash 0.5 ) (hash 0.5 )))
103103 (is (= (hash -0.32553251 ) (hash -0.32553251 )))
104104 (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