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

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:
2026-05-08 01:00:32 +00:00
parent c8f9b8be06
commit b9dc69a3c1
4 changed files with 28 additions and 56 deletions

View File

@@ -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))