Skip to content

EventTarget is not DOM spec Compliant #54617

@avivkeller

Description

@avivkeller

While Node.js's node:events module provides similar functionality to chromium, it does not comply with the DOM spec.

Consider the following code snippet:

const target = new EventTarget();
const event = new Event('foo');
target.dispatchEvent(event);
console.log(event.currentTarget);

In Node.js (and Chromium), this code will log EventTarget {}. However, in other engines and browsers, it will log null. As a result, Node.js may not be fully compliant with EventTarget-constructible.any.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    eventsIssues and PRs related to the events subsystem / EventEmitter.web-standardsIssues and PRs related to Web APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions