Skip to content

domain: should variable domain in EventEmitter be private #34720

Open
@cuijinyu

Description

@cuijinyu
  • version: Node v10.5:
  • platform: Darwin Kernel Version 19.3.0:
  • core module name: domain:

What steps will reproduce the bug?

The domain module overwrites the EventEmitter and mounts the domain on the EventEmitter. This causes a problem. If a third-party library mounts a variable named domain on the EventEmitter and introduces the domain module at the same time, it will cause an error.
We use the request library, which mounts the request body on EventEmitter. There is a domain field in our request body, and there is an error of domain.enter is not a function (domain is overwritten as a string at this time)

How often does it reproduce? Is there a required condition?

  1. Import domain
  2. Inherit the EventEmitter class
  3. There is a variable named domain

What is the expected behavior?

domain should be private

What do you see instead?

image

Additional information

I see that the domain module no longer accepts PRs, can I submit a PR for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    domainIssues and PRs related to the domain subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions