From 1cc0f1ee57f04962314238346dc8c7c4115af87d Mon Sep 17 00:00:00 2001 From: davidnolen Date: Tue, 7 Jan 2025 21:10:18 -0500 Subject: [PATCH 1/2] * test case --- src/test/cljs/cljs/core_test.cljs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/cljs/cljs/core_test.cljs b/src/test/cljs/cljs/core_test.cljs index 08581d603..94dda64f8 100644 --- a/src/test/cljs/cljs/core_test.cljs +++ b/src/test/cljs/cljs/core_test.cljs @@ -2042,3 +2042,17 @@ (is (= 11 @c)) (is (= [11 0] (reset-vals! c 0))) (is (= 0 @c))))) + +(defn test-keys [& {:as opts, :keys [a b]}] + [a b opts]) + +(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}])) + (is (= (test-keys {:a 1, :b 2}) + [1 2 {:a 1, :b 2}])) + (is (= (test-keys {:a 1, :b 2, :c 3}) + [1 2 {:a 1, :b 2, :c 3}])) + (is (= (test-keys :d 4 {:a 1, :b 2, :c 3}) + [1 nil {:d 4, :a 1, :c 3, nil nil}])))) From f42b15013f08963698e47a18a5598a80f35c0ce7 Mon Sep 17 00:00:00 2001 From: davidnolen Date: Tue, 7 Jan 2025 21:12:04 -0500 Subject: [PATCH 2/2] * seed-cnt -> i --- src/main/cljs/cljs/core.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)