(sourceFiber, nearestMountedAncestor, error$1)
| 27171 | } |
| 27172 | |
| 27173 | function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { |
| 27174 | { |
| 27175 | reportUncaughtErrorInDEV(error$1); |
| 27176 | setIsRunningInsertionEffect(false); |
| 27177 | } |
| 27178 | |
| 27179 | if (sourceFiber.tag === HostRoot) { |
| 27180 | // Error was thrown at the root. There is no parent, so the root |
| 27181 | // itself should capture it. |
| 27182 | captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); |
| 27183 | return; |
| 27184 | } |
| 27185 | |
| 27186 | var fiber = null; |
| 27187 | |
| 27188 | { |
| 27189 | fiber = nearestMountedAncestor; |
| 27190 | } |
| 27191 | |
| 27192 | while (fiber !== null) { |
| 27193 | if (fiber.tag === HostRoot) { |
| 27194 | captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); |
| 27195 | return; |
| 27196 | } else if (fiber.tag === ClassComponent) { |
| 27197 | var ctor = fiber.type; |
| 27198 | var instance = fiber.stateNode; |
| 27199 | |
| 27200 | if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { |
| 27201 | var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); |
| 27202 | var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); |
| 27203 | var root = enqueueUpdate(fiber, update, SyncLane); |
| 27204 | var eventTime = requestEventTime(); |
| 27205 | |
| 27206 | if (root !== null) { |
| 27207 | markRootUpdated(root, SyncLane, eventTime); |
| 27208 | ensureRootIsScheduled(root, eventTime); |
| 27209 | } |
| 27210 | |
| 27211 | return; |
| 27212 | } |
| 27213 | } |
| 27214 | |
| 27215 | fiber = fiber.return; |
| 27216 | } |
| 27217 | |
| 27218 | { |
| 27219 | // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning |
| 27220 | // will fire for errors that are thrown by destroy functions inside deleted |
| 27221 | // trees. What it should instead do is propagate the error to the parent of |
| 27222 | // the deleted tree. In the meantime, do not add this warning to the |
| 27223 | // allowlist; this is only for our internal use. |
| 27224 | 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); |
| 27225 | } |
| 27226 | } |
| 27227 | function pingSuspendedRoot(root, wakeable, pingedLanes) { |
| 27228 | var pingCache = root.pingCache; |
| 27229 |
no test coverage detected
searching dependent graphs…