js-on-sx: js-dict-get-walk falls back to Object.prototype
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s
Object literals didn't carry a __proto__ link, so ({}).toString()
couldn't reach Object.prototype.toString. Added a cond clause: if
the object has no __proto__ AND is not Object.prototype itself,
walk into Object.prototype. Now ({}).toString() works, override
of Object.prototype.toString propagates, and ({a:1}).hasOwnProperty
('a') returns true. built-ins/String: 69/99 → 71/99 (canonical),
71/99 → 74/99 (isolated). conformance.sh: 148/148.
This commit is contained in:
@@ -2596,6 +2596,8 @@
|
||||
((dict-has? obj skey) (get obj skey))
|
||||
((dict-has? obj "__proto__")
|
||||
(js-dict-get-walk (get obj "__proto__") skey))
|
||||
((not (= obj (get Object "prototype")))
|
||||
(js-dict-get-walk (get Object "prototype") skey))
|
||||
(else js-undefined)))))
|
||||
|
||||
(define
|
||||
|
||||
Reference in New Issue
Block a user