MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / handleCommitPhaseErrors

Function handleCommitPhaseErrors

bundle.js:7800–7814  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7798var current=workInProgress.alternate;// See if beginning this work spawns more work.
7799{startWorkTimer(workInProgress);}var next=beginFailedWork(current,workInProgress,nextPriorityLevel);if(true&&ReactFiberInstrumentation$1.debugTool){ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress);}if(next===null){// If this doesn't spawn new work, complete the current work.
7800next=completeUnitOfWork(workInProgress);}ReactCurrentOwner$1.current=null;{ReactDebugCurrentFiber$3.resetCurrentFiber();}return next;}function performDeferredWork(deadline){performWork(OffscreenPriority,deadline);}function handleCommitPhaseErrors(){// This is a special work loop for handling commit phase errors. It's
7801// similar to the syncrhonous work loop, but does an additional check on
7802// each fiber to see if it's an error boundary with an unhandled error. If
7803// so, it uses a forked version of performUnitOfWork that unmounts the
7804// failed subtree.
7805//
7806// The loop stops once the children have unmounted and error lifecycles are
7807// called. Then we return to the regular flow.
7808if(capturedErrors!==null&&capturedErrors.size>0&&nextPriorityLevel===TaskPriority$1){while(nextUnitOfWork!==null){if(hasCapturedError(nextUnitOfWork)){// Use a forked version of performUnitOfWork
7809nextUnitOfWork=performFailedUnitOfWork(nextUnitOfWork);}else{nextUnitOfWork=performUnitOfWork(nextUnitOfWork);}if(nextUnitOfWork===null){!(pendingCommit!==null)?invariant(false,'Should have a pending commit. This error is likely caused by a bug in React. Please file an issue.'):void 0;// We just completed a root. Commit it now.
7810priorityContext=TaskPriority$1;commitAllWork(pendingCommit);priorityContext=nextPriorityLevel;if(capturedErrors===null||capturedErrors.size===0||nextPriorityLevel!==TaskPriority$1){// There are no more unhandled errors. We can exit this special
7811// work loop. If there's still additional work, we'll perform it
7812// using one of the normal work loops.
7813break;}// The commit phase produced additional errors. Continue working.
7814}}}}function workLoop(minPriorityLevel,deadline){if(pendingCommit!==null){priorityContext=TaskPriority$1;commitAllWork(pendingCommit);handleCommitPhaseErrors();}else if(nextUnitOfWork===null){resetNextUnitOfWork();}if(nextPriorityLevel===NoWork$2||nextPriorityLevel>minPriorityLevel){return;}// During the render phase, updates should have the same priority at which
7815// we're rendering.
7816priorityContext=nextPriorityLevel;loop:do{if(nextPriorityLevel<=TaskPriority$1){// Flush all synchronous and task work.
7817while(nextUnitOfWork!==null){nextUnitOfWork=performUnitOfWork(nextUnitOfWork);if(nextUnitOfWork===null){!(pendingCommit!==null)?invariant(false,'Should have a pending commit. This error is likely caused by a bug in React. Please file an issue.'):void 0;// We just completed a root. Commit it now.

Callers 1

workLoopFunction · 0.85

Calls 5

hasCapturedErrorFunction · 0.85
performFailedUnitOfWorkFunction · 0.85
performUnitOfWorkFunction · 0.85
commitAllWorkFunction · 0.85
invariantFunction · 0.70

Tested by

no test coverage detected