Permalink
Browse files

backcompat - init() should return a ref to the wrapper

  • Loading branch information...
1 parent a00661a commit f281c02b2156c11ecff897d164b101504f7efab7 Dave Dopson committed Dec 16, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/zookeeper.js
View
@@ -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) {

0 comments on commit f281c02

Please sign in to comment.