From b66b58779ba2f0660ee6ef357811a17bd68a0c7e Mon Sep 17 00:00:00 2001 From: Artem Yankov Date: Fri, 11 May 2012 21:43:27 -0700 Subject: [PATCH 1/2] Fixes #5. Replace for...in loop cause it produces unexpected results. --- lib/Client.js | 2 +- lib/Consumer.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index 6268eea..c01d9de 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -149,7 +149,7 @@ module.exports = std.Class(Connection, function(supr) { var r = this._sendRequests.slice(0); for (i in r) this._writeRequest(r[i]) // send queued read requests - for (i in this._requests) this._writeRequest(this._requests[i]) + for (var i=0; i 0 || !this._timerTicked) return this._timerTicked = false - for (i in this._topics) { + for (var i=0; i 90) { - for (i in this._topics) if (this._topics[i].name == topic) { + for (var i=0; i Date: Tue, 15 May 2012 22:36:06 -0700 Subject: [PATCH 2/2] replace for...in in _connected function --- lib/Client.js | 2 +- package.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Client.js b/lib/Client.js index c01d9de..4f9e3ff 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -147,7 +147,7 @@ module.exports = std.Class(Connection, function(supr) { // send queued send requests // make a copy because socket writes may return immediately and modify the size var r = this._sendRequests.slice(0); - for (i in r) this._writeRequest(r[i]) + for (var i=0; i (http://marcuswest.in)", "repository": { "type": "git",