diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 6a774eb94465ba..a807732e484052 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -408,15 +408,6 @@ ObjectDefineProperties(CustomEvent.prototype, { detail: kEnumerableProperty, }); -class NodeCustomEvent extends Event { - constructor(type, options) { - super(type, options); - if (options?.detail) { - this.detail = options.detail; - } - } -} - // Weak listener cleanup // This has to be lazy for snapshots to work let weakListenersState = null; @@ -837,7 +828,7 @@ class EventTarget { } [kCreateEvent](nodeValue, type) { - return new NodeCustomEvent(type, { detail: nodeValue }); + return new CustomEvent(type, { detail: nodeValue }); } [customInspectSymbol](depth, options) { if (!isEventTarget(this))