PersistentArrayMap.createWithCheck

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

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(set! (.-createWithCheck PersistentArrayMap)
  (fn [arr]
    (let [ret (array)]
      (loop [i 0]
        (when (< i (alength arr))
          (let [k (aget arr i)
                v (aget arr (inc i))
                idx (array-index-of ret k)]
            (if (== idx -1)
              (doto ret (.push k) (.push v))
              (throw (js/Error. (str "Duplicate key: " k)))))
          (recur (+ i 2))))
      (let [cnt (/ (alength arr) 2)]
        (PersistentArrayMap. nil cnt arr nil)))))