()
| 591 | } |
| 592 | |
| 593 | function drainQueue() { |
| 594 | if (draining) { |
| 595 | return; |
| 596 | } |
| 597 | var timeout = runTimeout(cleanUpNextTick); |
| 598 | draining = true; |
| 599 | |
| 600 | var len = queue.length; |
| 601 | while(len) { |
| 602 | currentQueue = queue; |
| 603 | queue = []; |
| 604 | while (++queueIndex < len) { |
| 605 | if (currentQueue) { |
| 606 | currentQueue[queueIndex].run(); |
| 607 | } |
| 608 | } |
| 609 | queueIndex = -1; |
| 610 | len = queue.length; |
| 611 | } |
| 612 | currentQueue = null; |
| 613 | draining = false; |
| 614 | runClearTimeout(timeout); |
| 615 | } |
| 616 | |
| 617 | process.nextTick = function (fun) { |
| 618 | var args = new Array(arguments.length - 1); |
no test coverage detected