Commit b8a6bfa
authored
[compiler] Support optional/logical/etc within try/catch (facebook#35606)
Adds support for value terminals (optional/logical/ternary/sequence)
within try/catch clauses.
Try/catch expressions insert maybe-throw terminals after each
instruction, but BuildReactiveFunction's value block extraction was not
expecting these terminals. The fix is to roughly treat maybe-throw
similarly to goto, falling through to the continuation block, but there
are a few edge cases to handle.
I've also added extensive tests, including testing that errors correctly
flow to the catch handler.1 parent ed4bd54 commit b8a6bfa
File tree
30 files changed
+1313
-341
lines changed- compiler/packages/babel-plugin-react-compiler/src
- Inference
- ReactiveScopes
- Validation
- __tests__/fixtures/compiler
30 files changed
+1313
-341
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
586 | 590 | | |
587 | 591 | | |
588 | 592 | | |
| |||
0 commit comments