diff --git a/lib/queue.js b/lib/queue.js index 3fc87ab..ece2e6b 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -18,7 +18,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) {