Skip to content

Commit 128f43a

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 7e3b3b6 commit 128f43a

23 files changed

+324
-380
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.3.0-native-fb-64b4605c-20260130
1+
19.3.0-native-fb-b8a6bfa2-20260202

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<8b8a8f72b7f0b6c80155a65477fbc327>>
10+
* @generated SignedSource<<3345acd741e23ad266aef2263d66221c>>
1111
*/
1212

1313
"use strict";
@@ -410,5 +410,5 @@ __DEV__ &&
410410
exports.useFormStatus = function () {
411411
return resolveDispatcher().useHostTransitionStatus();
412412
};
413-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
413+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";
414414
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<51b3401699731c80f38a3c41f6d6ab64>>
10+
* @generated SignedSource<<c17af8e427b030a1729ccab56dca2be5>>
1111
*/
1212

1313
"use strict";
@@ -209,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
209209
exports.useFormStatus = function () {
210210
return ReactSharedInternals.H.useHostTransitionStatus();
211211
};
212-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
212+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<51b3401699731c80f38a3c41f6d6ab64>>
10+
* @generated SignedSource<<c17af8e427b030a1729ccab56dca2be5>>
1111
*/
1212

1313
"use strict";
@@ -209,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
209209
exports.useFormStatus = function () {
210210
return ReactSharedInternals.H.useHostTransitionStatus();
211211
};
212-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
212+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<01c906935bc034c4ac6623f78f90554e>>
10+
* @generated SignedSource<<4ee295b6c6dafb7641b6474c58df4e16>>
1111
*/
1212

1313
/*
@@ -30138,11 +30138,11 @@ __DEV__ &&
3013830138
};
3013930139
(function () {
3014030140
var isomorphicReactPackageVersion = React.version;
30141-
if ("19.3.0-native-fb-64b4605c-20260130" !== isomorphicReactPackageVersion)
30141+
if ("19.3.0-native-fb-b8a6bfa2-20260202" !== isomorphicReactPackageVersion)
3014230142
throw Error(
3014330143
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3014430144
(isomorphicReactPackageVersion +
30145-
"\n - react-dom: 19.3.0-native-fb-64b4605c-20260130\nLearn more: https://react.dev/warnings/version-mismatch")
30145+
"\n - react-dom: 19.3.0-native-fb-b8a6bfa2-20260202\nLearn more: https://react.dev/warnings/version-mismatch")
3014630146
);
3014730147
})();
3014830148
("function" === typeof Map &&
@@ -30179,10 +30179,10 @@ __DEV__ &&
3017930179
!(function () {
3018030180
var internals = {
3018130181
bundleType: 1,
30182-
version: "19.3.0-native-fb-64b4605c-20260130",
30182+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
3018330183
rendererPackageName: "react-dom",
3018430184
currentDispatcherRef: ReactSharedInternals,
30185-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130"
30185+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202"
3018630186
};
3018730187
internals.overrideHookState = overrideHookState;
3018830188
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30332,5 +30332,5 @@ __DEV__ &&
3033230332
listenToAllSupportedEvents(container);
3033330333
return new ReactDOMHydrationRoot(initialChildren);
3033430334
};
30335-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
30335+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";
3033630336
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<73939d777e48ffe22decda6aad255bde>>
10+
* @generated SignedSource<<89c3c5c4b39dcfc0a11ba59ba11e646e>>
1111
*/
1212

1313
/*
@@ -17736,14 +17736,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1773617736
};
1773717737
var isomorphicReactPackageVersion$jscomp$inline_2054 = React.version;
1773817738
if (
17739-
"19.3.0-native-fb-64b4605c-20260130" !==
17739+
"19.3.0-native-fb-b8a6bfa2-20260202" !==
1774017740
isomorphicReactPackageVersion$jscomp$inline_2054
1774117741
)
1774217742
throw Error(
1774317743
formatProdErrorMessage(
1774417744
527,
1774517745
isomorphicReactPackageVersion$jscomp$inline_2054,
17746-
"19.3.0-native-fb-64b4605c-20260130"
17746+
"19.3.0-native-fb-b8a6bfa2-20260202"
1774717747
)
1774817748
);
1774917749
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17765,10 +17765,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1776517765
};
1776617766
var internals$jscomp$inline_2638 = {
1776717767
bundleType: 0,
17768-
version: "19.3.0-native-fb-64b4605c-20260130",
17768+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
1776917769
rendererPackageName: "react-dom",
1777017770
currentDispatcherRef: ReactSharedInternals,
17771-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130"
17771+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202"
1777217772
};
1777317773
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1777417774
var hook$jscomp$inline_2639 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17875,4 +17875,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1787517875
listenToAllSupportedEvents(container);
1787617876
return new ReactDOMHydrationRoot(initialChildren);
1787717877
};
17878-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
17878+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<384db8b3a6f85b70ce27a6b84ab2289d>>
10+
* @generated SignedSource<<76b753fb062b95878733ce8daeb258d5>>
1111
*/
1212

1313
/*
@@ -19725,14 +19725,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1972519725
};
1972619726
var isomorphicReactPackageVersion$jscomp$inline_2402 = React.version;
1972719727
if (
19728-
"19.3.0-native-fb-64b4605c-20260130" !==
19728+
"19.3.0-native-fb-b8a6bfa2-20260202" !==
1972919729
isomorphicReactPackageVersion$jscomp$inline_2402
1973019730
)
1973119731
throw Error(
1973219732
formatProdErrorMessage(
1973319733
527,
1973419734
isomorphicReactPackageVersion$jscomp$inline_2402,
19735-
"19.3.0-native-fb-64b4605c-20260130"
19735+
"19.3.0-native-fb-b8a6bfa2-20260202"
1973619736
)
1973719737
);
1973819738
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19754,10 +19754,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1975419754
};
1975519755
var internals$jscomp$inline_2409 = {
1975619756
bundleType: 0,
19757-
version: "19.3.0-native-fb-64b4605c-20260130",
19757+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
1975819758
rendererPackageName: "react-dom",
1975919759
currentDispatcherRef: ReactSharedInternals,
19760-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130",
19760+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202",
1976119761
getLaneLabelMap: function () {
1976219762
for (
1976319763
var map = new Map(), lane = 1, index$336 = 0;
@@ -19880,4 +19880,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1988019880
listenToAllSupportedEvents(container);
1988119881
return new ReactDOMHydrationRoot(initialChildren);
1988219882
};
19883-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
19883+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0e7a59667e6c20b860fc0e2dfab95f7e>>
10+
* @generated SignedSource<<1bf27cf0f20358abbb6a8bd4a1bcae61>>
1111
*/
1212

1313
/*
@@ -30200,11 +30200,11 @@ __DEV__ &&
3020030200
};
3020130201
(function () {
3020230202
var isomorphicReactPackageVersion = React.version;
30203-
if ("19.3.0-native-fb-64b4605c-20260130" !== isomorphicReactPackageVersion)
30203+
if ("19.3.0-native-fb-b8a6bfa2-20260202" !== isomorphicReactPackageVersion)
3020430204
throw Error(
3020530205
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3020630206
(isomorphicReactPackageVersion +
30207-
"\n - react-dom: 19.3.0-native-fb-64b4605c-20260130\nLearn more: https://react.dev/warnings/version-mismatch")
30207+
"\n - react-dom: 19.3.0-native-fb-b8a6bfa2-20260202\nLearn more: https://react.dev/warnings/version-mismatch")
3020830208
);
3020930209
})();
3021030210
("function" === typeof Map &&
@@ -30241,10 +30241,10 @@ __DEV__ &&
3024130241
!(function () {
3024230242
var internals = {
3024330243
bundleType: 1,
30244-
version: "19.3.0-native-fb-64b4605c-20260130",
30244+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
3024530245
rendererPackageName: "react-dom",
3024630246
currentDispatcherRef: ReactSharedInternals,
30247-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130"
30247+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202"
3024830248
};
3024930249
internals.overrideHookState = overrideHookState;
3025030250
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30710,7 +30710,7 @@ __DEV__ &&
3071030710
exports.useFormStatus = function () {
3071130711
return resolveDispatcher().useHostTransitionStatus();
3071230712
};
30713-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
30713+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";
3071430714
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
3071530715
"function" ===
3071630716
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0e3a226e39963d856c34d5ad3500508a>>
10+
* @generated SignedSource<<d1f914d9afc627bb818dc68d8f0ec90f>>
1111
*/
1212

1313
/*
@@ -17753,14 +17753,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1775317753
};
1775417754
var isomorphicReactPackageVersion$jscomp$inline_2055 = React.version;
1775517755
if (
17756-
"19.3.0-native-fb-64b4605c-20260130" !==
17756+
"19.3.0-native-fb-b8a6bfa2-20260202" !==
1775717757
isomorphicReactPackageVersion$jscomp$inline_2055
1775817758
)
1775917759
throw Error(
1776017760
formatProdErrorMessage(
1776117761
527,
1776217762
isomorphicReactPackageVersion$jscomp$inline_2055,
17763-
"19.3.0-native-fb-64b4605c-20260130"
17763+
"19.3.0-native-fb-b8a6bfa2-20260202"
1776417764
)
1776517765
);
1776617766
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17782,10 +17782,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1778217782
};
1778317783
var internals$jscomp$inline_2641 = {
1778417784
bundleType: 0,
17785-
version: "19.3.0-native-fb-64b4605c-20260130",
17785+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
1778617786
rendererPackageName: "react-dom",
1778717787
currentDispatcherRef: ReactSharedInternals,
17788-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130"
17788+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202"
1778917789
};
1779017790
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1779117791
var hook$jscomp$inline_2642 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -18045,4 +18045,4 @@ exports.useFormState = function (action, initialState, permalink) {
1804518045
exports.useFormStatus = function () {
1804618046
return ReactSharedInternals.H.useHostTransitionStatus();
1804718047
};
18048-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
18048+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<851bb381b20b39b8432bc1b6456fff50>>
10+
* @generated SignedSource<<92a8a3be22dc0bc08005215d4495df64>>
1111
*/
1212

1313
/*
@@ -19746,14 +19746,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1974619746
};
1974719747
var isomorphicReactPackageVersion$jscomp$inline_2403 = React.version;
1974819748
if (
19749-
"19.3.0-native-fb-64b4605c-20260130" !==
19749+
"19.3.0-native-fb-b8a6bfa2-20260202" !==
1975019750
isomorphicReactPackageVersion$jscomp$inline_2403
1975119751
)
1975219752
throw Error(
1975319753
formatProdErrorMessage(
1975419754
527,
1975519755
isomorphicReactPackageVersion$jscomp$inline_2403,
19756-
"19.3.0-native-fb-64b4605c-20260130"
19756+
"19.3.0-native-fb-b8a6bfa2-20260202"
1975719757
)
1975819758
);
1975919759
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19775,10 +19775,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1977519775
};
1977619776
var internals$jscomp$inline_2410 = {
1977719777
bundleType: 0,
19778-
version: "19.3.0-native-fb-64b4605c-20260130",
19778+
version: "19.3.0-native-fb-b8a6bfa2-20260202",
1977919779
rendererPackageName: "react-dom",
1978019780
currentDispatcherRef: ReactSharedInternals,
19781-
reconcilerVersion: "19.3.0-native-fb-64b4605c-20260130",
19781+
reconcilerVersion: "19.3.0-native-fb-b8a6bfa2-20260202",
1978219782
getLaneLabelMap: function () {
1978319783
for (
1978419784
var map = new Map(), lane = 1, index$336 = 0;
@@ -20054,7 +20054,7 @@ exports.useFormState = function (action, initialState, permalink) {
2005420054
exports.useFormStatus = function () {
2005520055
return ReactSharedInternals.H.useHostTransitionStatus();
2005620056
};
20057-
exports.version = "19.3.0-native-fb-64b4605c-20260130";
20057+
exports.version = "19.3.0-native-fb-b8a6bfa2-20260202";
2005820058
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2005920059
"function" ===
2006020060
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)