The snippet below reproduces the problem
(defn bug [seq]
(let [m (transient (zipmap seq (repeat 1)))]
(loop [m m
[x & rest] seq]
(if (contains? m x)
(recur (dissoc! m x) rest)
(throw (js/Error. "What's going on?")))))))
(bug [44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24]]
Ah, transient lookup is not supported in Clojure. Why it is allowed in ClojureScript, then?
The fact that contains? doesn't work in clojure is a bug, see http://dev.clojure.org/jira/browse/CLJ-700
Right, already spotted that.
Wow, this is a pretty serious bug – thanks!
It is caused by an incorrect iteration bound in pack-array-node. The attached patch fixes it.
Oops, forgot the test. Attaching the same fix + test case.
A final tweak.