Skip to content

[TS] Route thrown exceptions into catch blocks - #463

Merged
CaelmBleidd merged 4 commits into
mainfrom
caelmbleidd/ts-427-catch-routing
Oct 11, 2026
Merged

CaelmBleidd merged 4 commits into
mainfrom
caelmbleidd/ts-427-catch-routing

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Thrown TypeScript values now enter the nearest catch handler and remain available to its binding. Without a handler, the interpreter unwinds to the caller and checks the call site. An unresolved throw expression no longer becomes an invented undefined exception.

Closes #427.

Implementation

  • Read the catch binding through EtsCaughtExceptionRef, retain the current stack frame until catch processing, and preserve the caught value when cloning a symbolic state.
  • Cover conditional throws, catch bindings, the nearest nested handler, exceptions from a callee, and rethrow to an outer handler. Generated witnesses replay in Node.js.
  • finally is tracked separately.

Based on main at 4983b75f9b783c607ebfc3b43fb201937a012b20, using its JacoDB bcad76ffd7 dependency. The diff contains 6 files, +244/-33.

Validation

  • 52 focused usvm-ts tests passed, covering catch routing with Node.js replay, exceptions, import/export resolution, captured method calls, named function bindings, and named function imports.
  • All 13 usvm-ts-calls tests passed.
  • :usvm-ts:detektMain, :usvm-ts:detektTest, and git diff --check passed.
  • Local tests used JDK 23 and Node.js 26 with the published JacoDB dependency. Test execution used c1baf80562f6e49531bcd74f672fac0e068ca966; the final head 2ee680c6df80e979a6961d66b963e4310979f554 adds only the two JVM files from the latest base commit. All tested TypeScript modules, their dependencies, and build configuration are byte-identical between these heads.

Full GitHub CI is separate from the local checks above.

@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-422-string-value-equality branch from 7927e93 to 127ecb5 Compare October 3, 2026 05:21
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-427-catch-routing branch from e0bc56a to 2d655b8 Compare October 3, 2026 05:28
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review October 3, 2026 06:44
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-422-string-value-equality branch from e5527a3 to 7217c2a Compare October 4, 2026 19:51
Base automatically changed from caelmbleidd/ts-422-string-value-equality to main October 5, 2026 12:37
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-427-catch-routing branch from f289903 to 085fbd0 Compare October 10, 2026 17:07
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-427-catch-routing branch from f1d168e to 2ee680c Compare October 11, 2026 16:36
@CaelmBleidd
CaelmBleidd merged commit 0873046 into main Oct 11, 2026
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/ts-427-catch-routing branch October 11, 2026 16:44
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.

[TS] Route thrown exceptions into catch blocks

2 participants