(root, expirationTime, isAsync)
| 13298 | } |
| 13299 | |
| 13300 | function renderRoot(root, expirationTime, isAsync) { |
| 13301 | !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; |
| 13302 | isWorking = true; |
| 13303 | |
| 13304 | // Check if we're starting from a fresh stack, or if we're resuming from |
| 13305 | // previously yielded work. |
| 13306 | if (expirationTime !== nextRenderExpirationTime || root !== nextRoot || nextUnitOfWork === null) { |
| 13307 | // Reset the stack and start working from the root. |
| 13308 | resetStack(); |
| 13309 | nextRoot = root; |
| 13310 | nextRenderExpirationTime = expirationTime; |
| 13311 | nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime); |
| 13312 | root.pendingCommitExpirationTime = NoWork; |
| 13313 | } |
| 13314 | |
| 13315 | var didFatal = false; |
| 13316 | |
| 13317 | startWorkLoopTimer(nextUnitOfWork); |
| 13318 | |
| 13319 | do { |
| 13320 | try { |
| 13321 | workLoop(isAsync); |
| 13322 | } catch (thrownValue) { |
| 13323 | if (nextUnitOfWork === null) { |
| 13324 | // This is a fatal error. |
| 13325 | didFatal = true; |
| 13326 | onUncaughtError(thrownValue); |
| 13327 | break; |
| 13328 | } |
| 13329 | |
| 13330 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) { |
| 13331 | var failedUnitOfWork = nextUnitOfWork; |
| 13332 | replayUnitOfWork(failedUnitOfWork, isAsync); |
| 13333 | } |
| 13334 | |
| 13335 | var sourceFiber = nextUnitOfWork; |
| 13336 | var returnFiber = sourceFiber['return']; |
| 13337 | if (returnFiber === null) { |
| 13338 | // This is a fatal error. |
| 13339 | didFatal = true; |
| 13340 | onUncaughtError(thrownValue); |
| 13341 | break; |
| 13342 | } |
| 13343 | throwException(returnFiber, sourceFiber, thrownValue); |
| 13344 | nextUnitOfWork = completeUnitOfWork(sourceFiber); |
| 13345 | } |
| 13346 | break; |
| 13347 | } while (true); |
| 13348 | |
| 13349 | // We're done performing work. Time to clean up. |
| 13350 | stopWorkLoopTimer(interruptedBy); |
| 13351 | interruptedBy = null; |
| 13352 | isWorking = false; |
| 13353 | |
| 13354 | // Yield back to main thread. |
| 13355 | if (didFatal) { |
| 13356 | // There was a fatal error. |
| 13357 | { |
no test coverage detected