MCPcopy
hub / github.com/RubyLouvre/anu / drainQueue

Function drainQueue

test/babel.js:1737–1759  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1735 }
1736
1737 function drainQueue() {
1738 if (draining) {
1739 return;
1740 }
1741 var timeout = runTimeout(cleanUpNextTick);
1742 draining = true;
1743
1744 var len = queue.length;
1745 while (len) {
1746 currentQueue = queue;
1747 queue = [];
1748 while (++queueIndex < len) {
1749 if (currentQueue) {
1750 currentQueue[queueIndex].run();
1751 }
1752 }
1753 queueIndex = -1;
1754 len = queue.length;
1755 }
1756 currentQueue = null;
1757 draining = false;
1758 runClearTimeout(timeout);
1759 }
1760
1761 process.nextTick = function (fun) {
1762 var args = new Array(arguments.length - 1);

Callers 1

cleanUpNextTickFunction · 0.85

Calls 2

runTimeoutFunction · 0.85
runClearTimeoutFunction · 0.85

Tested by

no test coverage detected