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
Environment
N/A
Reproduction
N/A
Describe the bug
In NodeJS
EventEmitteris a plain function (https://github.com/nodejs/node/blob/793c7936c394aba54875f84b135684e38a30ff94/lib/events.js#L208-L210), hence it can be invoked without thenewkeyword. unenv needs to have the same behavior to be a faithful polyfill.Additional context
This has caused the following bugs:
Logs