js-on-sx: js-new-call honours function-typed constructor returns
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
new Object(func) should return func itself (per ES spec - "if value is a native ECMAScript object, return it"), but js-new-call only kept the ctor's return when it was dict or list — functions fell through to the empty wrapper. Added (js-function? ret) to the accept set. built-ins/Object: 42/50 → 44/50. conformance.sh: 148/148.
This commit is contained in:
@@ -648,7 +648,7 @@
|
||||
(if
|
||||
(and
|
||||
(not (js-undefined? ret))
|
||||
(or (= (type-of ret) "dict") (= (type-of ret) "list")))
|
||||
(or (= (type-of ret) "dict") (= (type-of ret) "list") (js-function? ret)))
|
||||
ret
|
||||
obj))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user