()
| 739 | } |
| 740 | |
| 741 | function drainQueue() { |
| 742 | if (draining) { |
| 743 | return; |
| 744 | } |
| 745 | var timeout = runTimeout(cleanUpNextTick); |
| 746 | draining = true; |
| 747 | |
| 748 | var len = queue.length; |
| 749 | while(len) { |
| 750 | currentQueue = queue; |
| 751 | queue = []; |
| 752 | while (++queueIndex < len) { |
| 753 | if (currentQueue) { |
| 754 | currentQueue[queueIndex].run(); |
| 755 | } |
| 756 | } |
| 757 | queueIndex = -1; |
| 758 | len = queue.length; |
| 759 | } |
| 760 | currentQueue = null; |
| 761 | draining = false; |
| 762 | runClearTimeout(timeout); |
| 763 | } |
| 764 | |
| 765 | process.nextTick = function (fun) { |
| 766 | var args = new Array(arguments.length - 1); |
no test coverage detected