(root, finishedWork, expirationTime)
| 13218 | } |
| 13219 | |
| 13220 | function completeRoot(root, finishedWork, expirationTime) { |
| 13221 | // Check if there's a batch that matches this expiration time. |
| 13222 | var firstBatch = root.firstBatch; |
| 13223 | if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { |
| 13224 | if (completedBatches === null) { |
| 13225 | completedBatches = [firstBatch]; |
| 13226 | } else { |
| 13227 | completedBatches.push(firstBatch); |
| 13228 | } |
| 13229 | if (firstBatch._defer) { |
| 13230 | // This root is blocked from committing by a batch. Unschedule it until |
| 13231 | // we receive another update. |
| 13232 | root.finishedWork = finishedWork; |
| 13233 | root.remainingExpirationTime = NoWork; |
| 13234 | return; |
| 13235 | } |
| 13236 | } |
| 13237 | |
| 13238 | // Commit the root. |
| 13239 | root.finishedWork = null; |
| 13240 | root.remainingExpirationTime = commitRoot(finishedWork); |
| 13241 | } |
| 13242 | |
| 13243 | // When working on async work, the reconciler asks the renderer if it should |
| 13244 | // yield execution. For DOM, we implement this with requestIdleCallback. |
no test coverage detected