From 5098763855a3dd2c50f816c83a4e05cd15403e9d Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Thu, 31 May 2012 19:20:38 +1000 Subject: [PATCH] global object pollution fixed --- lib/x11/handshake.js | 2 +- lib/x11/xcore.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/x11/handshake.js b/lib/x11/handshake.js index feed8ce..a2f717f 100644 --- a/lib/x11/handshake.js +++ b/lib/x11/handshake.js @@ -158,7 +158,7 @@ bl.unpack('C', function(res) { display.vendor = vendor.toString().substr(0, display.vlen); // utf8 by default? display.format = {}; - for (i=0; i < display.format_num; ++i) + for (var i=0; i < display.format_num; ++i) { bl.unpack('CCCxxxxx', function(fmt) { var depth = fmt[0]; diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index 654280e..2206acb 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -84,7 +84,7 @@ XClient.prototype.terminate = function() XClient.prototype.importRequestsFromTemplates = function(target, reqs) { var client = this; - for (r in reqs) + for (var r in reqs) { // r is request name target[r] = (function(reqName) { diff --git a/package.json b/package.json index f74c639..b9e5943 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "sinon": "*" } , "scripts": { - "test": "mocha --globals 'r,i'", + "test": "mocha", "prepublish" : "npm prune" } }