js-on-sx: native prototypes inherit from Object.prototype
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s
Per ES, every native prototype's [[Prototype]] is Object.prototype (and Function.prototype.[[Prototype]] is too). Was missing those links, so Object.prototype.isPrototypeOf(Boolean.prototype) returned false (the explicit isPrototypeOf walks __proto__, not the recent fallback). Added 5 dict-set! lines to the post-init. built-ins/Boolean: 22/27 → 23/27, built-ins/Number: 44/50 → 45/50. conformance.sh: 148/148.
This commit is contained in:
@@ -4646,6 +4646,11 @@
|
||||
(dict-set! Array "__proto__" (get js-function-global "prototype"))
|
||||
(dict-set! Number "__proto__" (get js-function-global "prototype"))
|
||||
(dict-set! String "__proto__" (get js-function-global "prototype"))
|
||||
(dict-set! Boolean "__proto__" (get js-function-global "prototype")))
|
||||
(dict-set! Boolean "__proto__" (get js-function-global "prototype"))
|
||||
(dict-set! (get Array "prototype") "__proto__" (get Object "prototype"))
|
||||
(dict-set! (get Number "prototype") "__proto__" (get Object "prototype"))
|
||||
(dict-set! (get String "prototype") "__proto__" (get Object "prototype"))
|
||||
(dict-set! (get Boolean "prototype") "__proto__" (get Object "prototype"))
|
||||
(dict-set! (get js-function-global "prototype") "__proto__" (get Object "prototype")))
|
||||
|
||||
(define js-global {:undefined js-undefined :JSON JSON :parseInt parseInt :Object Object :isNaN js-global-is-nan :Infinity inf :NaN 0 :String String :Boolean Boolean :Array Array :Math Math :parseFloat parseFloat :Number Number :console console :isFinite js-global-is-finite})
|
||||
|
||||
Reference in New Issue
Block a user