()
| 177 | } |
| 178 | |
| 179 | function drainQueue() { |
| 180 | if (draining) { |
| 181 | return; |
| 182 | } |
| 183 | var timeout = runTimeout(cleanUpNextTick); |
| 184 | draining = true; |
| 185 | |
| 186 | var len = queue.length; |
| 187 | while(len) { |
| 188 | currentQueue = queue; |
| 189 | queue = []; |
| 190 | while (++queueIndex < len) { |
| 191 | if (currentQueue) { |
| 192 | currentQueue[queueIndex].run(); |
| 193 | } |
| 194 | } |
| 195 | queueIndex = -1; |
| 196 | len = queue.length; |
| 197 | } |
| 198 | currentQueue = null; |
| 199 | draining = false; |
| 200 | runClearTimeout(timeout); |
| 201 | } |
| 202 | |
| 203 | process.nextTick = function (fun) { |
| 204 | var args = new Array(arguments.length - 1); |
no test coverage detected