fix(runtime): honor exotic indices in Array reverse (rebase of #8400) - #8437
Conversation
Rebase of #8400 onto current main. The re-export list in array/mod.rs conflicted with #8414's additions; resolved as a union so array_object_flags_resolved and canonicalize_array_numeric_store_value_from_flags are preserved alongside array_named_property_delete_by_name. Original work by @proggeramlug in #8400.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthrough
ChangesArray reverse and indexed mutation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Array.prototype.reverse
participant reverse_array_spec_path
participant Array indexed properties
Array.prototype.reverse->>reverse_array_spec_path: reverse exotic array
reverse_array_spec_path->>Array indexed properties: check presence and read values
reverse_array_spec_path->>Array indexed properties: set or delete paired indices
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Rebase of #8400 onto current
main. Original work by @proggeramlug; this exists onlybecause that branch conflicts with
mainand is on a fork I cannot push to.Completes the remaining
Array.prototype.reversecluster from #5898: arrays with holes,indexed descriptors, or indexed prototype properties now follow the specified live
HasProperty/Get/Set/Deleteorder, with the receiver and both observed valuesrooted across accessors.
The conflict, and how it was resolved
crates/perry-runtime/src/array/mod.rsconflicts on a re-export list. Resolved as aunion, not by taking either side:
mainhad gainedarray_object_flags_resolvedandcanonicalize_array_numeric_store_value_from_flagsfrom perf(codegen): elide proven element shape checks #8414array_named_property_delete_by_nameTaking the PR's side wholesale would have silently dropped the two #8414 symbols. All three
are present here.
Validation
perry-runtime --lib— 2599 passedperry --bin perry— 1005 passedissue_5898_array_reverse_exotic— 1 passedscripts/run_lint_gates.sh— all 50 gatesBehaviour on the test262 shape matches Node exactly:
Holes, dense arrays and accessor-backed indices also match.
Supersedes #8400.
Summary by CodeRabbit
Bug Fixes
Array.prototype.reversebehavior for inherited, accessor-backed, sparse, deleted, and other unusual array indices.Tests