Browse Source

node: remove duplicate infoBox checks

These checks are now done in C++ and don't need to also be checked in
JS. Also remove a couple unused variables.
v0.11.6-release
Trevor Norris 12 years ago
parent
commit
ab5dabf876
  1. 30
      src/node.js

30
src/node.js

@ -350,13 +350,8 @@
// run callbacks that have no domain
// using domains will cause this to be overridden
function _tickCallback() {
var callback, nextTickLength, threw;
var callback, threw;
if (infoBox[inTick] === 1) return;
if (infoBox[length] === 0) {
infoBox[index] = 0;
return;
}
infoBox[inTick] = 1;
while (infoBox[index] < infoBox[length]) {
@ -374,26 +369,17 @@
}
function _tickDomainCallback() {
var nextTickLength, tock, callback;
if (infoBox[lastThrew] === 1) {
infoBox[lastThrew] = 0;
return;
}
var tock, callback, domain;
if (infoBox[inTick] === 1) return;
if (infoBox[length] === 0) {
infoBox[index] = 0;
return;
}
infoBox[inTick] = 1;
while (infoBox[index] < infoBox[length]) {
tock = nextTickQueue[infoBox[index]++];
callback = tock.callback;
if (tock.domain) {
if (tock.domain._disposed) continue;
tock.domain.enter();
domain = tock.domain;
if (domain) {
if (domain._disposed) continue;
domain.enter();
}
infoBox[lastThrew] = 1;
try {
@ -402,8 +388,8 @@
} finally {
if (infoBox[lastThrew] === 1) tickDone();
}
if (tock.domain)
tock.domain.exit();
if (domain)
domain.exit();
}
tickDone();

Loading…
Cancel
Save