diff options
author | Sakthipriyan Vairamani <thechargingvolcano@gmail.com> | 2015-08-12 00:01:50 +0530 |
---|---|---|
committer | Sakthipriyan Vairamani <thechargingvolcano@gmail.com> | 2015-08-20 03:17:08 +0530 |
commit | 8f58fb92fff904a6ca58fd0df9ee5a1816e5b84e (patch) | |
tree | a3eb0aea4cfa4d7f3cbb85adefe60ca621901f89 /lib/stream.js | |
parent | d98eed51f782ea44c3fd7823b2912f7fb30ab185 (diff) | |
download | node-new-8f58fb92fff904a6ca58fd0df9ee5a1816e5b84e.tar.gz |
events: deprecate static listenerCount function
As per the discussion in #734, this patch deprecates the usage of
`EventEmitter.listenerCount` static function in the docs, and introduces
the `listenerCount` function in the prototype of `EventEmitter` itself.
PR-URL: https://github.com/nodejs/node/pull/2349
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'lib/stream.js')
-rw-r--r-- | lib/stream.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stream.js b/lib/stream.js index 8d3535dc4d..2e0cdfc313 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -70,7 +70,7 @@ Stream.prototype.pipe = function(dest, options) { // don't leave dangling pipes when there are errors. function onerror(er) { cleanup(); - if (EE.listenerCount(this, 'error') === 0) { + if (this.listenerCount('error') === 0) { throw er; // Unhandled stream error in pipe. } } |