(root, finishedWork, expirationTime)
| 13730 | } |
| 13731 | |
| 13732 | function completeRoot(root, finishedWork, expirationTime) { |
| 13733 | // Check if there's a batch that matches this expiration time. |
| 13734 | var firstBatch = root.firstBatch; |
| 13735 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13736 | if (completedBatches === null) { |
| 13737 | completedBatches = [firstBatch]; |
| 13738 | } else { |
| 13739 | completedBatches.push(firstBatch); |
| 13740 | } |
| 13741 | if (firstBatch._defer) { |
| 13742 | // This root is blocked from committing by a batch. Unschedule it until |
| 13743 | // we receive another update. |
| 13744 | root.finishedWork = finishedWork; |
| 13745 | root.remainingExpirationTime = NoWork; |
| 13746 | return; |
| 13747 | } |
| 13748 | } |
| 13749 | |
| 13750 | // Commit the root. |
| 13751 | root.finishedWork = null; |
| 13752 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13753 | } |
| 13754 | |
| 13755 | // When working on async work, the reconciler asks the renderer if it should |
| 13756 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected