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