MCPcopy
hub / github.com/microsoft/SandDance / flushSyncCallbackQueueImpl

Function flushSyncCallbackQueueImpl

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

Source from the content-addressed store, hash-verified

11208 }
11209
11210 function flushSyncCallbackQueueImpl() {
11211 if (!isFlushingSyncQueue && syncQueue !== null) {
11212 // Prevent re-entrancy.
11213 isFlushingSyncQueue = true;
11214 var i = 0;
11215
11216 try {
11217 var _isSync = true;
11218 var queue = syncQueue;
11219 runWithPriority$1(ImmediatePriority, function () {
11220 for (; i < queue.length; i++) {
11221 var callback = queue[i];
11222
11223 do {
11224 callback = callback(_isSync);
11225 } while (callback !== null);
11226 }
11227 });
11228 syncQueue = null;
11229 } catch (error) {
11230 // If something throws, leave the remaining callbacks on the queue.
11231 if (syncQueue !== null) {
11232 syncQueue = syncQueue.slice(i + 1);
11233 } // Resume flushing in the next tick
11234
11235
11236 Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
11237 throw error;
11238 } finally {
11239 isFlushingSyncQueue = false;
11240 }
11241 }
11242 }
11243
11244 var NoMode = 0;
11245 var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root

Callers 1

flushSyncCallbackQueueFunction · 0.85

Calls 2

runWithPriority$1Function · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected