Skip to content

[codex] Align primitive wrapper receivers#4161

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-primitive-wrappers
Jun 3, 2026
Merged

[codex] Align primitive wrapper receivers#4161
proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-primitive-wrappers

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • align boxed primitive class IDs and constructor/prototype/instanceof identity for Number/String/Boolean/BigInt/Symbol wrappers
  • expose boxed String virtual own indices, length descriptors, Object.keys, and getOwnPropertyNames ordering
  • route primitive receiver calls through temporary wrapper boxing so dynamic Number/String/Boolean prototype methods see boxed this without persisting expando writes

Validation

  • PATH="/tmp/perry-node25-bin:$PATH" ./run_parity_tests.sh --suite node-suite --module object --filter primitive-wrapper-toobject
  • PATH="/tmp/perry-node25-bin:$PATH" ./run_parity_tests.sh --suite node-suite --module globals --filter json-boxed-primitive-wrappers
  • PATH="/tmp/perry-node25-bin:$PATH" ./run_parity_tests.sh --suite node-suite --module util --filter boxed-primitives
  • cargo build -p perry-runtime -p perry-hir -p perry-codegen -p perry
  • cargo fmt --all -- --check
  • git diff --check HEAD
  • ./scripts/check_file_size.sh

andrewtdiz and others added 2 commits June 3, 2026 06:26
…e-dispatch thunk

The top-of-string-branch interception in js_native_call_method re-entered
itself through the PerryTS#4100 brand-check re-dispatch thunk installed on
String.prototype (e.g. replace), overflowing the stack. User-defined
prototype methods on primitive receivers are still routed through the
primitive_kind fallback after native dispatch.
@proggeramlug proggeramlug force-pushed the codex/node-compat-primitive-wrappers branch from 89aba45 to f868104 Compare June 3, 2026 04:38
@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 04:38
@proggeramlug proggeramlug merged commit 33b301c into PerryTS:main Jun 3, 2026
10 of 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