Skip to content

fix(runtime): implement assert throws helpers#1924

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-assert-throws-sync
May 27, 2026
Merged

fix(runtime): implement assert throws helpers#1924
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-assert-throws-sync

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

@andrewtdiz andrewtdiz commented May 27, 2026

Summary

  • implement synchronous assert.throws and assert.doesNotThrow for node:assert and node:assert/strict
  • trap callback exceptions through Perry's native exception stack
  • support regexp, built-in Error constructor, and shallow error-object matcher cases
  • wire static/native lowering, callable exports, API manifest/docs, and runtime tests

Verification

  • ./run_parity_tests.sh --suite node-suite --module assert --filter generated-message/throws-generated PASS
  • ./run_parity_tests.sh --suite node-suite --module assert --filter errors/throws PASS 2/2
  • ./run_parity_tests.sh --suite node-suite --module assert --filter errors/strict-throws-validation PASS
  • ./run_parity_tests.sh --suite node-suite --module assert PASS threshold: 55 pass / 8 fail / 0 compile fail
  • cargo test -p perry-runtime assert --lib PASS
  • cargo test -p perry-codegen manifest_consistency --lib PASS
  • bash scripts/regen_api_docs.sh PASS
  • cargo fmt --all -- --check PASS
  • git diff --check PASS
  • jq empty test-parity/known_failures.json PASS

Residual full-suite assert failures are unrelated lanes: deep equality edge cases, async rejects, and CallTracker version skew. Full dynamic Error property storage is also left out of this slice.

@andrewtdiz andrewtdiz force-pushed the codex/node-compat-assert-throws-sync branch 3 times, most recently from f562ee6 to e8c8d12 Compare May 27, 2026 05:38
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