()
| 1117 | } |
| 1118 | |
| 1119 | function drainQueue() { |
| 1120 | if (draining) { |
| 1121 | return; |
| 1122 | } |
| 1123 | var timeout = runTimeout(cleanUpNextTick); |
| 1124 | draining = true; |
| 1125 | |
| 1126 | var len = queue.length; |
| 1127 | while(len) { |
| 1128 | currentQueue = queue; |
| 1129 | queue = []; |
| 1130 | while (++queueIndex < len) { |
| 1131 | if (currentQueue) { |
| 1132 | currentQueue[queueIndex].run(); |
| 1133 | } |
| 1134 | } |
| 1135 | queueIndex = -1; |
| 1136 | len = queue.length; |
| 1137 | } |
| 1138 | currentQueue = null; |
| 1139 | draining = false; |
| 1140 | runClearTimeout(timeout); |
| 1141 | } |
| 1142 | |
| 1143 | process.nextTick = function (fun) { |
| 1144 | var args = new Array(arguments.length - 1); |
no test coverage detected