js-on-sx: JS functions accept extra args silently
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s

SX strictly arity-checks lambdas; JS allows passing more args than
declared (extras accessible via arguments). Was raising "f expects
1 args, got 2" whenever Array.from passed (value, index) to a
1-arg mapFn. Fixed in js-build-param-list: every JS param list
now ends with &rest __extra_args__ unless an explicit rest is
present, so extras are silently absorbed.
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 06:36:54 +00:00
parent b1023f11d9
commit bfec2a4320
4 changed files with 5 additions and 3 deletions

View File

@@ -930,7 +930,7 @@
(fn
(params)
(cond
((empty? params) (list))
((empty? params) (list (js-sym "&rest") (js-sym "__extra_args__")))
((and (list? (first params)) (js-tag? (first params) "js-rest"))
(list (js-sym "&rest") (js-sym (nth (first params) 1))))
(else