From 0798a5d3b1f6a0dafb360febebbe95ac182d5d18 Mon Sep 17 00:00:00 2001 From: davidnolen Date: Wed, 8 Jan 2025 08:35:04 -0500 Subject: [PATCH] CLJS-3242: trailing keys bug --- src/main/cljs/cljs/core.cljs | 2 +- src/test/cljs/cljs/core_test.cljs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index dcdf23c31..3cc6dd58a 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -7217,7 +7217,7 @@ reduces them without incurring seq initialization" (let [kv (first extra-kvs)] (aset ret i (-key kv)) (aset ret (inc i) (-val kv)) - (recur (+ 2 seed-cnt) (next extra-kvs))) + (recur (+ 2 i) (next extra-kvs))) ret)))) (set! (.-createAsIfByAssoc PersistentArrayMap) diff --git a/src/test/cljs/cljs/core_test.cljs b/src/test/cljs/cljs/core_test.cljs index 330c18e7e..94dda64f8 100644 --- a/src/test/cljs/cljs/core_test.cljs +++ b/src/test/cljs/cljs/core_test.cljs @@ -2043,10 +2043,10 @@ (is (= [11 0] (reset-vals! c 0))) (is (= 0 @c))))) -#_(defn test-keys [& {:as opts, :keys [a b]}] +(defn test-keys [& {:as opts, :keys [a b]}] [a b opts]) -#_(deftest test-cljs-3299-trailing-keys +(deftest test-cljs-3299-trailing-keys (testing "verify proper handling of trailing keys" (is (= (test-keys :a 1, :b 2) [1 2 {:a 1, :b 2}]))