Use forIn to ensure Object iteration is performed
This commit is contained in:
parent
919a54540f
commit
6ebbdf0eab
|
@ -43,7 +43,7 @@ module.exports = function Connection(opts) {
|
||||||
|
|
||||||
var adaptor = module.adaptor(opts);
|
var adaptor = module.adaptor(opts);
|
||||||
|
|
||||||
_.forEach(adaptor, function(prop, name) {
|
_.forIn(adaptor, function(prop, name) {
|
||||||
if (name === "constructor") {
|
if (name === "constructor") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ module.exports = function Connection(opts) {
|
||||||
if (testMode()) {
|
if (testMode()) {
|
||||||
var testAdaptor = Registry.findByAdaptor("test").adaptor(opts);
|
var testAdaptor = Registry.findByAdaptor("test").adaptor(opts);
|
||||||
|
|
||||||
_.forEach(adaptor, function(prop, name) {
|
_.forIn(adaptor, function(prop, name) {
|
||||||
if (_.isFunction(prop) && !testAdaptor[name]) {
|
if (_.isFunction(prop) && !testAdaptor[name]) {
|
||||||
testAdaptor[name] = function() { return true; };
|
testAdaptor[name] = function() { return true; };
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ module.exports = function Device(opts) {
|
||||||
|
|
||||||
var driver = module.driver(opts);
|
var driver = module.driver(opts);
|
||||||
|
|
||||||
_.forEach(driver, function(prop, name) {
|
_.forIn(driver, function(prop, name) {
|
||||||
if (name === "constructor") {
|
if (name === "constructor") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ module.exports = function Device(opts) {
|
||||||
if (testMode()) {
|
if (testMode()) {
|
||||||
var testDriver = Registry.findByDriver("test").driver(opts);
|
var testDriver = Registry.findByDriver("test").driver(opts);
|
||||||
|
|
||||||
_.forEach(driver, function(prop, name) {
|
_.forIn(driver, function(prop, name) {
|
||||||
if (_.isFunction(prop) && !testDriver[name]) {
|
if (_.isFunction(prop) && !testDriver[name]) {
|
||||||
testDriver[name] = function() { return true; };
|
testDriver[name] = function() { return true; };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue