Closed
Description
- Version: 10.1.0, 10.2.0, 11.0.0-pre
- Platform: Darwin (), maybe all platforms
- Subsystem:
const {Socket} = require('net')
const s = new Socket
s.on('data', () => {
})
s.removeAllListeners()
s.listenerCount('data') // 0 expected, but got 1
If there is no arguments for stream::removeAllListeners()
, the argument to be passed into Stream.prototype.removeAllListeners
will be undefined
, see here
The undefined
value causes that the events::removeAllListeners(undefined)
will do nothing. see here