Permalink
Browse files

use self to ensure proper scope of options in doOpenSet

  • Loading branch information...
1 parent 926d433 commit 40c3f8f1ca738f68d28b4a5095af73fcf44e6250 @andrewjstone andrewjstone committed with aheckmann Aug 29, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/drivers/node-mongodb-native/connection.js
@@ -68,12 +68,13 @@ NativeConnection.prototype.doOpen = function (fn) {
*/
NativeConnection.prototype.doOpenSet = function (fn) {
+ var self = this;
if (!this.db) {
var servers = []
, ports = this.port;
this.host.forEach(function (host, i) {
- servers.push(new mongo.Server(host, ports[i], this.options.server));
+ servers.push(new mongo.Server(host, ports[i], self.options.server));
});
var server = new ReplSetServers(servers, this.options.replset);

0 comments on commit 40c3f8f

Please sign in to comment.