()
| 3335 | } |
| 3336 | |
| 3337 | function drainQueue() { |
| 3338 | if (draining) { |
| 3339 | return; |
| 3340 | } |
| 3341 | var timeout = runTimeout(cleanUpNextTick); |
| 3342 | draining = true; |
| 3343 | |
| 3344 | var len = queue.length; |
| 3345 | while(len) { |
| 3346 | currentQueue = queue; |
| 3347 | queue = []; |
| 3348 | while (++queueIndex < len) { |
| 3349 | if (currentQueue) { |
| 3350 | currentQueue[queueIndex].run(); |
| 3351 | } |
| 3352 | } |
| 3353 | queueIndex = -1; |
| 3354 | len = queue.length; |
| 3355 | } |
| 3356 | currentQueue = null; |
| 3357 | draining = false; |
| 3358 | runClearTimeout(timeout); |
| 3359 | } |
| 3360 | |
| 3361 | process.nextTick = function (fun) { |
| 3362 | var args = new Array(arguments.length - 1); |
no test coverage detected