镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

stream: Readable().removeAllListeners() not work #20923

Description

@kaelzhang
  • 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

Activity

  1. apapirovski commented on May 24, 2018

    @apapirovski
    Contributor

    @kaelzhang Looks like a bug indeed. Feel free to open a PR if you would like or if not, hopefully someone else will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions