(sourceFiber, error)
| 26615 | } |
| 26616 | |
| 26617 | function captureCommitPhaseError(sourceFiber, error) { |
| 26618 | if (sourceFiber.tag === HostRoot) { |
| 26619 | // Error was thrown at the root. There is no parent, so the root |
| 26620 | // itself should capture it. |
| 26621 | captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); |
| 26622 | return; |
| 26623 | } |
| 26624 | |
| 26625 | var fiber = sourceFiber.return; |
| 26626 | |
| 26627 | while (fiber !== null) { |
| 26628 | if (fiber.tag === HostRoot) { |
| 26629 | captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error); |
| 26630 | return; |
| 26631 | } else if (fiber.tag === ClassComponent) { |
| 26632 | var ctor = fiber.type; |
| 26633 | var instance = fiber.stateNode; |
| 26634 | |
| 26635 | if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { |
| 26636 | var errorInfo = createCapturedValue(error, sourceFiber); |
| 26637 | var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync |
| 26638 | Sync); |
| 26639 | enqueueUpdate(fiber, update); |
| 26640 | var root = markUpdateTimeFromFiberToRoot(fiber, Sync); |
| 26641 | |
| 26642 | if (root !== null) { |
| 26643 | ensureRootIsScheduled(root); |
| 26644 | schedulePendingInteractions(root, Sync); |
| 26645 | } |
| 26646 | |
| 26647 | return; |
| 26648 | } |
| 26649 | } |
| 26650 | |
| 26651 | fiber = fiber.return; |
| 26652 | } |
| 26653 | } |
| 26654 | function pingSuspendedRoot(root, thenable, suspendedTime) { |
| 26655 | var pingCache = root.pingCache; |
| 26656 |
no test coverage detected