(sourceFiber, nearestMountedAncestor, error$1)
| 27132 | } |
| 27133 | |
| 27134 | function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { |
| 27135 | { |
| 27136 | reportUncaughtErrorInDEV(error$1); |
| 27137 | setIsRunningInsertionEffect(false); |
| 27138 | } |
| 27139 | |
| 27140 | if (sourceFiber.tag === HostRoot) { |
| 27141 | // Error was thrown at the root. There is no parent, so the root |
| 27142 | // itself should capture it. |
| 27143 | captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); |
| 27144 | return; |
| 27145 | } |
| 27146 | |
| 27147 | var fiber = null; |
| 27148 | |
| 27149 | { |
| 27150 | fiber = nearestMountedAncestor; |
| 27151 | } |
| 27152 | |
| 27153 | while (fiber !== null) { |
| 27154 | if (fiber.tag === HostRoot) { |
| 27155 | captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); |
| 27156 | return; |
| 27157 | } else if (fiber.tag === ClassComponent) { |
| 27158 | var ctor = fiber.type; |
| 27159 | var instance = fiber.stateNode; |
| 27160 | |
| 27161 | if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { |
| 27162 | var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); |
| 27163 | var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); |
| 27164 | var root = enqueueUpdate(fiber, update, SyncLane); |
| 27165 | var eventTime = requestEventTime(); |
| 27166 | |
| 27167 | if (root !== null) { |
| 27168 | markRootUpdated(root, SyncLane, eventTime); |
| 27169 | ensureRootIsScheduled(root, eventTime); |
| 27170 | } |
| 27171 | |
| 27172 | return; |
| 27173 | } |
| 27174 | } |
| 27175 | |
| 27176 | fiber = fiber.return; |
| 27177 | } |
| 27178 | |
| 27179 | { |
| 27180 | // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning |
| 27181 | // will fire for errors that are thrown by destroy functions inside deleted |
| 27182 | // trees. What it should instead do is propagate the error to the parent of |
| 27183 | // the deleted tree. In the meantime, do not add this warning to the |
| 27184 | // allowlist; this is only for our internal use. |
| 27185 | error('Internal React error: Attempted to capture a commit phase error ' + 'inside a detached tree. This indicates a bug in React. Likely ' + 'causes include deleting the same fiber more than once, committing an ' + 'already-finished tree, or an inconsistent return pointer.\n\n' + 'Error message:\n\n%s', error$1); |
| 27186 | } |
| 27187 | } |
| 27188 | function pingSuspendedRoot(root, wakeable, pingedLanes) { |
| 27189 | var pingCache = root.pingCache; |
| 27190 |
no test coverage detected
searching dependent graphs…