Commit da843fd
committed
[compiler] Fix
This is a combination of a) a subagent for investigating compiler errors
and b) testing that agent by fixing bugs with for loops within
try/catch. My recent diffs to support maybe-throw within value blocks
was incomplete and handled many cases, like optionals/logicals/etc
within try/catch. However, the handling for for loops was making more
assumptions and needed additional fixes.
Key changes:
* `maybe-throw` terminal `handler` is now nullable. PruneMaybeThrows
nulls the handler for blocks that cannot throw, rather than changing to
a `goto`. This preserves more information, and makes it easier for
BuildReactiveFunction's visitValueBlock() to reconstruct the value
blocks
* Updates BuildReactiveFunction's handling of `for` init/test/update
(and similar for `for..of` and `for..in`) to correctly extract value
blocks. The previous logic made assumptions about the shape of the
SequenceExpression which were incorrect in some cases within try/catch.
The new helper extracts a flattened SequenceExpression.
Supporting changes:
* The agent itself (tested via this diff)
* Updated the script for invoking snap to keep `compiler/` as the
working directory, allowing relative paths to work more easily
* Add an `--update` (`-u`) flag to `yarn snap minimize`, which updates
the fixture in place w the minimized version
DiffTrain build for [cd0c487](cd0c487)for loops in try/catch (#35686)1 parent 2e304af commit da843fd
File tree
23 files changed
+175
-297
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
- cjs
23 files changed
+175
-297
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: 15 additions & 9 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 | | |
| |||
3923 | 3923 | | |
3924 | 3924 | | |
3925 | 3925 | | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
3926 | 3931 | | |
3927 | 3932 | | |
3928 | 3933 | | |
| |||
3936 | 3941 | | |
3937 | 3942 | | |
3938 | 3943 | | |
3939 | | - | |
| 3944 | + | |
3940 | 3945 | | |
3941 | 3946 | | |
3942 | 3947 | | |
| |||
4168 | 4173 | | |
4169 | 4174 | | |
4170 | 4175 | | |
4171 | | - | |
| 4176 | + | |
| 4177 | + | |
4172 | 4178 | | |
4173 | | - | |
| 4179 | + | |
4174 | 4180 | | |
4175 | 4181 | | |
4176 | 4182 | | |
| |||
30176 | 30182 | | |
30177 | 30183 | | |
30178 | 30184 | | |
30179 | | - | |
| 30185 | + | |
30180 | 30186 | | |
30181 | 30187 | | |
30182 | 30188 | | |
30183 | | - | |
| 30189 | + | |
30184 | 30190 | | |
30185 | 30191 | | |
30186 | 30192 | | |
| |||
30217 | 30223 | | |
30218 | 30224 | | |
30219 | 30225 | | |
30220 | | - | |
| 30226 | + | |
30221 | 30227 | | |
30222 | 30228 | | |
30223 | | - | |
| 30229 | + | |
30224 | 30230 | | |
30225 | 30231 | | |
30226 | 30232 | | |
| |||
30370 | 30376 | | |
30371 | 30377 | | |
30372 | 30378 | | |
30373 | | - | |
| 30379 | + | |
30374 | 30380 | | |
Lines changed: 6 additions & 6 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 | | |
| |||
17751 | 17751 | | |
17752 | 17752 | | |
17753 | 17753 | | |
17754 | | - | |
| 17754 | + | |
17755 | 17755 | | |
17756 | 17756 | | |
17757 | 17757 | | |
17758 | 17758 | | |
17759 | 17759 | | |
17760 | 17760 | | |
17761 | | - | |
| 17761 | + | |
17762 | 17762 | | |
17763 | 17763 | | |
17764 | 17764 | | |
| |||
17780 | 17780 | | |
17781 | 17781 | | |
17782 | 17782 | | |
17783 | | - | |
| 17783 | + | |
17784 | 17784 | | |
17785 | 17785 | | |
17786 | | - | |
| 17786 | + | |
17787 | 17787 | | |
17788 | 17788 | | |
17789 | 17789 | | |
| |||
17890 | 17890 | | |
17891 | 17891 | | |
17892 | 17892 | | |
17893 | | - | |
| 17893 | + | |
Lines changed: 6 additions & 6 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 | | |
| |||
19740 | 19740 | | |
19741 | 19741 | | |
19742 | 19742 | | |
19743 | | - | |
| 19743 | + | |
19744 | 19744 | | |
19745 | 19745 | | |
19746 | 19746 | | |
19747 | 19747 | | |
19748 | 19748 | | |
19749 | 19749 | | |
19750 | | - | |
| 19750 | + | |
19751 | 19751 | | |
19752 | 19752 | | |
19753 | 19753 | | |
| |||
19769 | 19769 | | |
19770 | 19770 | | |
19771 | 19771 | | |
19772 | | - | |
| 19772 | + | |
19773 | 19773 | | |
19774 | 19774 | | |
19775 | | - | |
| 19775 | + | |
19776 | 19776 | | |
19777 | 19777 | | |
19778 | 19778 | | |
| |||
19895 | 19895 | | |
19896 | 19896 | | |
19897 | 19897 | | |
19898 | | - | |
| 19898 | + | |
Lines changed: 15 additions & 9 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 | | |
| |||
3931 | 3931 | | |
3932 | 3932 | | |
3933 | 3933 | | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
3934 | 3939 | | |
3935 | 3940 | | |
3936 | 3941 | | |
| |||
3944 | 3949 | | |
3945 | 3950 | | |
3946 | 3951 | | |
3947 | | - | |
| 3952 | + | |
3948 | 3953 | | |
3949 | 3954 | | |
3950 | 3955 | | |
| |||
4176 | 4181 | | |
4177 | 4182 | | |
4178 | 4183 | | |
4179 | | - | |
| 4184 | + | |
| 4185 | + | |
4180 | 4186 | | |
4181 | | - | |
| 4187 | + | |
4182 | 4188 | | |
4183 | 4189 | | |
4184 | 4190 | | |
| |||
30238 | 30244 | | |
30239 | 30245 | | |
30240 | 30246 | | |
30241 | | - | |
| 30247 | + | |
30242 | 30248 | | |
30243 | 30249 | | |
30244 | 30250 | | |
30245 | | - | |
| 30251 | + | |
30246 | 30252 | | |
30247 | 30253 | | |
30248 | 30254 | | |
| |||
30279 | 30285 | | |
30280 | 30286 | | |
30281 | 30287 | | |
30282 | | - | |
| 30288 | + | |
30283 | 30289 | | |
30284 | 30290 | | |
30285 | | - | |
| 30291 | + | |
30286 | 30292 | | |
30287 | 30293 | | |
30288 | 30294 | | |
| |||
30748 | 30754 | | |
30749 | 30755 | | |
30750 | 30756 | | |
30751 | | - | |
| 30757 | + | |
30752 | 30758 | | |
30753 | 30759 | | |
30754 | 30760 | | |
| |||
Lines changed: 6 additions & 6 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 | | |
| |||
17768 | 17768 | | |
17769 | 17769 | | |
17770 | 17770 | | |
17771 | | - | |
| 17771 | + | |
17772 | 17772 | | |
17773 | 17773 | | |
17774 | 17774 | | |
17775 | 17775 | | |
17776 | 17776 | | |
17777 | 17777 | | |
17778 | | - | |
| 17778 | + | |
17779 | 17779 | | |
17780 | 17780 | | |
17781 | 17781 | | |
| |||
17797 | 17797 | | |
17798 | 17798 | | |
17799 | 17799 | | |
17800 | | - | |
| 17800 | + | |
17801 | 17801 | | |
17802 | 17802 | | |
17803 | | - | |
| 17803 | + | |
17804 | 17804 | | |
17805 | 17805 | | |
17806 | 17806 | | |
| |||
18060 | 18060 | | |
18061 | 18061 | | |
18062 | 18062 | | |
18063 | | - | |
| 18063 | + | |
Lines changed: 6 additions & 6 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 | | |
| |||
19761 | 19761 | | |
19762 | 19762 | | |
19763 | 19763 | | |
19764 | | - | |
| 19764 | + | |
19765 | 19765 | | |
19766 | 19766 | | |
19767 | 19767 | | |
19768 | 19768 | | |
19769 | 19769 | | |
19770 | 19770 | | |
19771 | | - | |
| 19771 | + | |
19772 | 19772 | | |
19773 | 19773 | | |
19774 | 19774 | | |
| |||
19790 | 19790 | | |
19791 | 19791 | | |
19792 | 19792 | | |
19793 | | - | |
| 19793 | + | |
19794 | 19794 | | |
19795 | 19795 | | |
19796 | | - | |
| 19796 | + | |
19797 | 19797 | | |
19798 | 19798 | | |
19799 | 19799 | | |
| |||
20069 | 20069 | | |
20070 | 20070 | | |
20071 | 20071 | | |
20072 | | - | |
| 20072 | + | |
20073 | 20073 | | |
20074 | 20074 | | |
20075 | 20075 | | |
| |||
0 commit comments