diff --git a/lib/events.js b/lib/events.js index f6e4996d20b40f..1356806f6544c3 100644 --- a/lib/events.js +++ b/lib/events.js @@ -22,6 +22,7 @@ 'use strict'; const { Math, Object, Reflect } = primordials; +const apply = Reflect.apply; var spliceOne; @@ -206,12 +207,12 @@ EventEmitter.prototype.emit = function emit(type, ...args) { return false; if (typeof handler === 'function') { - Reflect.apply(handler, this, args); + apply(handler, this, args); } else { const len = handler.length; const listeners = arrayClone(handler, len); for (var i = 0; i < len; ++i) - Reflect.apply(listeners[i], this, args); + apply(listeners[i], this, args); } return true;