()
| 22957 | } |
| 22958 | |
| 22959 | function flushPassiveEffectsImpl() { |
| 22960 | if (rootWithPendingPassiveEffects === null) { |
| 22961 | return false; |
| 22962 | } |
| 22963 | |
| 22964 | var root = rootWithPendingPassiveEffects; |
| 22965 | var expirationTime = pendingPassiveEffectsExpirationTime; |
| 22966 | rootWithPendingPassiveEffects = null; |
| 22967 | pendingPassiveEffectsExpirationTime = NoWork; |
| 22968 | |
| 22969 | if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { |
| 22970 | { |
| 22971 | throw Error( "Cannot flush passive effects while already rendering." ); |
| 22972 | } |
| 22973 | } |
| 22974 | |
| 22975 | var prevExecutionContext = executionContext; |
| 22976 | executionContext |= CommitContext; |
| 22977 | var prevInteractions = pushInteractions(root); |
| 22978 | |
| 22979 | { |
| 22980 | // Note: This currently assumes there are no passive effects on the root fiber |
| 22981 | // because the root is not part of its own effect list. |
| 22982 | // This could change in the future. |
| 22983 | var _effect2 = root.current.firstEffect; |
| 22984 | |
| 22985 | while (_effect2 !== null) { |
| 22986 | { |
| 22987 | setCurrentFiber(_effect2); |
| 22988 | invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2); |
| 22989 | |
| 22990 | if (hasCaughtError()) { |
| 22991 | if (!(_effect2 !== null)) { |
| 22992 | { |
| 22993 | throw Error( "Should be working on an effect." ); |
| 22994 | } |
| 22995 | } |
| 22996 | |
| 22997 | var _error5 = clearCaughtError(); |
| 22998 | |
| 22999 | captureCommitPhaseError(_effect2, _error5); |
| 23000 | } |
| 23001 | |
| 23002 | resetCurrentFiber(); |
| 23003 | } |
| 23004 | |
| 23005 | var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC |
| 23006 | |
| 23007 | _effect2.nextEffect = null; |
| 23008 | _effect2 = nextNextEffect; |
| 23009 | } |
| 23010 | } |
| 23011 | |
| 23012 | { |
| 23013 | popInteractions(prevInteractions); |
| 23014 | finishPendingInteractions(root, expirationTime); |
| 23015 | } |
| 23016 |
nothing calls this directly
no test coverage detected