diff --git a/lib/queue.js b/lib/queue.js index a6ac3b2584..ab4a0354b0 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -20,7 +20,10 @@ Queue.prototype.shift = function () { return; } } - return this.head[this.offset++]; // sorry, JSLint + var item = this.head[this.offset]; + this.head[this.offset] = null; + this.offset++; + return item; }; Queue.prototype.push = function (item) {