From 13c388fbf7324e5e4e619075f234c7ce6843245f Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Thu, 18 Dec 2014 13:19:58 -0800 Subject: [PATCH] Simplify path for method proxying in drivers --- lib/basestar.js | 8 +------- lib/driver.js | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/basestar.js b/lib/basestar.js index c4ecdc7..ce960bd 100644 --- a/lib/basestar.js +++ b/lib/basestar.js @@ -30,13 +30,7 @@ Utils.subclass(Basestar, EventEmitter); // force - whether or not to overwrite existing method definitions // // Returns the klass where the methods have been proxied -Basestar.prototype.proxyMethods = function(methods, target, source, force) { - if (force == null) { - force = false; - } - - return Utils.proxyFunctionsToObject(methods, target, source, force); -}; +Basestar.prototype.proxyMethods = Utils.proxyFunctionsToObject; // Public: Defines an event handler that proxies events from a source object // to a target object diff --git a/lib/driver.js b/lib/driver.js index 8488642..3de30f8 100644 --- a/lib/driver.js +++ b/lib/driver.js @@ -51,7 +51,7 @@ Driver.prototype.setupCommands = function(commands, proxy) { proxy = this.connection; } - this.proxyMethods(commands, proxy, this); + Utils.proxyFunctionsToObject(commands, proxy, this); _.forEach(commands, function(command) { var snake_case = command.replace(/[A-Z]+/g, function(match) {