Partial React Sync from 241c4467..edab5c074

Summary:
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//

Changelog:
[General][Changed] Partial React Sync from 241c4467..edab5c074

Reviewed By: mdvacca, gaearon

Differential Revision: D19961765

fbshipit-source-id: d4a84a4076da332db76d66ddd7250eaea375f8ff
This commit is contained in:
Eli White 2020-02-18 19:01:13 -08:00 коммит произвёл Facebook Github Bot
Родитель aa0a50c518
Коммит 010c9241cb
12 изменённых файлов: 40 добавлений и 12 удалений

Просмотреть файл

@ -20488,7 +20488,14 @@ function handleError(root, thrownValue) {
// supposed to capture all errors that weren't caught by an error // supposed to capture all errors that weren't caught by an error
// boundary. // boundary.
workInProgressRootExitStatus = RootFatalErrored; workInProgressRootExitStatus = RootFatalErrored;
workInProgressRootFatalError = thrownValue; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
// sibling, or the parent if there are no siblings. But since the root
// has no siblings nor a parent, we set it to null. Usually this is
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
// interntionally not calling those, we need set it here.
// TODO: Consider calling `unwindWork` to pop the contexts.
workInProgress = null;
return null; return null;
} }

Просмотреть файл

@ -20486,7 +20486,14 @@ function handleError(root, thrownValue) {
// supposed to capture all errors that weren't caught by an error // supposed to capture all errors that weren't caught by an error
// boundary. // boundary.
workInProgressRootExitStatus = RootFatalErrored; workInProgressRootExitStatus = RootFatalErrored;
workInProgressRootFatalError = thrownValue; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
// sibling, or the parent if there are no siblings. But since the root
// has no siblings nor a parent, we set it to null. Usually this is
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
// interntionally not calling those, we need set it here.
// TODO: Consider calling `unwindWork` to pop the contexts.
workInProgress = null;
return null; return null;
} }

Просмотреть файл

@ -6015,7 +6015,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
a: { a: {
var root = root$jscomp$0, var root = root$jscomp$0,

Просмотреть файл

@ -6006,7 +6006,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
a: { a: {
var root = root$jscomp$0, var root = root$jscomp$0,

Просмотреть файл

@ -6090,7 +6090,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
workInProgress.mode & 8 && workInProgress.mode & 8 &&
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0); stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);

Просмотреть файл

@ -6081,7 +6081,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
workInProgress.mode & 8 && workInProgress.mode & 8 &&
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0); stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);

Просмотреть файл

@ -20791,7 +20791,14 @@ function handleError(root, thrownValue) {
// supposed to capture all errors that weren't caught by an error // supposed to capture all errors that weren't caught by an error
// boundary. // boundary.
workInProgressRootExitStatus = RootFatalErrored; workInProgressRootExitStatus = RootFatalErrored;
workInProgressRootFatalError = thrownValue; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
// sibling, or the parent if there are no siblings. But since the root
// has no siblings nor a parent, we set it to null. Usually this is
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
// interntionally not calling those, we need set it here.
// TODO: Consider calling `unwindWork` to pop the contexts.
workInProgress = null;
return null; return null;
} }

Просмотреть файл

@ -20789,7 +20789,14 @@ function handleError(root, thrownValue) {
// supposed to capture all errors that weren't caught by an error // supposed to capture all errors that weren't caught by an error
// boundary. // boundary.
workInProgressRootExitStatus = RootFatalErrored; workInProgressRootExitStatus = RootFatalErrored;
workInProgressRootFatalError = thrownValue; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
// sibling, or the parent if there are no siblings. But since the root
// has no siblings nor a parent, we set it to null. Usually this is
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
// interntionally not calling those, we need set it here.
// TODO: Consider calling `unwindWork` to pop the contexts.
workInProgress = null;
return null; return null;
} }

Просмотреть файл

@ -6245,7 +6245,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
a: { a: {
var root = root$jscomp$0, var root = root$jscomp$0,

Просмотреть файл

@ -6235,7 +6235,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
a: { a: {
var root = root$jscomp$0, var root = root$jscomp$0,

Просмотреть файл

@ -6321,7 +6321,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
workInProgress.mode & 8 && workInProgress.mode & 8 &&
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0); stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);

Просмотреть файл

@ -6311,7 +6311,7 @@ function handleError(root$jscomp$0, thrownValue) {
return ( return (
(workInProgressRootExitStatus = RootFatalErrored), (workInProgressRootExitStatus = RootFatalErrored),
(workInProgressRootFatalError = thrownValue), (workInProgressRootFatalError = thrownValue),
null (workInProgress = null)
); );
workInProgress.mode & 8 && workInProgress.mode & 8 &&
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0); stopProfilerTimerIfRunningAndRecordDelta(workInProgress, !0);