(root, finishedWork, expirationTime)
| 13181 | } |
| 13182 | |
| 13183 | function completeRoot(root, finishedWork, expirationTime) { |
| 13184 | // Check if there's a batch that matches this expiration time. |
| 13185 | var firstBatch = root.firstBatch; |
| 13186 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13187 | if (completedBatches === null) { |
| 13188 | completedBatches = [firstBatch]; |
| 13189 | } else { |
| 13190 | completedBatches.push(firstBatch); |
| 13191 | } |
| 13192 | if (firstBatch._defer) { |
| 13193 | // This root is blocked from committing by a batch. Unschedule it until |
| 13194 | // we receive another update. |
| 13195 | root.finishedWork = finishedWork; |
| 13196 | root.remainingExpirationTime = NoWork; |
| 13197 | return; |
| 13198 | } |
| 13199 | } |
| 13200 | |
| 13201 | // Commit the root. |
| 13202 | root.finishedWork = null; |
| 13203 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13204 | } |
| 13205 | |
| 13206 | // When working on async work, the reconciler asks the renderer if it should |
| 13207 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected