mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
net_uv: Don't add listenerCallback when null
This commit is contained in:
1 parent
5c38163787
commit
d0a9e64245
1 file changed
+3
-4
+3
-4
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user