()
| 235 | } |
| 236 | |
| 237 | function drainQueue() { |
| 238 | if (draining) { |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | var timeout = runTimeout(cleanUpNextTick); |
| 243 | draining = true; |
| 244 | var len = queue.length; |
| 245 | |
| 246 | while (len) { |
| 247 | currentQueue = queue; |
| 248 | queue = []; |
| 249 | |
| 250 | while (++queueIndex < len) { |
| 251 | if (currentQueue) { |
| 252 | currentQueue[queueIndex].run(); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | queueIndex = -1; |
| 257 | len = queue.length; |
| 258 | } |
| 259 | |
| 260 | currentQueue = null; |
| 261 | draining = false; |
| 262 | runClearTimeout(timeout); |
| 263 | } |
| 264 | |
| 265 | process.nextTick = function (fun) { |
| 266 | var args = new Array(arguments.length - 1); |
no test coverage detected