(returnFiber, sourceFiber, rawValue)
| 11250 | |
| 11251 | |
| 11252 | function throwException(returnFiber, sourceFiber, rawValue) { |
| 11253 | // The source fiber did not complete. |
| 11254 | sourceFiber.effectTag |= Incomplete; |
| 11255 | // Its effect list is no longer valid. |
| 11256 | sourceFiber.firstEffect = sourceFiber.lastEffect = null; |
| 11257 | |
| 11258 | var value = createCapturedValue(rawValue, sourceFiber); |
| 11259 | |
| 11260 | var workInProgress = returnFiber; |
| 11261 | do { |
| 11262 | switch (workInProgress.tag) { |
| 11263 | case HostRoot: |
| 11264 | { |
| 11265 | // Uncaught error |
| 11266 | var errorInfo = value; |
| 11267 | ensureUpdateQueues(workInProgress); |
| 11268 | var updateQueue = workInProgress.updateQueue; |
| 11269 | updateQueue.capturedValues = [errorInfo]; |
| 11270 | workInProgress.effectTag |= ShouldCapture; |
| 11271 | return; |
| 11272 | } |
| 11273 | case ClassComponent: |
| 11274 | // Capture and retry |
| 11275 | var ctor = workInProgress.type; |
| 11276 | var _instance = workInProgress.stateNode; |
| 11277 | if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) { |
| 11278 | ensureUpdateQueues(workInProgress); |
| 11279 | var _updateQueue = workInProgress.updateQueue; |
| 11280 | var capturedValues = _updateQueue.capturedValues; |
| 11281 | if (capturedValues === null) { |
| 11282 | _updateQueue.capturedValues = [value]; |
| 11283 | } else { |
| 11284 | capturedValues.push(value); |
| 11285 | } |
| 11286 | workInProgress.effectTag |= ShouldCapture; |
| 11287 | return; |
| 11288 | } |
| 11289 | break; |
| 11290 | default: |
| 11291 | break; |
| 11292 | } |
| 11293 | workInProgress = workInProgress['return']; |
| 11294 | } while (workInProgress !== null); |
| 11295 | } |
| 11296 | |
| 11297 | function unwindWork(workInProgress) { |
| 11298 | switch (workInProgress.tag) { |
no test coverage detected