()
| 26517 | } |
| 26518 | |
| 26519 | function flushPassiveEffectsImpl() { |
| 26520 | if (rootWithPendingPassiveEffects === null) { |
| 26521 | return false; |
| 26522 | } |
| 26523 | |
| 26524 | var root = rootWithPendingPassiveEffects; |
| 26525 | var expirationTime = pendingPassiveEffectsExpirationTime; |
| 26526 | rootWithPendingPassiveEffects = null; |
| 26527 | pendingPassiveEffectsExpirationTime = NoWork; |
| 26528 | |
| 26529 | if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { |
| 26530 | { |
| 26531 | throw Error( "Cannot flush passive effects while already rendering." ); |
| 26532 | } |
| 26533 | } |
| 26534 | |
| 26535 | var prevExecutionContext = executionContext; |
| 26536 | executionContext |= CommitContext; |
| 26537 | var prevInteractions = pushInteractions(root); |
| 26538 | |
| 26539 | { |
| 26540 | // Note: This currently assumes there are no passive effects on the root fiber |
| 26541 | // because the root is not part of its own effect list. |
| 26542 | // This could change in the future. |
| 26543 | var _effect2 = root.current.firstEffect; |
| 26544 | |
| 26545 | while (_effect2 !== null) { |
| 26546 | { |
| 26547 | setCurrentFiber(_effect2); |
| 26548 | invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2); |
| 26549 | |
| 26550 | if (hasCaughtError()) { |
| 26551 | if (!(_effect2 !== null)) { |
| 26552 | { |
| 26553 | throw Error( "Should be working on an effect." ); |
| 26554 | } |
| 26555 | } |
| 26556 | |
| 26557 | var _error5 = clearCaughtError(); |
| 26558 | |
| 26559 | captureCommitPhaseError(_effect2, _error5); |
| 26560 | } |
| 26561 | |
| 26562 | resetCurrentFiber(); |
| 26563 | } |
| 26564 | |
| 26565 | var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC |
| 26566 | |
| 26567 | _effect2.nextEffect = null; |
| 26568 | _effect2 = nextNextEffect; |
| 26569 | } |
| 26570 | } |
| 26571 | |
| 26572 | { |
| 26573 | popInteractions(prevInteractions); |
| 26574 | finishPendingInteractions(root, expirationTime); |
| 26575 | } |
| 26576 |
nothing calls this directly
no test coverage detected