Skip to content

Commit

Permalink
events: replace NodeCustomEvent with CustomEvent
Browse files Browse the repository at this point in the history
PR-URL: #43876
Refs: #43514
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
F3n67u authored and marco-ippolito committed Jun 17, 2024
1 parent 086626f commit 75dd009
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,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;
Expand Down Expand Up @@ -841,7 +832,7 @@ class EventTarget {
}

[kCreateEvent](nodeValue, type) {
return new NodeCustomEvent(type, { detail: nodeValue });
return new CustomEvent(type, { detail: nodeValue });
}
[customInspectSymbol](depth, options) {
if (!isEventTarget(this))
Expand Down

0 comments on commit 75dd009

Please sign in to comment.