Skip to content

Commit fc8522e

Browse files
authoredJan 8, 2025
CLJS-3242: trailing keys bug (#243)
1 parent e78c6cd commit fc8522e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/main/cljs/cljs/core.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7217,7 +7217,7 @@ reduces them without incurring seq initialization"
72177217
(let [kv (first extra-kvs)]
72187218
(aset ret i (-key kv))
72197219
(aset ret (inc i) (-val kv))
7220-
(recur (+ 2 seed-cnt) (next extra-kvs)))
7220+
(recur (+ 2 i) (next extra-kvs)))
72217221
ret))))
72227222

72237223
(set! (.-createAsIfByAssoc PersistentArrayMap)

‎src/test/cljs/cljs/core_test.cljs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2043,10 +2043,10 @@
20432043
(is (= [11 0] (reset-vals! c 0)))
20442044
(is (= 0 @c)))))
20452045

2046-
#_(defn test-keys [& {:as opts, :keys [a b]}]
2046+
(defn test-keys [& {:as opts, :keys [a b]}]
20472047
[a b opts])
20482048

2049-
#_(deftest test-cljs-3299-trailing-keys
2049+
(deftest test-cljs-3299-trailing-keys
20502050
(testing "verify proper handling of trailing keys"
20512051
(is (= (test-keys :a 1, :b 2)
20522052
[1 2 {:a 1, :b 2}]))
@@ -2055,4 +2055,4 @@
20552055
(is (= (test-keys {:a 1, :b 2, :c 3})
20562056
[1 2 {:a 1, :b 2, :c 3}]))
20572057
(is (= (test-keys :d 4 {:a 1, :b 2, :c 3})
2058-
[1 nil {:d 4, :a 1, :c 3, nil nil}]))))
2058+
[1 2 {:d 4, :a 1, :b 2, :c 3}]))))

0 commit comments

Comments
 (0)