(boundary, errorInfo)
| 10538 | |
| 10539 | |
| 10540 | function logError(boundary, errorInfo) { |
| 10541 | var source = errorInfo.source; |
| 10542 | var stack = errorInfo.stack; |
| 10543 | if (stack === null) { |
| 10544 | stack = getStackAddendumByWorkInProgressFiber(source); |
| 10545 | } |
| 10546 | |
| 10547 | var capturedError = { |
| 10548 | componentName: source !== null ? getComponentName(source) : null, |
| 10549 | error: errorInfo.value, |
| 10550 | errorBoundary: boundary, |
| 10551 | componentStack: stack !== null ? stack : '', |
| 10552 | errorBoundaryName: null, |
| 10553 | errorBoundaryFound: false, |
| 10554 | willRetry: false |
| 10555 | }; |
| 10556 | |
| 10557 | if (boundary !== null) { |
| 10558 | capturedError.errorBoundaryName = getComponentName(boundary); |
| 10559 | capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent; |
| 10560 | } else { |
| 10561 | capturedError.errorBoundaryName = null; |
| 10562 | capturedError.errorBoundaryFound = capturedError.willRetry = false; |
| 10563 | } |
| 10564 | |
| 10565 | try { |
| 10566 | logCapturedError(capturedError); |
| 10567 | } catch (e) { |
| 10568 | // Prevent cycle if logCapturedError() throws. |
| 10569 | // A cycle may still occur if logCapturedError renders a component that throws. |
| 10570 | var suppressLogging = e && e.suppressReactErrorLogging; |
| 10571 | if (!suppressLogging) { |
| 10572 | console.error(e); |
| 10573 | } |
| 10574 | } |
| 10575 | } |
| 10576 | |
| 10577 | var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) { |
| 10578 | var getPublicInstance = config.getPublicInstance, |
no test coverage detected