Add ability to pass proxy

This commit is contained in:
Andrew Stewart 2014-08-12 10:07:17 -07:00
parent df60282042
commit ffc27f9942
1 changed files with 6 additions and 2 deletions

View File

@ -31,8 +31,12 @@ var Driver = module.exports = function Driver(opts) {
Utils.subclass(Driver, Basestar);
Driver.prototype.setupCommands = function(commands) {
this.proxyMethods(commands, this.connection, this);
Driver.prototype.setupCommands = function(commands, proxy) {
if (proxy == null) {
proxy = this.connection;
}
this.proxyMethods(commands, proxy, this);
for (var i = 0; i < commands.length; i++) {
var command = commands[i];