From 1440774dcd49af17c105818340a23ccb126d77ee Mon Sep 17 00:00:00 2001 From: dnolen Date: Mon, 12 Oct 2015 20:57:33 -0400 Subject: [PATCH] fix broken UUID hashing --- src/main/cljs/cljs/core.cljs | 2 +- src/test/cljs/cljs/core_test.cljs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index 163368a36d..58e300e5f3 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -9844,7 +9844,7 @@ Maps become Objects. Arbitrary keys are encoded to by key->js." IHash (-hash [this] (when (nil? __hash) - (set! __hash (hash-string* uuid))) + (set! __hash (hash uuid))) __hash) IComparable diff --git a/src/test/cljs/cljs/core_test.cljs b/src/test/cljs/cljs/core_test.cljs index 4155482997..049227beae 100644 --- a/src/test/cljs/cljs/core_test.cljs +++ b/src/test/cljs/cljs/core_test.cljs @@ -1690,11 +1690,9 @@ (testing "UUID hashing" (let [id "550e8400-e29b-41d4-a716-446655440000" uuid (cljs.core/uuid id) - expected (goog.string/hashCode id)] + expected (hash id)] (is (= expected (hash uuid))) - ;; checking hash cache - (is (= expected (.-__hash uuid))) - (is (= expected (hash uuid)))))) + (is (= expected (.-__hash uuid)))))) (deftest test-comparable (testing "Testing IComparable"