| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ly handle returns and re-throws (test): - enable previously skipped re-throw tests - add tests for complex try-catch-finally return and throw scenarios
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Refactors the TypeScript-to-Lua try/catch/finally transformation to correctly handle control flow (return/break/continue) across try, catch, and finally blocks. Previously, finally did not behave correctly with respect to control flow (see #1137), and break/continue inside try were only handled in async contexts.
Changes:
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/transformation/visitors/errors.ts | Rewrote try transform with double-pcall pattern and propagated source nodes to emitted Lua nodes. |
| src/transformation/visitors/break-continue.ts | Removed async-only gating; now uses the renamed findTryScopeBeforeLoop and tryHas{Break,Continue} flags. |
| src/transformation/utils/scope.ts | Renamed scope fields and helper to drop the async prefix since they now apply to all try scopes. |
| test/unit/error.spec.ts | Added many new tests for finally-overriding-return, throw-in-finally, and break/continue inside try/catch; enabled the previously-skipped re-throw test. |
Sorry, something went wrong.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tryCall Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract duplicated return-if-has-return-or-error into a module-level helper. Expand the elseBranch ternary into an explicit if/else with comments for each case (non-empty catch, no catch, empty catch). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- implement break and continue support within try-catch-finally blocks - generalize and rename async-specific try scope properties and helpers (test): add tests for break and continue inside try-catch-finally blocks
| Back | FazBrowse Home | New Git URL |
Depends on #1726
Summary