(finishedWork, onUncaughtError)
| 11474 | } |
| 11475 | |
| 11476 | function commitErrorLogging(finishedWork, onUncaughtError) { |
| 11477 | switch (finishedWork.tag) { |
| 11478 | case ClassComponent: |
| 11479 | { |
| 11480 | var ctor = finishedWork.type; |
| 11481 | var _instance4 = finishedWork.stateNode; |
| 11482 | var updateQueue = finishedWork.updateQueue; |
| 11483 | !(updateQueue !== null && updateQueue.capturedValues !== null) ? invariant(false, 'An error logging effect should not have been scheduled if no errors were captured. This error is likely caused by a bug in React. Please file an issue.') : void 0; |
| 11484 | var capturedErrors = updateQueue.capturedValues; |
| 11485 | updateQueue.capturedValues = null; |
| 11486 | |
| 11487 | if (typeof ctor.getDerivedStateFromCatch !== 'function') { |
| 11488 | // To preserve the preexisting retry behavior of error boundaries, |
| 11489 | // we keep track of which ones already failed during this batch. |
| 11490 | // This gets reset before we yield back to the browser. |
| 11491 | // TODO: Warn in strict mode if getDerivedStateFromCatch is |
| 11492 | // not defined. |
| 11493 | markLegacyErrorBoundaryAsFailed(_instance4); |
| 11494 | } |
| 11495 | |
| 11496 | _instance4.props = finishedWork.memoizedProps; |
| 11497 | _instance4.state = finishedWork.memoizedState; |
| 11498 | for (var i = 0; i < capturedErrors.length; i++) { |
| 11499 | var errorInfo = capturedErrors[i]; |
| 11500 | var _error = errorInfo.value; |
| 11501 | var stack = errorInfo.stack; |
| 11502 | logError(finishedWork, errorInfo); |
| 11503 | _instance4.componentDidCatch(_error, { |
| 11504 | componentStack: stack !== null ? stack : '' |
| 11505 | }); |
| 11506 | } |
| 11507 | } |
| 11508 | break; |
| 11509 | case HostRoot: |
| 11510 | { |
| 11511 | var _updateQueue2 = finishedWork.updateQueue; |
| 11512 | !(_updateQueue2 !== null && _updateQueue2.capturedValues !== null) ? invariant(false, 'An error logging effect should not have been scheduled if no errors were captured. This error is likely caused by a bug in React. Please file an issue.') : void 0; |
| 11513 | var _capturedErrors = _updateQueue2.capturedValues; |
| 11514 | _updateQueue2.capturedValues = null; |
| 11515 | for (var _i = 0; _i < _capturedErrors.length; _i++) { |
| 11516 | var _errorInfo = _capturedErrors[_i]; |
| 11517 | logError(finishedWork, _errorInfo); |
| 11518 | onUncaughtError(_errorInfo.value); |
| 11519 | } |
| 11520 | break; |
| 11521 | } |
| 11522 | default: |
| 11523 | invariant(false, 'This unit of work tag cannot capture errors. This error is likely caused by a bug in React. Please file an issue.'); |
| 11524 | } |
| 11525 | } |
| 11526 | |
| 11527 | function commitAttachRef(finishedWork) { |
| 11528 | var ref = finishedWork.ref; |
no test coverage detected