(root, finishedWork, expirationTime)
| 13892 | } |
| 13893 | |
| 13894 | function completeRoot(root, finishedWork, expirationTime) { |
| 13895 | // Check if there's a batch that matches this expiration time. |
| 13896 | var firstBatch = root.firstBatch; |
| 13897 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13898 | if (completedBatches === null) { |
| 13899 | completedBatches = [firstBatch]; |
| 13900 | } else { |
| 13901 | completedBatches.push(firstBatch); |
| 13902 | } |
| 13903 | if (firstBatch._defer) { |
| 13904 | // This root is blocked from committing by a batch. Unschedule it until |
| 13905 | // we receive another update. |
| 13906 | root.finishedWork = finishedWork; |
| 13907 | root.remainingExpirationTime = NoWork; |
| 13908 | return; |
| 13909 | } |
| 13910 | } |
| 13911 | |
| 13912 | // Commit the root. |
| 13913 | root.finishedWork = null; |
| 13914 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13915 | } |
| 13916 | |
| 13917 | // When working on async work, the reconciler asks the renderer if it should |
| 13918 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected