Skip to content

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

Open
CaelmBleidd wants to merge 5 commits into
mainfrom
caelmbleidd/ts-427-catch-routing
Open

CaelmBleidd wants to merge 5 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.
  • Pin JacoDB to the merged neo commit 147d3b2797b693755c1d09fc28047ba43577a609 ([TS] Preserve exceptional CFG edges for try/catch jacodb#393), which provides exceptional CFG edges and caught-exception references.
  • Align two import-resolution test assertions with the dependency's default-export metadata contract: originalName is the storage name default, while nameBeforeAs retains Helper.
  • 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.

Validation

On head f1d168e7a5034945ae0c28c4b30fe263ae7c63f7:

  • 101 focused usvm-ts tests passed; 19 existing disabled tests were skipped. Coverage includes catch routing, exceptions, string equality, symbolic strings/concatenation, property deletion, allocated arrays, imports, and import/export resolution.
  • All 13 usvm-ts-calls tests passed.
  • :usvm-ts:detektMain, :usvm-ts:detektTest, and git diff --check passed.
  • JitPack published the exact merged dependency commit, and local checks used its downloaded artifacts on JDK 23 without composite dependency substitution. These checks do not establish the full GitHub CI result.
  • The local pre-commit hook invokes the absent checkLicense task; the dependency follow-up commit bypassed that hook after the checks above passed.

The branch is based on main at 4141213cf4623f9e3c7e3c37cbc35786d7ccc407; previously merged string changes are excluded from this PR's diff.

@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
Use the merged neo commit 147d3b2797b693755c1d09fc28047ba43577a609 and align default-export metadata assertions with its storage-name contract.
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