PersistentHashSet.createWithCheck

functionsince v1.9.456 clojure.lang/PersistentHashSet.createWithCheckEdit
(PersistentHashSet.createWithCheck items)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(set! (.-createWithCheck PersistentHashSet)
      (fn [items]
        (let [len (alength items)
              t (-as-transient (.-EMPTY PersistentHashSet))]
          (dotimes [i len]
            (-conj! t (aget items i))
            (when-not (= (count t) (inc i))
              (throw (js/Error. (str "Duplicate key: " (aget items i))))))
          (-persistent! t))))