(root, finishedWork, expirationTime)
| 13851 | } |
| 13852 | |
| 13853 | function completeRoot(root, finishedWork, expirationTime) { |
| 13854 | // Check if there's a batch that matches this expiration time. |
| 13855 | var firstBatch = root.firstBatch; |
| 13856 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13857 | if (completedBatches === null) { |
| 13858 | completedBatches = [firstBatch]; |
| 13859 | } else { |
| 13860 | completedBatches.push(firstBatch); |
| 13861 | } |
| 13862 | if (firstBatch._defer) { |
| 13863 | // This root is blocked from committing by a batch. Unschedule it until |
| 13864 | // we receive another update. |
| 13865 | root.finishedWork = finishedWork; |
| 13866 | root.remainingExpirationTime = NoWork; |
| 13867 | return; |
| 13868 | } |
| 13869 | } |
| 13870 | |
| 13871 | // Commit the root. |
| 13872 | root.finishedWork = null; |
| 13873 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13874 | } |
| 13875 | |
| 13876 | // When working on async work, the reconciler asks the renderer if it should |
| 13877 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected