PersistentHashMap.createWithCheck

functionsince v1.9.456 clojure.lang/PersistentHashMap.createWithCheckEdit
(PersistentHashMap.createWithCheck arr)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(set! (.-createWithCheck PersistentHashMap)
  (fn [arr]
    (let [len (alength arr)
          ret (transient (.-EMPTY PersistentHashMap))]
      (loop [i 0]
        (when (< i len)
          (-assoc! ret (aget arr i) (aget arr (inc i)))
          (if (not= (-count ret) (inc (/ i 2)))
            (throw (js/Error. (str "Duplicate key: " (aget arr i))))
            (recur (+ i 2)))))
      (-persistent! ret))))