Skip to content

Commit

Permalink
backcompat - init() should return a ref to the wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Dopson committed Dec 16, 2011
1 parent a00661a commit f281c02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/zookeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ ZooKeeper.prototype.init = function init(config) {
self.data_as_buffer = config.data_as_buffer;
if(this.logger) this.logger("Encoding for data output: %s", self.encoding);
}
return this._native.init.call(this._native, config);
this._native.init.call(this._native, config);

// The native code returns a ref to itself. So we should return a ref to the wrapper object
return self;
}

ZooKeeper.prototype.connect = function connect(options, cb) {
Expand Down

0 comments on commit f281c02

Please sign in to comment.