Skip to content

Commit 71dba54

Browse files
elicwhiteosdnk
authored andcommitted
Partial React Sync from 241c4467..edab5c074
Summary: - **[edab5c074](facebook/react@edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (facebook#18029) //<Andrew Clark>// Changelog: [General][Changed] Partial React Sync from 241c4467..edab5c074 Reviewed By: mdvacca, gaearon Differential Revision: D19961765 fbshipit-source-id: d4a84a4076da332db76d66ddd7250eaea375f8ff
1 parent c392689 commit 71dba54

12 files changed

+40
-12
lines changed

Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20488,7 +20488,14 @@ function handleError(root, thrownValue) {
2048820488
// supposed to capture all errors that weren't caught by an error
2048920489
// boundary.
2049020490
workInProgressRootExitStatus = RootFatalErrored;
20491-
workInProgressRootFatalError = thrownValue;
20491+
workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
20492+
// sibling, or the parent if there are no siblings. But since the root
20493+
// has no siblings nor a parent, we set it to null. Usually this is
20494+
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
20495+
// interntionally not calling those, we need set it here.
20496+
// TODO: Consider calling `unwindWork` to pop the contexts.
20497+
20498+
workInProgress = null;
2049220499
return null;
2049320500
}
2049420501

Libraries/Renderer/implementations/ReactFabric-dev.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20486,7 +20486,14 @@ function handleError(root, thrownValue) {
2048620486
// supposed to capture all errors that weren't caught by an error
2048720487
// boundary.
2048820488
workInProgressRootExitStatus = RootFatalErrored;
20489-
workInProgressRootFatalError = thrownValue;
20489+
workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
20490+
// sibling, or the parent if there are no siblings. But since the root
20491+
// has no siblings nor a parent, we set it to null. Usually this is
20492+
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
20493+
// interntionally not calling those, we need set it here.
20494+
// TODO: Consider calling `unwindWork` to pop the contexts.
20495+
20496+
workInProgress = null;
2049020497
return null;
2049120498
}
2049220499

Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,7 @@ function handleError(root$jscomp$0, thrownValue) {
60156015
return (
60166016
(workInProgressRootExitStatus = RootFatalErrored),
60176017
(workInProgressRootFatalError = thrownValue),
6018-
null
6018+
(workInProgress = null)
60196019
);
60206020
a: {
60216021
var root = root$jscomp$0,

Libraries/Renderer/implementations/ReactFabric-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6006,7 +6006,7 @@ function handleError(root$jscomp$0, thrownValue) {
60066006
return (
60076007
(workInProgressRootExitStatus = RootFatalErrored),
60086008
(workInProgressRootFatalError = thrownValue),
6009-
null
6009+
(workInProgress = null)
60106010
);
60116011
a: {
60126012
var root = root$jscomp$0,

Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6090,7 +6090,7 @@ function handleError(root$jscomp$0, thrownValue) {
60906090
return (
60916091
(workInProgressRootExitStatus = RootFatalErrored),
60926092
(workInProgressRootFatalError = thrownValue),
6093-
null
6093+
(workInProgress = null)
60946094
);
60956095
workInProgress.mode & 8 &&
60966096
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);

Libraries/Renderer/implementations/ReactFabric-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6081,7 +6081,7 @@ function handleError(root$jscomp$0, thrownValue) {
60816081
return (
60826082
(workInProgressRootExitStatus = RootFatalErrored),
60836083
(workInProgressRootFatalError = thrownValue),
6084-
null
6084+
(workInProgress = null)
60856085
);
60866086
workInProgress.mode & 8 &&
60876087
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);

Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20791,7 +20791,14 @@ function handleError(root, thrownValue) {
2079120791
// supposed to capture all errors that weren't caught by an error
2079220792
// boundary.
2079320793
workInProgressRootExitStatus = RootFatalErrored;
20794-
workInProgressRootFatalError = thrownValue;
20794+
workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
20795+
// sibling, or the parent if there are no siblings. But since the root
20796+
// has no siblings nor a parent, we set it to null. Usually this is
20797+
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
20798+
// interntionally not calling those, we need set it here.
20799+
// TODO: Consider calling `unwindWork` to pop the contexts.
20800+
20801+
workInProgress = null;
2079520802
return null;
2079620803
}
2079720804

Libraries/Renderer/implementations/ReactNativeRenderer-dev.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20789,7 +20789,14 @@ function handleError(root, thrownValue) {
2078920789
// supposed to capture all errors that weren't caught by an error
2079020790
// boundary.
2079120791
workInProgressRootExitStatus = RootFatalErrored;
20792-
workInProgressRootFatalError = thrownValue;
20792+
workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
20793+
// sibling, or the parent if there are no siblings. But since the root
20794+
// has no siblings nor a parent, we set it to null. Usually this is
20795+
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
20796+
// interntionally not calling those, we need set it here.
20797+
// TODO: Consider calling `unwindWork` to pop the contexts.
20798+
20799+
workInProgress = null;
2079320800
return null;
2079420801
}
2079520802

Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6245,7 +6245,7 @@ function handleError(root$jscomp$0, thrownValue) {
62456245
return (
62466246
(workInProgressRootExitStatus = RootFatalErrored),
62476247
(workInProgressRootFatalError = thrownValue),
6248-
null
6248+
(workInProgress = null)
62496249
);
62506250
a: {
62516251
var root = root$jscomp$0,

Libraries/Renderer/implementations/ReactNativeRenderer-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6235,7 +6235,7 @@ function handleError(root$jscomp$0, thrownValue) {
62356235
return (
62366236
(workInProgressRootExitStatus = RootFatalErrored),
62376237
(workInProgressRootFatalError = thrownValue),
6238-
null
6238+
(workInProgress = null)
62396239
);
62406240
a: {
62416241
var root = root$jscomp$0,

0 commit comments

Comments
 (0)