()
| 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); |
no test coverage detected