Skip to content

Commit

Permalink
events: replace NodeCustomEvent with CustomEvent
Browse files Browse the repository at this point in the history
PR-URL: nodejs#43876
Refs: nodejs#43514
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
F3n67u authored and eliphazbouye committed Jun 20, 2024
1 parent 064970a commit 2714746
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 @@ -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;
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 2714746

Please sign in to comment.