You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Array.prototype index setters installed with defineProperty are bypassed by array element stores #9249
The setter never runs, the array is extended, and the own slot is written. Same for a boolean[] receiver (Object.defineProperty(Array.prototype, 9, …)), and same for Object.defineProperty(arr, i, {set})-free plain stores generally — the receiver's own descriptors are checked, the prototype's are not.
Pre-existing on origin/main (b3f14e9cd), for numeric and tagged receivers alike. I found it while widening the inline store tier in a separate PR and confirmed both tiers behave identically here, so it is not caused by that work.
Why both tiers miss it
The out-of-line guard consults array_prototype_has_index_flag(), object_prototype_has_index_flag() and array_static_proto_recorded(); the inline guard consults the PERRY_ARRAY_INDEX_FAST_PATH_INVALIDATED summary byte that those setters maintain. The flags are only ever raised from note_array_index_write / note_object_prototype_index_write, which fire on an index write to the prototype:
Object.defineProperty(Array.prototype, N, …) is not an index write, so neither flag is ever raised and every guard downstream of them is satisfied. Array.prototype[7] = … presumably does raise it — the hole is specific to the defineProperty route.
Fix shape
Raise the same flags from the defineProperty / defineProperties path when the target is Array.prototype or Object.prototype and the key is an array index. That is one call at the definition site and leaves both guards and the summary byte correct without touching either fast path.
Repro is 6 lines; happy to attach the fuller differential (frozen / sealed / preventExtensions / own-element accessor / extension / mixed types) I wrote alongside it — the own-element accessor case passes today, which is what makes the prototype gap stand out.
Activity
docs(changelog): fragment for the #9249 strict-mode test fix
test(9249): opt the blocked-store case into strict mode (#9426 semant…
proggeramlug commentedon Sep 2, 2026
Closing: fixed in #9392 (landed #9339); the test's strictness expectation was corrected in #9481.