Don't use arguments.callee

fork
Brian White 12 years ago
parent 8370471c58
commit 639701125b

@ -1037,47 +1037,44 @@ ImapConnection.prototype._move = function(which, uids, boxTo, cb) {
var self = this; var self = this;
if (this._state.status !== STATES.BOXSELECTED) if (this._state.status !== STATES.BOXSELECTED)
throw new Error('No mailbox is currently selected'); throw new Error('No mailbox is currently selected');
if (self._state.box.permFlags.indexOf('Deleted') === -1) { if (this._state.box.permFlags.indexOf('Deleted') === -1) {
throw new Error('Cannot move message: ' throw new Error('Cannot move message: '
+ 'server does not allow deletion of messages'); + 'server does not allow deletion of messages');
} else { } else {
self._copy(which, uids, boxTo, function(err, reentryCount, deletedUIDs, this._copy(which, uids, boxTo, function ccb(err, reentryCount, deletedUIDs,
counter) { counter) {
if (err) { if (err)
cb(err); return cb(err);
return;
}
var fnMe = arguments.callee;
counter = counter || 0; counter = counter || 0;
// Make sure we don't expunge any messages marked as Deleted except the // Make sure we don't expunge any messages marked as Deleted except the
// one we are moving // one we are moving
if (reentryCount === undefined) { if (reentryCount === undefined) {
self.search(['DELETED'], function(e, result) { self.search(['DELETED'], function(e, result) {
fnMe.call(this, e, 1, result); ccb(e, 1, result);
}); });
} else if (reentryCount === 1) { } else if (reentryCount === 1) {
if (counter < deletedUIDs.length) { if (counter < deletedUIDs.length) {
self.delFlags(deletedUIDs[counter], 'Deleted', function(e) { self.delFlags(deletedUIDs[counter], 'Deleted', function(e) {
process.nextTick(function() { process.nextTick(function() {
fnMe.call(this, e, reentryCount, deletedUIDs, counter + 1); ccb(e, reentryCount, deletedUIDs, counter + 1);
}); });
}); });
} else } else
fnMe.call(this, err, reentryCount + 1, deletedUIDs); ccb(err, reentryCount + 1, deletedUIDs);
} else if (reentryCount === 2) { } else if (reentryCount === 2) {
self.addFlags(uids, 'Deleted', function(e) { self.addFlags(uids, 'Deleted', function(e) {
fnMe.call(this, e, reentryCount + 1, deletedUIDs); ccb(e, reentryCount + 1, deletedUIDs);
}); });
} else if (reentryCount === 3) { } else if (reentryCount === 3) {
self.removeDeleted(function(e) { self.removeDeleted(function(e) {
fnMe.call(this, e, reentryCount + 1, deletedUIDs); ccb(e, reentryCount + 1, deletedUIDs);
}); });
} else if (reentryCount === 4) { } else if (reentryCount === 4) {
if (counter < deletedUIDs.length) { if (counter < deletedUIDs.length) {
self.addFlags(deletedUIDs[counter], 'Deleted', function(e) { self.addFlags(deletedUIDs[counter], 'Deleted', function(e) {
process.nextTick(function() { process.nextTick(function() {
fnMe.call(this, e, reentryCount, deletedUIDs, counter + 1); ccb(e, reentryCount, deletedUIDs, counter + 1);
}); });
}); });
} else } else

Loading…
Cancel
Save