From d0a9e64245dbf60366ee25260effc2e3aea13542 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 20 Jun 2011 14:48:00 +0200 Subject: [PATCH] net_uv: Don't add listenerCallback when null --- lib/net_uv.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/net_uv.js b/lib/net_uv.js index 40c1e896c86..f8ef412b360 100644 --- a/lib/net_uv.js +++ b/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;