MCPcopy Create free account
hub / github.com/caseywebdev/react-list / throwAndUnwindWorkLoop

Function throwAndUnwindWorkLoop

docs/index.js:14410–14466  ·  view source on GitHub ↗
(
  root,
  unitOfWork,
  thrownValue,
  suspendedReason
)

Source from the content-addressed store, hash-verified

14408 null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next);
14409}
14410function throwAndUnwindWorkLoop(
14411 root,
14412 unitOfWork,
14413 thrownValue,
14414 suspendedReason
14415) {
14416 lastContextDependency = currentlyRenderingFiber = null;
14417 resetHooksOnUnwind(unitOfWork);
14418 thenableState$1 = null;
14419 thenableIndexCounter$1 = 0;
14420 var returnFiber = unitOfWork.return;
14421 try {
14422 if (
14423 throwException(
14424 root,
14425 returnFiber,
14426 unitOfWork,
14427 thrownValue,
14428 workInProgressRootRenderLanes
14429 )
14430 ) {
14431 workInProgressRootExitStatus = 1;
14432 logUncaughtError(
14433 root,
14434 createCapturedValueAtFiber(thrownValue, root.current)
14435 );
14436 workInProgress = null;
14437 return;
14438 }
14439 } catch (error) {
14440 if (null !== returnFiber) throw ((workInProgress = returnFiber), error);
14441 workInProgressRootExitStatus = 1;
14442 logUncaughtError(
14443 root,
14444 createCapturedValueAtFiber(thrownValue, root.current)
14445 );
14446 workInProgress = null;
14447 return;
14448 }
14449 if (unitOfWork.flags & 32768) {
14450 if (isHydrating || 1 === suspendedReason) root = !0;
14451 else if (
14452 workInProgressRootIsPrerendering ||
14453 0 !== (workInProgressRootRenderLanes & 536870912)
14454 )
14455 root = !1;
14456 else if (
14457 ((workInProgressRootDidSkipSuspendedSiblings = root = !0),
14458 2 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
14459 )
14460 (suspendedReason = suspenseHandlerStackCursor.current),
14461 null !== suspendedReason &&
14462 13 === suspendedReason.tag &&
14463 (suspendedReason.flags |= 16384);
14464 unwindUnitOfWork(unitOfWork, root);
14465 } else completeUnitOfWork(unitOfWork);
14466}
14467function completeUnitOfWork(unitOfWork) {

Callers 2

renderRootSyncFunction · 0.85
renderRootConcurrentFunction · 0.85

Calls 7

resetHooksOnUnwindFunction · 0.85
throwExceptionFunction · 0.85
logUncaughtErrorFunction · 0.85
unwindUnitOfWorkFunction · 0.85
completeUnitOfWorkFunction · 0.85
resetContextDependenciesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…