()
| 1004 | } |
| 1005 | |
| 1006 | function drainQueue() { |
| 1007 | if (draining) { |
| 1008 | return; |
| 1009 | } |
| 1010 | var timeout = runTimeout(cleanUpNextTick); |
| 1011 | draining = true; |
| 1012 | |
| 1013 | var len = queue.length; |
| 1014 | while(len) { |
| 1015 | currentQueue = queue; |
| 1016 | queue = []; |
| 1017 | while (++queueIndex < len) { |
| 1018 | if (currentQueue) { |
| 1019 | currentQueue[queueIndex].run(); |
| 1020 | } |
| 1021 | } |
| 1022 | queueIndex = -1; |
| 1023 | len = queue.length; |
| 1024 | } |
| 1025 | currentQueue = null; |
| 1026 | draining = false; |
| 1027 | runClearTimeout(timeout); |
| 1028 | } |
| 1029 | |
| 1030 | process.nextTick = function (fun) { |
| 1031 | var args = new Array(arguments.length - 1); |
no test coverage detected