fix(json): internalize JSON.parse reviver properties - #4595
Merged
proggeramlug merged 1 commit intoJun 5, 2026
Merged
Conversation
proggeramlug
force-pushed
the
codex/node-compat-json-reviver-internalize-20260605
branch
from
June 5, 2026 20:41
8897069 to
4cd435b
Compare
This was referenced Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issues
Closes #4588
Summary
JSON.parse(text, reviver)to walk via holder/key internalization instead of raw object/array slots.[[Get]]re-reads,Object.keyssnapshots for objects, array-length snapshots for arrays, holderthisbinding, and root wrapper semantics.Why This Cut
This is scoped to JSON.parse reviver internalization semantics. It intentionally stays separate from JSON.parse argument coercion and broader object/array descriptor model work.
Tests
cargo test -q -p perry-runtime --lib json_reviver -- --nocapturecargo test -q -p perry-runtime --lib json:: -- --nocapturePATH=/root/.npm/_npx/bac97da9607b7ef2/node_modules/.bin:$PATH PERRY_NO_AUTO_OPTIMIZE=1 ./run_parity_tests.sh --suite node-suite --module globals --filter json-parse-reviver-internalizePERRY_JSON_TAPE=1 PERRY_NO_AUTO_OPTIMIZE=1 ./target/release/perry run test-files/test_json_lazy_reviver.tsPATH=/root/.npm/_npx/bac97da9607b7ef2/node_modules/.bin:$PATH node --experimental-strip-types test-parity/node-suite/globals/json-parse-reviver-internalize.tscargo check -q -p perry-codegen -p perry-runtime(existing warnings)git diff --checkCurrent Base Check Notes
cargo fmt --all -- --checkcurrently fails oncrates/perry-codegen/src/expr/property_get.rs, which is outside this PR's diff and present on the rebased base../scripts/check_file_size.shcurrently fails becausecrates/perry-runtime/src/regex.rsis 2080 lines on the rebased base; this PR does not touch that file.Known Limitations
Non-Goals