js-on-sx: JS functions accept extra args silently
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user