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
main: spread push ignores the source iterator after an Array.prototype[Symbol.iterator] patch (#10058 regression) #11772
crates/perry/tests/issue_10058_push_spread_scaling.rs::spread_push_is_iterator_correct_and_gc_safe_on_reused_destinations fails on main. It reproduces on cab6d62 and on PR #11680's head. Main's CI skips the cargo-test-perry shards, so the failure doesn't show there.
Cause. The fixture assigns Array.prototype[Symbol.iterator]. The prototype-patch pre-scan from #11394 (c9a5efe, perry-hir/src/patched_builtins.rs) records a computed key as "any member", so it also treats push as patched. Every arr.push(...src) then goes through the generic patched-prototype call (js_array_like_to_array + js_array_concat + js_native_call_method_patched_proto_apply). That path copies the source as an array and never runs its iterator.
Effect. This is a correctness bug, not only a stale assertion: Perry prints own 4 6,1,2,3 where Node prints own 3 6,7,8.
Related, older bug. Even with no prototype patch, f(...own) and o.m(...own) ignore an own Symbol.iterator: Perry prints 1,2,3 where Node prints 7,8.
Partial fix in #11773: the patched-builtins pre-scan now records a computed well-known-symbol key (e.g. Array.prototype[Symbol.iterator] = …) as @@iterator instead of an any-member write, so push is no longer treated as patched and spread push runs the iterator (issue_10058_push_spread_scaling passes).
Still open: an object's own Symbol.iterator is ignored by f(...own) and o.m(...own) spread calls.
Activity
proggeramlug commentedon Oct 2, 2026
Partial fix in #11773: the patched-builtins pre-scan now records a computed well-known-symbol key (e.g.
Array.prototype[Symbol.iterator] = …) as@@iteratorinstead of an any-member write, sopushis no longer treated as patched and spread push runs the iterator (issue_10058_push_spread_scalingpasses).Still open: an object's own
Symbol.iteratoris ignored byf(...own)ando.m(...own)spread calls.fix: a patched Symbol.iterator no longer marks push as patched (#11772)
perf(spread): plain-array shape check before the full dense-spread pr…
fix(spread): honor own iterators in call arguments (Closes #11772)
perf(spread): plain-array shape check before the full dense-spread pr…