evt listener count judgement by `handlers.fn` may got wrong results
SunGuoQiang123 opened this issue · comments
SunGuoQiang123 commented
if someone makes some changes like Array.prototype.fn = function() {}
, then the judgement for the event listener count may get wrong results when the event have more than one listeners
Array.prototype.fn = function() {};
const em = new EventEmitter();
em.on('test', a => a);
em.on('test', a => console.log(a));
console.log(em.listenerCount('test'));
not sure if this is necessary because this is very rare to happen, if so, just close this issue
Luigi Pinca commented
Yes, I don't think this is a problem. Changing the prototype of standard, built-in objects, is not common and recommended.