MCPcopy Index your code
hub / github.com/microsoft/SandDance / flushPassiveEffectsImpl

Function flushPassiveEffectsImpl

docs/external/js/react-dom.development.js:22959–23023  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

pushInteractionsFunction · 0.85
setCurrentFiberFunction · 0.85
invokeGuardedCallbackFunction · 0.85
hasCaughtErrorFunction · 0.85
clearCaughtErrorFunction · 0.85
captureCommitPhaseErrorFunction · 0.85
resetCurrentFiberFunction · 0.85
popInteractionsFunction · 0.85
flushSyncCallbackQueueFunction · 0.85

Tested by

no test coverage detected