js-on-sx: arrays inherit from Array.prototype on lookup miss
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
js-get-prop for SX lists fell through to js-undefined for any key not in its hardcoded method list, so Array.prototype.myprop and Object.prototype.hasOwnProperty were invisible to arrays. Switched the fallback to walk Array.prototype via js-dict-get-walk, which already chains to Object.prototype. built-ins/Array: 14/45 → 16/45. conformance.sh: 148/148.
This commit is contained in:
@@ -2682,7 +2682,7 @@
|
||||
((= key "copyWithin") (js-array-method obj "copyWithin"))
|
||||
((= key "toReversed") (js-array-method obj "toReversed"))
|
||||
((= key "toSorted") (js-array-method obj "toSorted"))
|
||||
(else js-undefined)))
|
||||
(else (js-dict-get-walk (get Array "prototype") (js-to-string key)))))
|
||||
((= (type-of obj) "string")
|
||||
(cond
|
||||
((= key "length") (len obj))
|
||||
|
||||
Reference in New Issue
Block a user