From d0560a81adbb3bf1001a430e90460cd9f4f43bd0 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Sun, 17 Jul 2022 19:45:27 +0800 Subject: [PATCH] events: replace NodeCustomEvent with CustomEvent --- lib/internal/event_target.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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))