MCPcopy Index your code
hub / github.com/angular/angular / drainMicroTaskQueueSynchronously

Function drainMicroTaskQueueSynchronously

packages/zone.js/lib/zone-impl.ts:1552–1585  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1550 }
1551
1552 function drainMicroTaskQueueSynchronously() {
1553 if (_isDrainingMicrotaskQueue) {
1554 return;
1555 }
1556
1557 _isDrainingMicrotaskQueue = true;
1558
1559 try {
1560 while (_microTaskQueue.length) {
1561 const queue = _microTaskQueue;
1562 _microTaskQueue = [];
1563
1564 for (const task of queue) {
1565 try {
1566 task.zone.runTask(task, null, null);
1567 } catch (error) {
1568 _api.onUnhandledError(error as Error);
1569 }
1570 }
1571 }
1572 } finally {
1573 // The order matters!
1574 if (global[enableNativeMicrotaskDraining]) {
1575 _isDrainingMicrotaskQueue = false;
1576 _api.microtaskDrainDone();
1577 } else {
1578 try {
1579 _api.microtaskDrainDone();
1580 } finally {
1581 _isDrainingMicrotaskQueue = false;
1582 }
1583 }
1584 }
1585 }
1586
1587 //////////////////////////////////////////////////////
1588 //////////////////////////////////////////////////////

Callers 1

invokeTaskMethod · 0.85

Calls 1

runTaskMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…