Skip to content

EventEmitter should not require the new keyword to invoke #552

Description

@jeswr

Environment

N/A

Reproduction

N/A

Describe the bug

In NodeJS EventEmitter is a plain function (https://github.com/nodejs/node/blob/793c7936c394aba54875f84b135684e38a30ff94/lib/events.js#L208-L210), hence it can be invoked without the new keyword. unenv needs to have the same behavior to be a faithful polyfill.

Additional context

This has caused the following bugs:

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions