Commit 71c1d62
committed
[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.
DiffTrain build for [b8a6bfa](facebook@b8a6bfa)1 parent 62d3894 commit 71c1d62
File tree
21 files changed
+336
-396
lines changed- compiled-rn
- facebook-fbsource/xplat/js
- RKJSModules/vendor/react
- react-dom/cjs
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- tools/eslint-plugin-react-hooks
21 files changed
+336
-396
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
Lines changed: 124 additions & 134 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
1996 | | - | |
1997 | | - | |
1998 | 1996 | | |
1999 | 1997 | | |
2000 | 1998 | | |
| |||
10864 | 10862 | | |
10865 | 10863 | | |
10866 | 10864 | | |
10867 | | - | |
10868 | | - | |
10869 | | - | |
10870 | | - | |
10871 | | - | |
10872 | | - | |
| 10865 | + | |
10873 | 10866 | | |
10874 | 10867 | | |
10875 | 10868 | | |
| |||
13712 | 13705 | | |
13713 | 13706 | | |
13714 | 13707 | | |
13715 | | - | |
13716 | | - | |
13717 | | - | |
13718 | 13708 | | |
13719 | 13709 | | |
13720 | 13710 | | |
| |||
17746 | 17736 | | |
17747 | 17737 | | |
17748 | 17738 | | |
17749 | | - | |
| 17739 | + | |
17750 | 17740 | | |
17751 | 17741 | | |
17752 | 17742 | | |
17753 | 17743 | | |
17754 | 17744 | | |
17755 | 17745 | | |
17756 | | - | |
| 17746 | + | |
17757 | 17747 | | |
17758 | 17748 | | |
17759 | 17749 | | |
| |||
17773 | 17763 | | |
17774 | 17764 | | |
17775 | 17765 | | |
17776 | | - | |
| 17766 | + | |
17777 | 17767 | | |
17778 | | - | |
| 17768 | + | |
17779 | 17769 | | |
17780 | 17770 | | |
17781 | | - | |
| 17771 | + | |
17782 | 17772 | | |
17783 | 17773 | | |
17784 | | - | |
| 17774 | + | |
17785 | 17775 | | |
17786 | | - | |
17787 | | - | |
| 17776 | + | |
| 17777 | + | |
17788 | 17778 | | |
17789 | 17779 | | |
17790 | | - | |
17791 | | - | |
| 17780 | + | |
| 17781 | + | |
17792 | 17782 | | |
17793 | | - | |
| 17783 | + | |
17794 | 17784 | | |
17795 | 17785 | | |
17796 | 17786 | | |
| |||
17885 | 17875 | | |
17886 | 17876 | | |
17887 | 17877 | | |
17888 | | - | |
| 17878 | + | |
Lines changed: 12 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
2071 | 2071 | | |
2072 | 2072 | | |
2073 | 2073 | | |
2074 | | - | |
2075 | | - | |
2076 | 2074 | | |
2077 | 2075 | | |
2078 | 2076 | | |
| |||
11807 | 11805 | | |
11808 | 11806 | | |
11809 | 11807 | | |
11810 | | - | |
11811 | | - | |
11812 | | - | |
11813 | | - | |
11814 | | - | |
11815 | | - | |
| 11808 | + | |
11816 | 11809 | | |
11817 | 11810 | | |
11818 | 11811 | | |
| |||
15683 | 15676 | | |
15684 | 15677 | | |
15685 | 15678 | | |
15686 | | - | |
15687 | | - | |
15688 | | - | |
15689 | 15679 | | |
15690 | 15680 | | |
15691 | 15681 | | |
| |||
19735 | 19725 | | |
19736 | 19726 | | |
19737 | 19727 | | |
19738 | | - | |
| 19728 | + | |
19739 | 19729 | | |
19740 | 19730 | | |
19741 | 19731 | | |
19742 | 19732 | | |
19743 | 19733 | | |
19744 | 19734 | | |
19745 | | - | |
| 19735 | + | |
19746 | 19736 | | |
19747 | 19737 | | |
19748 | 19738 | | |
| |||
19764 | 19754 | | |
19765 | 19755 | | |
19766 | 19756 | | |
19767 | | - | |
| 19757 | + | |
19768 | 19758 | | |
19769 | 19759 | | |
19770 | | - | |
| 19760 | + | |
19771 | 19761 | | |
19772 | 19762 | | |
19773 | 19763 | | |
| |||
19785 | 19775 | | |
19786 | 19776 | | |
19787 | 19777 | | |
19788 | | - | |
| 19778 | + | |
19789 | 19779 | | |
19790 | | - | |
19791 | | - | |
| 19780 | + | |
| 19781 | + | |
19792 | 19782 | | |
19793 | 19783 | | |
19794 | | - | |
| 19784 | + | |
19795 | 19785 | | |
19796 | 19786 | | |
19797 | | - | |
| 19787 | + | |
19798 | 19788 | | |
19799 | 19789 | | |
19800 | 19790 | | |
| |||
19890 | 19880 | | |
19891 | 19881 | | |
19892 | 19882 | | |
19893 | | - | |
| 19883 | + | |
0 commit comments