Browse Source

net_uv: Don't add listenerCallback when null

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
d0a9e64245
  1. 7
      lib/net_uv.js

7
lib/net_uv.js

@ -359,20 +359,19 @@ function Server(/* [ options, ] listener */) {
var self = this;
var options, listenerCallback;
var options;
if (typeof arguments[0] == 'function') {
options = {};
listenerCallback = arguments[0];
self.on('connection', arguments[0]);
} else {
options = arguments[0];
if (typeof arguments[1] == 'function') {
listenerCallback = arguments[1];
self.on('connection', arguments[1]);
}
}
this.on('connection', listenerCallback);
this.connections = 0;
this.allowHalfOpen = options.allowHalfOpen || false;

Loading…
Cancel
Save