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