clojurescript

skardan 2025-01-06T11:57:34.557949Z

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
dnolen 2025-01-08T14:29:09.206619Z

fixed in master

dnolen 2025-01-07T13:38:12.852079Z

thanks for the report!

dnolen 2025-01-07T13:40:59.199389Z

https://clojure.atlassian.net/browse/CLJS-3424