(root, expirationTime, isAsync)
| 13257 | } |
| 13258 | |
| 13259 | function renderRoot(root, expirationTime, isAsync) { |
| 13260 | !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; |
| 13261 | isWorking = true; |
| 13262 | |
| 13263 | // Check if we're starting from a fresh stack, or if we're resuming from |
| 13264 | // previously yielded work. |
| 13265 | if (expirationTime !== nextRenderExpirationTime || root !== nextRoot || nextUnitOfWork === null) { |
| 13266 | // Reset the stack and start working from the root. |
| 13267 | resetStack(); |
| 13268 | nextRoot = root; |
| 13269 | nextRenderExpirationTime = expirationTime; |
| 13270 | nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime); |
| 13271 | root.pendingCommitExpirationTime = NoWork; |
| 13272 | } |
| 13273 | |
| 13274 | var didFatal = false; |
| 13275 | |
| 13276 | startWorkLoopTimer(nextUnitOfWork); |
| 13277 | |
| 13278 | do { |
| 13279 | try { |
| 13280 | workLoop(isAsync); |
| 13281 | } catch (thrownValue) { |
| 13282 | if (nextUnitOfWork === null) { |
| 13283 | // This is a fatal error. |
| 13284 | didFatal = true; |
| 13285 | onUncaughtError(thrownValue); |
| 13286 | break; |
| 13287 | } |
| 13288 | |
| 13289 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) { |
| 13290 | var failedUnitOfWork = nextUnitOfWork; |
| 13291 | replayUnitOfWork(failedUnitOfWork, isAsync); |
| 13292 | } |
| 13293 | |
| 13294 | var sourceFiber = nextUnitOfWork; |
| 13295 | var returnFiber = sourceFiber['return']; |
| 13296 | if (returnFiber === null) { |
| 13297 | // This is a fatal error. |
| 13298 | didFatal = true; |
| 13299 | onUncaughtError(thrownValue); |
| 13300 | break; |
| 13301 | } |
| 13302 | throwException(returnFiber, sourceFiber, thrownValue); |
| 13303 | nextUnitOfWork = completeUnitOfWork(sourceFiber); |
| 13304 | } |
| 13305 | break; |
| 13306 | } while (true); |
| 13307 | |
| 13308 | // We're done performing work. Time to clean up. |
| 13309 | stopWorkLoopTimer(interruptedBy); |
| 13310 | interruptedBy = null; |
| 13311 | isWorking = false; |
| 13312 | |
| 13313 | // Yield back to main thread. |
| 13314 | if (didFatal) { |
| 13315 | // There was a fatal error. |
| 13316 | { |
no test coverage detected