You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
listenerCount is currently a class method on EventEmitter, yet the very first argument is the emitter instance whose listenerCount should be returned. Why, then, is it a class method at all if it requires an instance on which to operate?
I propose EventEmitter.prototype.listenerCount be added such that:
varemitter=newrequire('events').EventEmitter();EventEmitter.listenerCount(emitter,'myEvent');// alias for:emitter.listenerCount('myEvent');
The text was updated successfully, but these errors were encountered:
@brendanashworth thanks, I hadn't seen that particular one. I still think it's quite crazy to permanently lock an API from improving simply because people inherit. That's the cost of inheritance, and those who do so should be aware of what follows.
Even though it's an API addition (which would normally only warrant a minor version bump), if it strikes people has a backwards incompatible change, then push it with a major version.
This API is not going to change in v0.12 so I'm going to close this here. If a change needs to be made to the API, then the best place to pursue that is either nodejs/io.js or nodejs/node.
listenerCount
is currently a class method on EventEmitter, yet the very first argument is the emitter instance whose listenerCount should be returned. Why, then, is it a class method at all if it requires an instance on which to operate?I propose
EventEmitter.prototype.listenerCount
be added such that:The text was updated successfully, but these errors were encountered: