diff --git a/lib/connection.js b/lib/connection.js index 94a454b..4ac3426 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -44,6 +44,10 @@ module.exports = function Connection(opts) { var adaptor = module.adaptor(opts); for (var prop in adaptor) { + if (~['constructor'].indexOf(prop)) { + continue; + } + if (typeof adaptor[prop] === 'function') { adaptor[prop] = adaptor[prop].bind(adaptor); } diff --git a/lib/device.js b/lib/device.js index 919080f..5f0a95e 100644 --- a/lib/device.js +++ b/lib/device.js @@ -44,6 +44,10 @@ module.exports = function Device(opts) { var driver = module.driver(opts); for (var prop in driver) { + if (~['constructor'].indexOf(prop)) { + continue; + } + if (typeof driver[prop] === 'function') { driver[prop] = driver[prop].bind(driver); }