clojurescript 2025-01-06

Hello, I noticed a strange behavior of maps passed as trailing keyword arguments. This was implemented in CLJS-3299 (port of Clojure 1.11 feature).

*clojurescript-version*
;; "1.11.132"

(defn test-keys [& {:as opts, :keys [a b]}]
  [a b opts])

(test-keys :a 1, :b 2)
;; ok [1 2 {:a 1, :b 2}]

(test-keys {:a 1, :b 2})
;; ok [1 2 {:a 1, :b 2}]

(test-keys {:a 1, :b 2, :c 3})
;; ok [1 2 {:a 1, :b 2, :c 3}]

(test-keys :d 4 {:a 1, :b 2, :c 3})
;; ClojureScript  [1 nil {:d 4, :a 1, :c 3, nil nil}]
;; Clojure        [1 2 {:d 4, :a 1, :b 2, :c 3}]
As you see in the last example, CLJS lost :b keyword. I searched CLJS JIRA but have not found any bug report.

🧐 2