Skip to content

[codex] Respect symbol enumerability in Object.assign#4239

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-object-assign-tail
Jun 3, 2026
Merged

[codex] Respect symbol enumerability in Object.assign#4239
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-object-assign-tail

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Addresses #3986.

Summary

  • Store descriptor attributes for symbol-keyed properties defined with Object.defineProperty.
  • Include symbol-keyed data/accessor descriptors in Object.getOwnPropertyDescriptor.
  • Make Object.assign skip non-enumerable symbol data properties while preserving direct-assignment defaults.
  • Add GC scanning/reset coverage for the new symbol descriptor metadata table.

Why This Cut

#4161 handled the Object boxing portion of #3986. This PR covers the remaining coherent Object.assign descriptor/copy tail: the same symbol descriptor metadata is needed both for descriptor round-trips and for deciding whether a symbol property is enumerable during assignment.

Tests

  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-object-assign-tail/target cargo test -p perry-runtime symbol_define_property_attrs_round_trip_descriptor
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-object-assign-tail/target cargo check -p perry-runtime -p perry-stdlib -p perry
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-object-assign-tail/target npm exec --yes --package=node@26 -- bash -lc 'node --version; ./run_parity_tests.sh --suite node-suite --module object --filter assign'
    • Node v26.3.0
    • 3 pass / 0 fail / 0 compile fail
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

Non-Goals

  • Does not change unrelated Proxy/Reflect object-copy hooks.
  • Does not broaden unrelated descriptor APIs beyond the symbol-keyed getOwnPropertyDescriptor behavior needed for this Object.assign cut.

@andrewtdiz andrewtdiz force-pushed the codex/node-compat-object-assign-tail branch from a549a9b to 0538a76 Compare June 3, 2026 09:48
@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 11:52
@proggeramlug proggeramlug merged commit 385b59c into PerryTS:main Jun 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants