Skip to content

fix(globals): expose legacy escape and global alias - #4545

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-globals-escape-global-20260605
Jun 7, 2026
Merged

proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-globals-escape-global-20260605

Conversation

@andrewtdiz

Copy link
Copy Markdown
Contributor

Summary:

  • install Node's global self-reference on globalThis and recognize bare global reads
  • expose legacy Annex B escape/unescape as callable global functions with Node-compatible descriptors, names, lengths, coercion, and Symbol errors
  • add a globals parity fixture covering descriptors, rebound calls, UTF-16 %uXXXX behavior, and Symbol TypeErrors

Fixes #4511.

Validation:

  • cargo fmt --all -- --check
  • git diff --check origin/main..HEAD
  • ./scripts/check_file_size.sh
  • jq empty test-parity/known_failures.json
  • env RUSTC_WRAPPER= TMPDIR=$PWD/target/tmp CARGO_BUILD_JOBS=1 cargo check -q -p perry-runtime -p perry-hir -p perry-codegen
  • env RUSTC_WRAPPER= TMPDIR=$PWD/target/tmp CARGO_BUILD_JOBS=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module globals --filter legacy-escape-global' (1 pass / 0 parity fail / 0 compile fail, report test-parity/reports/parity_report_20260605_075255.json)
  • env RUSTC_WRAPPER= TMPDIR=$PWD/target/tmp CARGO_BUILD_JOBS=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module globals --filter global-functions' (1 pass / 0 parity fail / 0 compile fail, report test-parity/reports/parity_report_20260605_075512.json)
  • env RUSTC_WRAPPER= TMPDIR=$PWD/target/tmp CARGO_BUILD_JOBS=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module globals' (86 pass / 0 parity fail / 0 compile fail / 0 skipped, report test-parity/reports/parity_report_20260605_075659.json)

@proggeramlug
proggeramlug force-pushed the codex/node-compat-globals-escape-global-20260605 branch from ba171a0 to 8ab7a01 Compare June 7, 2026 14:15
@proggeramlug
proggeramlug merged commit 177dcda into PerryTS:main Jun 7, 2026
12 of 13 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.

globals: legacy escape()/unescape() throw ReferenceError; bare Node global unresolved

2 participants