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 targos committed May 12, 2024
1 parent e0148e2 commit 5ee6924
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 5ee6924

Please sign in to comment.