Fix up API errors

This commit is contained in:
Andrew Stewart 2014-11-11 13:41:09 -08:00
parent ce87a355f0
commit 39f9c8b637
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,10 @@ module.exports = function Connection(opts) {
var adaptor = module.adaptor(opts); var adaptor = module.adaptor(opts);
for (var prop in adaptor) { for (var prop in adaptor) {
if (~['constructor'].indexOf(prop)) {
continue;
}
if (typeof adaptor[prop] === 'function') { if (typeof adaptor[prop] === 'function') {
adaptor[prop] = adaptor[prop].bind(adaptor); adaptor[prop] = adaptor[prop].bind(adaptor);
} }

View File

@ -44,6 +44,10 @@ module.exports = function Device(opts) {
var driver = module.driver(opts); var driver = module.driver(opts);
for (var prop in driver) { for (var prop in driver) {
if (~['constructor'].indexOf(prop)) {
continue;
}
if (typeof driver[prop] === 'function') { if (typeof driver[prop] === 'function') {
driver[prop] = driver[prop].bind(driver); driver[prop] = driver[prop].bind(driver);
} }