mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Repro for missing predecessor with try/catch
Found when running the compiler on a large swath of internal code. PruneMaybeThrows rewrites terminals, but the logic to update subsequent phis was incorrectly dropping phis rather than rewriting them. Fixed in the next PR.
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
// @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
|
||||
function useSupportsTouchEvent() {
|
||||
return useMemo(() => {
|
||||
if (checkforTouchEvents) {
|
||||
try {
|
||||
document.createEvent("TouchEvent");
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
Cannot read properties of undefined (reading 'preds')
|
||||
```
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
|
||||
function useSupportsTouchEvent() {
|
||||
return useMemo(() => {
|
||||
if (checkforTouchEvents) {
|
||||
try {
|
||||
document.createEvent("TouchEvent");
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
}
|
||||
Reference in New Issue
Block a user