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 bmeck committed Jun 22, 2024
1 parent 0f835c6 commit 3805a2c
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 3805a2c

Please sign in to comment.