Emitter.removeAllListeners

fix(std/node): emitter.removeAllListeners (#5583)
Emitter.removeAllListenersfixemitter removealllisteners std node

Committed by blairzhao111

commit message
fix(std/node): emitter.removeAllListeners (#5583)

When given a non-registered eventName to 
emitter.removeAllListeners(eventName), current code 
would remove all listeners instead of silently skip, 
which is not ideal.

Editor assessment

The subject is just a method name, emitter.removeAllListeners, which identifies the location but asserts nothing about the defect; the body must carry the explanation, and it does describe the wrong behavior - an unregistered event name removing all listeners instead of being skipped - though the closing verdict which is not ideal is weak. The std/node scope and fix type are right. Understandable overall, but the subject does no communicative work. A subject stating the corrected behavior - skip unregistered names rather than purge everything - would have relieved the body of all the work.

Browse categories

More fix examples · Back to search