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:
consttarget=newEventTarget();constevent=newEvent('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.
While Node.js's
node:eventsmodule provides similar functionality to chromium, it does not comply with the DOM spec.Consider the following code snippet:
In Node.js (and Chromium), this code will log
EventTarget {}. However, in other engines and browsers, it will lognull. As a result, Node.js may not be fully compliant withEventTarget-constructible.any.js.