expected:
(reduce-kv vector nil [])
=> nil
(reduce-kv vector nil [1])
=> [nil 0 1]
actual in CLJS:
(reduce-kv vector nil (clojure.core.rrb-vector/vec []))
Error: No item 0 in vector of length 0
at Object.cljs$core$vector_index_out_of_bounds [as vector_index_out_of_bounds] (http://localhost:8080/cljs-runtime/cljs.core.js:19788:8)
at Object.clojure$core$rrb_vector$rrbt$IVecImpl$_array_for$arity$2 (http://localhost:8080/cljs-runtime/clojure.core.rrb_vector.rrbt.js:1028:18)
at Object.cljs$core$IKVReduce$_kv_reduce$arity$3 (http://localhost:8080/cljs-runtime/clojure.core.rrb_vector.rrbt.js:613:21)
at Object.cljs$core$_kv_reduce [as _kv_reduce] (http://localhost:8080/cljs-runtime/cljs.core.js:2359:13)
(reduce-kv vector nil (clojure.core.rrb-vector/vec [1]))
=> [nil 0 1]
actual in CLJ:
(reduce-kv vector nil (clojure.core.rrb-vector/vec []))
Execution error (IndexOutOfBoundsException) at clojure.core.rrb_vector.rrbt.Vector/arrayFor (rrbt.clj:806).
(reduce-kv vector nil (clojure.core.rrb-vector/vec [1]))
=> [nil 0 1]
*"vector nil" part is not important here, it is just to justify calling reduce-kv.
Friday night, forgot to add any versions info:
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.597"}
org.clojure/core.rrb-vector {:mvn/version "0.1.1"}