fix: preserve Symbol properties in object rest - #11023
proggeramlug wants to merge 2 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughObject rest destructuring now preserves enumerable own Symbol properties, including accessor values and Symbol-only objects. It excludes named and non-enumerable Symbols. Runtime handles keep operands rooted during getter and conversion activity. ChangesObject rest Symbol support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant js_object_rest
participant copy_rest_symbol_properties
participant SourceObject
participant RestObject
js_object_rest->>copy_rest_symbol_properties: copy eligible Symbol properties
copy_rest_symbol_properties->>SourceObject: read own symbols and descriptors
copy_rest_symbol_properties->>RestObject: define enumerable data properties
Merge Risk: ⚪ Minimal · up to The Symbol rest implementation and its regression coverage have no remaining actionable issue identified in this change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 |
|
Held from merge train 257 (#11039) by the raw-handle ratchet, not by a conflict.
Note #10984 also touches that file and was held for a conflict there, so coordinate if you are both editing it. Ping me when the ratchet is back at baseline. |
1 similar comment
|
Held from merge train 257 (#11039) by the raw-handle ratchet, not by a conflict.
Note #10984 also touches that file and was held for a conflict there, so coordinate if you are both editing it. Ping me when the ratchet is back at baseline. |
|
Holding this out of the merge trains for one required
Reproduce without a build, in a couple of seconds: The gate's message names the intended fix: put the allocating call inside Raising the ceiling instead is not an option I can take: this ratchet is what keeps #7341's cleanup from being undone, and 2 → 26 in one file is the shape it exists to catch. Everything else on this PR is green — all 6 gap shards, cargo-test, warnings, e2e-scoped, gc-stress. Fix this one step and I'll take it in the next train. |
|
Landed on Four of this train's seven PRs — including this one, if it is #11055, #11023, #11012 or #11014 — were repaired here because they were stuck: the fixes were cherry-picked from A train rebase gives the commits new SHAs, so GitHub cannot auto-close the source PR; closing by hand. Nothing needed from you. |
Summary
Preserve enumerable own Symbol properties when object destructuring creates a rest object. Symbol accessors are evaluated once, nonenumerable Symbols stay excluded, and Symbol key order matches JavaScript.
Changes
Related issue
Fixes #10815
Test plan
LLVM_SYS_221_PREFIX=/usr/lib/llvm-22 cargo build --release -p perry -p perry-runtime-staticRUST_TEST_THREADS=1 LLVM_SYS_221_PREFIX=/usr/lib/llvm-22 cargo test --release -p perry-runtime --lib(4,269 passed; 6 ignored)test_gap_object_destructuring_field_and_rest_guard.ts; output matches NodePERRY_GC_SCAVENGE=1 PERRY_GC_FORCE_EVACUATE=1 PERRY_GC_VERIFY_EVACUATION=1; output matches the normal runcargo fmt --all -- --checkpython3 scripts/check_test_registration.pyscripts/check_file_size.shChecklist
feat:/fix:/docs:/chore:prefix convention used in the logSummary by CodeRabbit
Bug Fixes
Tests