Skip to content

Commit

Permalink
another test-event-emitter-method-names.js fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Dec 10, 2024
1 parent 6afbc46 commit 7480eda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/node/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ EventEmitterPrototype.listenerCount = function listenerCount(type) {
if (!events) return 0;
return events[type]?.length ?? 0;
};
Object.defineProperty(EventEmitterPrototype.listenerCount, "name", { value: "listenerCount" });

EventEmitterPrototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
Expand Down Expand Up @@ -612,6 +613,7 @@ function listenerCount(emitter, type) {

return jsEventTargetGetEventListenersCount(emitter, type);
}
Object.defineProperty(listenerCount, "name", { value: "listenerCount" });

function eventTargetAgnosticRemoveListener(emitter, name, listener, flags) {
if (typeof emitter.removeListener === "function") {
Expand Down

0 comments on commit 7480eda

Please sign in to comment.