Skip to content

Commit

Permalink
CLJS-3242: trailing keys bug (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette authored Jan 8, 2025
1 parent e78c6cd commit fc8522e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/test/cljs/cljs/core_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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}]))
Expand All @@ -2055,4 +2055,4 @@
(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}]))))
[1 2 {:d 4, :a 1, :b 2, :c 3}]))))

0 comments on commit fc8522e

Please sign in to comment.