(hasTimeRemaining, initialTime)
| 2595 | } |
| 2596 | |
| 2597 | function flushWork(hasTimeRemaining, initialTime) { |
| 2598 | |
| 2599 | |
| 2600 | isHostCallbackScheduled = false; |
| 2601 | |
| 2602 | if (isHostTimeoutScheduled) { |
| 2603 | // We scheduled a timeout but it's no longer needed. Cancel it. |
| 2604 | isHostTimeoutScheduled = false; |
| 2605 | cancelHostTimeout(); |
| 2606 | } |
| 2607 | |
| 2608 | isPerformingWork = true; |
| 2609 | var previousPriorityLevel = currentPriorityLevel; |
| 2610 | |
| 2611 | try { |
| 2612 | if (enableProfiling) { |
| 2613 | try { |
| 2614 | return workLoop(hasTimeRemaining, initialTime); |
| 2615 | } catch (error) { |
| 2616 | if (currentTask !== null) { |
| 2617 | var currentTime = getCurrentTime(); |
| 2618 | markTaskErrored(currentTask, currentTime); |
| 2619 | currentTask.isQueued = false; |
| 2620 | } |
| 2621 | |
| 2622 | throw error; |
| 2623 | } |
| 2624 | } else { |
| 2625 | // No catch in prod code path. |
| 2626 | return workLoop(hasTimeRemaining, initialTime); |
| 2627 | } |
| 2628 | } finally { |
| 2629 | currentTask = null; |
| 2630 | currentPriorityLevel = previousPriorityLevel; |
| 2631 | isPerformingWork = false; |
| 2632 | } |
| 2633 | } |
| 2634 | |
| 2635 | function workLoop(hasTimeRemaining, initialTime) { |
| 2636 | var currentTime = initialTime; |
nothing calls this directly
no test coverage detected
searching dependent graphs…