Skip to content

Commit a15bc34

Browse files
committed
[compiler] Support optional/logical/etc within try/catch (#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](b8a6bfa)
1 parent 876e0ab commit a15bc34

35 files changed

+211
-239
lines changed

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 125 additions & 153 deletions
Large diffs are not rendered by default.

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ed4bd540ca67f1c4db65f009ad726a5ae1a0af01
1+
b8a6bfa22c8cfc11863f2373fde44ae36695cd0b
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ed4bd540ca67f1c4db65f009ad726a5ae1a0af01
1+
b8a6bfa22c8cfc11863f2373fde44ae36695cd0b

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ __DEV__ &&
14931493
exports.useTransition = function () {
14941494
return resolveDispatcher().useTransition();
14951495
};
1496-
exports.version = "19.3.0-www-classic-ed4bd540-20260202";
1496+
exports.version = "19.3.0-www-classic-b8a6bfa2-20260202";
14971497
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14981498
"function" ===
14991499
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ __DEV__ &&
14931493
exports.useTransition = function () {
14941494
return resolveDispatcher().useTransition();
14951495
};
1496-
exports.version = "19.3.0-www-modern-ed4bd540-20260202";
1496+
exports.version = "19.3.0-www-modern-b8a6bfa2-20260202";
14971497
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14981498
"function" ===
14991499
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-classic-ed4bd540-20260202";
613+
exports.version = "19.3.0-www-classic-b8a6bfa2-20260202";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-modern-ed4bd540-20260202";
613+
exports.version = "19.3.0-www-modern-b8a6bfa2-20260202";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.3.0-www-classic-ed4bd540-20260202";
617+
exports.version = "19.3.0-www-classic-b8a6bfa2-20260202";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.3.0-www-modern-ed4bd540-20260202";
617+
exports.version = "19.3.0-www-modern-b8a6bfa2-20260202";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20360,10 +20360,10 @@ __DEV__ &&
2036020360
(function () {
2036120361
var internals = {
2036220362
bundleType: 1,
20363-
version: "19.3.0-www-classic-ed4bd540-20260202",
20363+
version: "19.3.0-www-classic-b8a6bfa2-20260202",
2036420364
rendererPackageName: "react-art",
2036520365
currentDispatcherRef: ReactSharedInternals,
20366-
reconcilerVersion: "19.3.0-www-classic-ed4bd540-20260202"
20366+
reconcilerVersion: "19.3.0-www-classic-b8a6bfa2-20260202"
2036720367
};
2036820368
internals.overrideHookState = overrideHookState;
2036920369
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20398,7 +20398,7 @@ __DEV__ &&
2039820398
exports.Shape = Shape;
2039920399
exports.Surface = Surface;
2040020400
exports.Text = Text;
20401-
exports.version = "19.3.0-www-classic-ed4bd540-20260202";
20401+
exports.version = "19.3.0-www-classic-b8a6bfa2-20260202";
2040220402
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2040320403
"function" ===
2040420404
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)