Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

emitter.listeners('ev') should return a copy, not the actual array #3442

@isaacs

Description

@isaacs

It makes a lot of headaches in many edge cases to expose a reference to the listeners array.

It would be better if emitter.listeners('ev') returned a copy of the array, not the actual thing. Then we could change it, without worrying about consistency guarantees or breaking userland code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions