From 832a1dcc1e9c5374b30a4edba4c0283774502c5f Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 22 Aug 2013 11:53:14 -0700 Subject: [PATCH] change socket error listener to just use length --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 8af42bc..0f0f3c7 100644 --- a/lib/application.js +++ b/lib/application.js @@ -125,7 +125,7 @@ app.callback = function(){ return function(req, res){ var ctx = new self.Context(self, req, res); - if (!~ctx.socket.listeners('error').indexOf(onerror)) { + if (!ctx.socket.listeners('error').length) { ctx.socket.on('error', onerror); }