Commit 9c12b19
committed
[compiler] Fix for PropertyStore object effect
Fix for the issue in the previous PR. Long-term the ideal thing would be to make InferMutableRanges smarter about Store effects, and recognize that they are also transitive mutations of whatever was captured into the object. So in the following:
```
const x = {y: {z: {}}};
x.y.z.key = value;
```
That the `PropertyStore z . 'key' = value` is a transitive mutation of x and all three object expressions (x, x.y, x.y.z).
But for now it's simpler to stick to the original idea of Store only counting if we know that the type is an object.
ghstack-source-id: 2a140f2
Pull Request resolved: #331641 parent 07044a1 commit 9c12b19
3 files changed
Lines changed: 16 additions & 35 deletions
File tree
- compiler/packages/babel-plugin-react-compiler/src
- Inference
- __tests__/fixtures/compiler
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
1313 | 1314 | | |
1314 | 1315 | | |
1315 | 1316 | | |
1316 | | - | |
| 1317 | + | |
1317 | 1318 | | |
1318 | 1319 | | |
1319 | 1320 | | |
| |||
1342 | 1343 | | |
1343 | 1344 | | |
1344 | 1345 | | |
1345 | | - | |
| 1346 | + | |
1346 | 1347 | | |
1347 | 1348 | | |
1348 | 1349 | | |
1349 | | - | |
| 1350 | + | |
1350 | 1351 | | |
1351 | 1352 | | |
1352 | 1353 | | |
1353 | 1354 | | |
1354 | 1355 | | |
1355 | 1356 | | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | 1357 | | |
1361 | 1358 | | |
1362 | 1359 | | |
1363 | | - | |
| 1360 | + | |
1364 | 1361 | | |
1365 | 1362 | | |
1366 | 1363 | | |
| |||
1372 | 1369 | | |
1373 | 1370 | | |
1374 | 1371 | | |
1375 | | - | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1376 | 1375 | | |
1377 | 1376 | | |
1378 | 1377 | | |
| |||
1409 | 1408 | | |
1410 | 1409 | | |
1411 | 1410 | | |
1412 | | - | |
| 1411 | + | |
1413 | 1412 | | |
1414 | 1413 | | |
1415 | 1414 | | |
| |||
1419 | 1418 | | |
1420 | 1419 | | |
1421 | 1420 | | |
1422 | | - | |
| 1421 | + | |
1423 | 1422 | | |
1424 | 1423 | | |
1425 | 1424 | | |
| |||
Lines changed: 2 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 50 | + | |
70 | 51 | | |
71 | 52 | | |
72 | 53 | | |
| |||
0 commit comments