|
@ -185,20 +185,18 @@ |
|
|
var l = nextTickQueue.length; |
|
|
var l = nextTickQueue.length; |
|
|
if (l === 0) return; |
|
|
if (l === 0) return; |
|
|
|
|
|
|
|
|
|
|
|
var q = nextTickQueue; |
|
|
|
|
|
nextTickQueue = []; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
for (var i = 0; i < l; i++) { |
|
|
for (var i = 0; i < l; i++) q[i](); |
|
|
nextTickQueue[i](); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
catch (e) { |
|
|
catch (e) { |
|
|
nextTickQueue.splice(0, i + 1); |
|
|
if (nextTickQueue.length) { |
|
|
if (i + 1 < l) { |
|
|
|
|
|
process._needTickCallback(); |
|
|
process._needTickCallback(); |
|
|
} |
|
|
} |
|
|
throw e; // process.nextTick error, or 'error' event on first tick
|
|
|
throw e; // process.nextTick error, or 'error' event on first tick
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
nextTickQueue.splice(0, l); |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
process.nextTick = function(callback) { |
|
|
process.nextTick = function(callback) { |
|
|