diff --git a/lib/events.js b/lib/events.js index 7103ec393fca73..f0881fef470310 100644 --- a/lib/events.js +++ b/lib/events.js @@ -437,12 +437,7 @@ function listenerCount(type) { } EventEmitter.prototype.eventNames = function eventNames() { - if (this._eventsCount > 0) { - const events = this._events; - return Object.keys(events).concat( - Object.getOwnPropertySymbols(events)); - } - return []; + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; }; // About 1.5x faster than the two-arg version of Array#splice().