()
| 830 | } |
| 831 | |
| 832 | function drainQueue() { |
| 833 | if (draining) { |
| 834 | return; |
| 835 | } |
| 836 | var timeout = runTimeout(cleanUpNextTick); |
| 837 | draining = true; |
| 838 | |
| 839 | var len = queue.length; |
| 840 | while(len) { |
| 841 | currentQueue = queue; |
| 842 | queue = []; |
| 843 | while (++queueIndex < len) { |
| 844 | if (currentQueue) { |
| 845 | currentQueue[queueIndex].run(); |
| 846 | } |
| 847 | } |
| 848 | queueIndex = -1; |
| 849 | len = queue.length; |
| 850 | } |
| 851 | currentQueue = null; |
| 852 | draining = false; |
| 853 | runClearTimeout(timeout); |
| 854 | } |
| 855 | |
| 856 | process.nextTick = function (fun) { |
| 857 | var args = new Array(arguments.length - 1); |
no test coverage detected