mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-26 06:34:20 +08:00
The may-throw analysis now models handlers. A throwing operation or call inside a `try` with a `catch`, or inside a try/catch whose `finally` never completes normally (it returns, breaks or continues, discarding the pending exception), adds no seed and no call edge. The catch and finally bodies are analyzed like any other code, so rethrows and a finally that re-raises stay exact. Worker programs (a termination request unwinds through catch) and generator bodies (a `.return()` does too) keep the conservative answer. Unreachable statements no longer seed: the frontend's SC9002 trap after a body that returns from both its try and its catch (or ends in a switch with a default, or an infinite loop) is dead code. On tsc-ts this drops 14 functions from the may-throw set and 44 pending-exception checks. A NoThrow function may now contain handled calls; the SC7001 hint names the remedy that applies (catch it, remove the recursion, or the worker exception).