From b42fd246cf3b008021260208fca5e543fffed8b5 Mon Sep 17 00:00:00 2001 From: Kory Nunn Date: Mon, 25 Jul 2016 15:59:43 +1000 Subject: [PATCH] handle arbitrary EE implementations --- lib/_stream_readable.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 79914fa684..a5093f5b2f 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -55,10 +55,8 @@ var StringDecoder; util.inherits(Readable, Stream); -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); + if (typeof emitter.prototype.prependListener === 'function') return emitter.prependListener(event, fn); // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. This is here