Skip to content

Commit

Permalink
Override the getCurrentStack temporarily while printing uncaught erro…
Browse files Browse the repository at this point in the history
…rs (#30309)

This is just a follow up to #30300.

I forgot the uncaught branch.

DiffTrain build for [29552c7](29552c7)
  • Loading branch information
sebmarkbage committed Jul 10, 2024
1 parent f708486 commit 5fb5ce8
Show file tree
Hide file tree
Showing 34 changed files with 224 additions and 144 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fe9828954adcc51aa2bd21fe53d969a44dd3c9d2
29552c7907230222acd3f2c586784d24f9da6200
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fe9828954adcc51aa2bd21fe53d969a44dd3c9d2
29552c7907230222acd3f2c586784d24f9da6200
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-fe9828954a-20240710";
exports.version = "19.0.0-www-modern-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-fe9828954a-20240710";
exports.version = "19.0.0-www-modern-29552c7907-20240710";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-fe9828954a-20240710";
exports.version = "19.0.0-www-modern-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17017,14 +17017,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-classic-29552c7907-20240710"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-classic-fe9828954a-20240710",
version: "19.0.0-www-classic-29552c7907-20240710",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16432,14 +16432,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-modern-29552c7907-20240710"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-modern-fe9828954a-20240710",
version: "19.0.0-www-modern-29552c7907-20240710",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10749,7 +10749,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-fe9828954a-20240710",
version: "19.0.0-www-classic-29552c7907-20240710",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1386 = {
Expand Down Expand Up @@ -10780,7 +10780,7 @@ var internals$jscomp$inline_1386 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-classic-29552c7907-20240710"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10202,7 +10202,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-fe9828954a-20240710",
version: "19.0.0-www-modern-29552c7907-20240710",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1372 = {
Expand Down Expand Up @@ -10233,7 +10233,7 @@ var internals$jscomp$inline_1372 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-modern-29552c7907-20240710"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
36 changes: 23 additions & 13 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7856,14 +7856,24 @@ __DEV__ &&
}
function defaultOnUncaughtError(error, errorInfo) {
reportGlobalError(error);
console.warn(
"%s\n\n%s\n%s",
componentName
? "An error occurred in the <" + componentName + "> component."
: "An error occurred in one of your React components.",
"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries.",
null != errorInfo.componentStack ? errorInfo.componentStack : ""
);
error = componentName
? "An error occurred in the <" + componentName + "> component."
: "An error occurred in one of your React components.";
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack,
componentStack =
null != errorInfo.componentStack ? errorInfo.componentStack : "";
ReactSharedInternals.getCurrentStack = function () {
return componentStack;
};
try {
warn(
"%s\n\n%s\n",
error,
"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
);
} finally {
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
}
}
function defaultOnCaughtError(error$1, errorInfo) {
var componentNameMessage = componentName
Expand Down Expand Up @@ -27556,11 +27566,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-fe9828954a-20240710" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-29552c7907-20240710" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-fe9828954a-20240710\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-29552c7907-20240710\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27626,12 +27636,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-classic-29552c7907-20240710"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-classic-fe9828954a-20240710",
version: "19.0.0-www-classic-29552c7907-20240710",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -28274,7 +28284,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
36 changes: 23 additions & 13 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -7401,14 +7401,24 @@ __DEV__ &&
}
function defaultOnUncaughtError(error, errorInfo) {
reportGlobalError(error);
console.warn(
"%s\n\n%s\n%s",
componentName
? "An error occurred in the <" + componentName + "> component."
: "An error occurred in one of your React components.",
"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries.",
null != errorInfo.componentStack ? errorInfo.componentStack : ""
);
error = componentName
? "An error occurred in the <" + componentName + "> component."
: "An error occurred in one of your React components.";
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack,
componentStack =
null != errorInfo.componentStack ? errorInfo.componentStack : "";
ReactSharedInternals.getCurrentStack = function () {
return componentStack;
};
try {
warn(
"%s\n\n%s\n",
error,
"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
);
} finally {
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
}
}
function defaultOnCaughtError(error$1, errorInfo) {
var componentNameMessage = componentName
Expand Down Expand Up @@ -26688,11 +26698,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-fe9828954a-20240710" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-29552c7907-20240710" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-fe9828954a-20240710\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-29552c7907-20240710\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26757,12 +26767,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-modern-29552c7907-20240710"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-modern-fe9828954a-20240710",
version: "19.0.0-www-modern-29552c7907-20240710",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -27358,7 +27368,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-fe9828954a-20240710";
exports.version = "19.0.0-www-modern-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17194,14 +17194,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1769 = React.version;
if (
"19.0.0-www-classic-fe9828954a-20240710" !==
"19.0.0-www-classic-29552c7907-20240710" !==
isomorphicReactPackageVersion$jscomp$inline_1769
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1769,
"19.0.0-www-classic-fe9828954a-20240710"
"19.0.0-www-classic-29552c7907-20240710"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17247,7 +17247,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1776 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-fe9828954a-20240710",
version: "19.0.0-www-classic-29552c7907-20240710",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2220 = {
Expand Down Expand Up @@ -17277,7 +17277,7 @@ var internals$jscomp$inline_2220 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-classic-29552c7907-20240710"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17741,4 +17741,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16509,14 +16509,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1740 = React.version;
if (
"19.0.0-www-modern-fe9828954a-20240710" !==
"19.0.0-www-modern-29552c7907-20240710" !==
isomorphicReactPackageVersion$jscomp$inline_1740
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1740,
"19.0.0-www-modern-fe9828954a-20240710"
"19.0.0-www-modern-29552c7907-20240710"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16535,7 +16535,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1742 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-fe9828954a-20240710",
version: "19.0.0-www-modern-29552c7907-20240710",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2211 = {
Expand Down Expand Up @@ -16565,7 +16565,7 @@ var internals$jscomp$inline_2211 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-modern-29552c7907-20240710"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2212 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16936,4 +16936,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-fe9828954a-20240710";
exports.version = "19.0.0-www-modern-29552c7907-20240710";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17965,14 +17965,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1856 = React.version;
if (
"19.0.0-www-classic-fe9828954a-20240710" !==
"19.0.0-www-classic-29552c7907-20240710" !==
isomorphicReactPackageVersion$jscomp$inline_1856
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1856,
"19.0.0-www-classic-fe9828954a-20240710"
"19.0.0-www-classic-29552c7907-20240710"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -18018,7 +18018,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1863 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-fe9828954a-20240710",
version: "19.0.0-www-classic-29552c7907-20240710",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -18062,7 +18062,7 @@ var devToolsConfig$jscomp$inline_1863 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-fe9828954a-20240710"
reconcilerVersion: "19.0.0-www-classic-29552c7907-20240710"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
Expand Down Expand Up @@ -18513,7 +18513,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-fe9828954a-20240710";
exports.version = "19.0.0-www-classic-29552c7907-20240710";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 5fb5ce8

Please sign in to comment.