From 6ebbdf0eab7cb93a23f6868ac320c0d0791b0e2f Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Wed, 17 Dec 2014 16:31:26 -0800 Subject: [PATCH] Use forIn to ensure Object iteration is performed --- lib/connection.js | 4 ++-- lib/device.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index 3d987af..272151e 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -43,7 +43,7 @@ module.exports = function Connection(opts) { var adaptor = module.adaptor(opts); - _.forEach(adaptor, function(prop, name) { + _.forIn(adaptor, function(prop, name) { if (name === "constructor") { return; } @@ -56,7 +56,7 @@ module.exports = function Connection(opts) { if (testMode()) { var testAdaptor = Registry.findByAdaptor("test").adaptor(opts); - _.forEach(adaptor, function(prop, name) { + _.forIn(adaptor, function(prop, name) { if (_.isFunction(prop) && !testAdaptor[name]) { testAdaptor[name] = function() { return true; }; } diff --git a/lib/device.js b/lib/device.js index ee1c974..75311c9 100644 --- a/lib/device.js +++ b/lib/device.js @@ -44,7 +44,7 @@ module.exports = function Device(opts) { var driver = module.driver(opts); - _.forEach(driver, function(prop, name) { + _.forIn(driver, function(prop, name) { if (name === "constructor") { return; } @@ -57,7 +57,7 @@ module.exports = function Device(opts) { if (testMode()) { var testDriver = Registry.findByDriver("test").driver(opts); - _.forEach(driver, function(prop, name) { + _.forIn(driver, function(prop, name) { if (_.isFunction(prop) && !testDriver[name]) { testDriver[name] = function() { return true; }; }