js-on-sx: fn.constructor === Function for function instances
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s

Per ES, every function instance's constructor slot points to the
Function global. Was returning undefined for (function () {})
.constructor. Added constructor to the function-property cond in
js-get-prop; returns js-function-global.
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 03:24:31 +00:00
parent 9b07f97341
commit d676bcb6b7
2 changed files with 4 additions and 1 deletions

View File

@@ -2737,11 +2737,12 @@
(js-dict-get-walk obj (js-to-string key)))
((and (= obj Promise) (dict-has? __js_promise_statics__ (js-to-string key)))
(get __js_promise_statics__ (js-to-string key)))
((and (js-function? obj) (or (= key "prototype") (= key "name") (= key "length") (= key "call") (= key "apply") (= key "bind")))
((and (js-function? obj) (or (= key "prototype") (= key "name") (= key "length") (= key "call") (= key "apply") (= key "bind") (= key "constructor")))
(cond
((= key "prototype") (js-get-ctor-proto obj))
((= key "name") (js-extract-fn-name obj))
((= key "length") (js-fn-length obj))
((= key "constructor") js-function-global)
(else (js-invoke-function-bound obj key))))
(else js-undefined))))
(define