Update index.js

Added missing hasOwnProperty check. socket.io breaks without it when Object.prototype has been extended.
This commit is contained in:
poldridge
2014-06-06 22:08:58 -07:00
parent 99bbd74d14
commit 3f817c3a18

View File

@@ -159,7 +159,9 @@ Server.prototype.adapter = function(v){
if (!arguments.length) return this._adapter;
this._adapter = v;
for (var i in this.nsps) {
this.nsps[i].initAdapter();
if (this.nsps[i].hasOwnProperty(i)) {
this.nsps[i].initAdapter();
}
}
return this;
};