()
| 959 | } |
| 960 | |
| 961 | function drainQueue() { |
| 962 | if (draining) { |
| 963 | return; |
| 964 | } |
| 965 | var timeout = runTimeout(cleanUpNextTick); |
| 966 | draining = true; |
| 967 | |
| 968 | var len = queue.length; |
| 969 | while(len) { |
| 970 | currentQueue = queue; |
| 971 | queue = []; |
| 972 | while (++queueIndex < len) { |
| 973 | if (currentQueue) { |
| 974 | currentQueue[queueIndex].run(); |
| 975 | } |
| 976 | } |
| 977 | queueIndex = -1; |
| 978 | len = queue.length; |
| 979 | } |
| 980 | currentQueue = null; |
| 981 | draining = false; |
| 982 | runClearTimeout(timeout); |
| 983 | } |
| 984 | |
| 985 | process.nextTick = function (fun) { |
| 986 | var args = new Array(arguments.length - 1); |
no test coverage detected