()
| 860 | } |
| 861 | |
| 862 | function drainQueue() { |
| 863 | if (draining) { |
| 864 | return; |
| 865 | } |
| 866 | var timeout = runTimeout(cleanUpNextTick); |
| 867 | draining = true; |
| 868 | |
| 869 | var len = queue.length; |
| 870 | while(len) { |
| 871 | currentQueue = queue; |
| 872 | queue = []; |
| 873 | while (++queueIndex < len) { |
| 874 | if (currentQueue) { |
| 875 | currentQueue[queueIndex].run(); |
| 876 | } |
| 877 | } |
| 878 | queueIndex = -1; |
| 879 | len = queue.length; |
| 880 | } |
| 881 | currentQueue = null; |
| 882 | draining = false; |
| 883 | runClearTimeout(timeout); |
| 884 | } |
| 885 | |
| 886 | process.nextTick = function (fun) { |
| 887 | var args = new Array(arguments.length - 1); |
no test coverage detected