File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9834,7 +9834,7 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
9834
9834
IHash
9835
9835
(-hash [this]
9836
9836
(when (nil? __hash)
9837
- (set! __hash (goog. string/hashCode uuid)))
9837
+ (set! __hash (hash- string* uuid)))
9838
9838
__hash)
9839
9839
9840
9840
IComparable
Original file line number Diff line number Diff line change 286
286
(emits " new Date(" (.getTime date) " )" ))
287
287
288
288
(defmethod emit-constant #? (:clj java.util.UUID :cljs UUID) [^java.util.UUID uuid]
289
- (emits " new cljs.core.UUID(\" " (.toString uuid) " \" )" ))
289
+ (let [uuid-str (.toString uuid)]
290
+ (emits " new cljs.core.UUID(\" " uuid-str " \" , " (hash uuid-str) " )" )))
290
291
291
292
#?(:clj
292
293
(defmacro emit-wrap [env & body]
Original file line number Diff line number Diff line change 2922
2922
(is (= 'cljs.core/first?
2923
2923
(demunge (munge 'cljs.core/first?)))))
2924
2924
2925
+ (deftest test-uuid-compile-and-runtime-hash
2926
+ (is (= (hash (.toString #uuid " 0d1f9029-40fc-4728-8bdd-9862172d4370" ))
2927
+ (hash (.toString (UUID. " 0d1f9029-40fc-4728-8bdd-9862172d4370" nil ))))))
2928
+
2925
2929
(comment
2926
2930
; ; ObjMap
2927
2931
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments