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