From 7480edae63648d93518c55816903d9a30cd9ab00 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Tue, 10 Dec 2024 00:41:55 -0800 Subject: [PATCH] another test-event-emitter-method-names.js fix --- src/js/node/events.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/node/events.ts b/src/js/node/events.ts index e5cfaaee017e7b..462de72833f68a 100644 --- a/src/js/node/events.ts +++ b/src/js/node/events.ts @@ -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) : []; @@ -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") {