Skip to content

fix(error): construct EvalError and URIError - #2911

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-2885-error-constructors
May 30, 2026
Merged

fix(error): construct EvalError and URIError#2911
proggeramlug merged 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-2885-error-constructors

Conversation

@andrewtdiz

Copy link
Copy Markdown
Contributor

Fixes #2885.

Summary:

  • Add native EvalError and URIError ErrorHeader kinds, runtime constructors, and reserved instanceof class ids.
  • Route direct new EvalError(...) / new URIError(...), new globalThis.EvalError(...), and rebound global constructor construction through the native Error allocation path.
  • Expose constructor .name for the EvalError/URIError global constructor closures and include them in built-in error constructor matching.
  • Add focused node-suite parity coverage for constructor names, instance .name / .message, direct/static instanceof, dynamic instanceof, globalThis construction, empty-message construction, and rebound construction.

Parity evidence:

  • Pre-fix focused parity failed with Perry printing eval direct name: undefined for the new fixture.
  • Post-fix focused parity passed: test-parity/reports/parity_report_20260530_021600.json.

Verification:

  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH node --experimental-strip-types test-parity/node-suite/globals/error-eval-uri-constructors.ts
  • PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH RUSTC_WRAPPER= ./run_parity_tests.sh --suite node-suite --module globals --filter error-eval-uri-constructors
  • cargo fmt --all -- --check
  • jq empty test-parity/known_failures.json test-parity/threshold.json
  • git diff --check && git diff --cached --check
  • RUSTC_WRAPPER= cargo check -p perry-hir -p perry-codegen -p perry-runtime
  • RUSTC_WRAPPER= cargo test -p perry-runtime eval_and_uri_errors_have_distinct_kinds_and_names -- --test-threads=1

Known verification issue:

  • ./scripts/check_file_size.sh currently fails on existing base-state crates/perry-runtime/src/node_stream_readwrite.rs at 2001 lines; this branch does not touch that file.

@proggeramlug
proggeramlug merged commit 0779beb into PerryTS:main May 30, 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.

runtime: construct EvalError and URIError as native Error subclasses

2 participants