Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:[org.clojure/clojurescript "0.0-1552"]
Description
When running this loop, then the map's meta is lost after 32 assocs:
(loop [i 0, m (with-meta {} {:foo :bar})]
(when (<= i 34)
(.log js/console i (pr-str (meta m)))
(recur (inc i) (assoc m (str i) i))))
The last 4 lines of output read
31 {:foo :bar}
32 {:foo :bar}
33 nil
34 nil
cljs.core.ObjMap/HASHMAP_THRESHOLD happens to be 32, so I guess
there is a connection.
obj-map->hash-map failed to take into account the fact that transients don't support metadata. The attached patch fixes this.