Skip to content

[codex] Preserve lexical new.target for arrows#4224

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-async-newtarget-capture
Jun 3, 2026
Merged

[codex] Preserve lexical new.target for arrows#4224
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-async-newtarget-capture

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • Route Expr::NewTarget through the stack-aware lowerer so arrow closures can read captured lexical new.target values.
  • Propagate captures_new_target into synthesized async step closures, including awaited async arrows.
  • Add a Node parity fixture for sync arrows, async arrows, awaited async arrows, and ordinary function new.target behavior.

Addresses the async/arrow new.target portion of #3568.

Validation

  • npm exec --package=node@25 -- bash -lc 'node --version; ./run_parity_tests.sh --suite node-suite --module globals --filter arrow-newtarget-capture' (Node v25.9.0, 1 pass / 0 fail)
  • cargo fmt --all -- --check
  • git diff --check origin/main..HEAD
  • ./scripts/check_file_size.sh
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-generator-prototype-identity/target cargo check -p perry-codegen -p perry-transform

@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 08:21
@proggeramlug proggeramlug merged commit 9f17463 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