Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
events: fix removeListener for Symbols
Fix removeListener when eventName type is 'symbol'. ```js const EventEmitter = require('events'); const myEmitter = new EventEmitter(); const sym = Symbol('symbol'); const fn = () => { }; myEmitter.on(sym, fn); myEmitter.on('removeListener', (...args) => { console.log('removeListener'); console.log(args, args[0] === sym, args[1] === fn); }); myEmitter.removeAllListeners() ``` When the listener's eventName type is 'symbol' and removeListener is called with no parameters, removeListener should be emitted. PR-URL: #31847 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information