(boundary, errorInfo)
| 11050 | |
| 11051 | |
| 11052 | function logError(boundary, errorInfo) { |
| 11053 | var source = errorInfo.source; |
| 11054 | var stack = errorInfo.stack; |
| 11055 | if (stack === null) { |
| 11056 | stack = getStackAddendumByWorkInProgressFiber(source); |
| 11057 | } |
| 11058 | |
| 11059 | var capturedError = { |
| 11060 | componentName: source !== null ? getComponentName(source) : null, |
| 11061 | error: errorInfo.value, |
| 11062 | errorBoundary: boundary, |
| 11063 | componentStack: stack !== null ? stack : '', |
| 11064 | errorBoundaryName: null, |
| 11065 | errorBoundaryFound: false, |
| 11066 | willRetry: false |
| 11067 | }; |
| 11068 | |
| 11069 | if (boundary !== null) { |
| 11070 | capturedError.errorBoundaryName = getComponentName(boundary); |
| 11071 | capturedError.errorBoundaryFound = capturedError.willRetry = boundary.tag === ClassComponent; |
| 11072 | } else { |
| 11073 | capturedError.errorBoundaryName = null; |
| 11074 | capturedError.errorBoundaryFound = capturedError.willRetry = false; |
| 11075 | } |
| 11076 | |
| 11077 | try { |
| 11078 | logCapturedError(capturedError); |
| 11079 | } catch (e) { |
| 11080 | // Prevent cycle if logCapturedError() throws. |
| 11081 | // A cycle may still occur if logCapturedError renders a component that throws. |
| 11082 | var suppressLogging = e && e.suppressReactErrorLogging; |
| 11083 | if (!suppressLogging) { |
| 11084 | console.error(e); |
| 11085 | } |
| 11086 | } |
| 11087 | } |
| 11088 | |
| 11089 | var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) { |
| 11090 | var getPublicInstance = config.getPublicInstance, |
no test coverage detected