We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 170862e commit edd7c57Copy full SHA for edd7c57
lib/events.js
@@ -22,6 +22,7 @@
22
'use strict';
23
24
const { Math, Object, Reflect } = primordials;
25
+const apply = Reflect.apply;
26
27
var spliceOne;
28
@@ -206,12 +207,12 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
206
207
return false;
208
209
if (typeof handler === 'function') {
- Reflect.apply(handler, this, args);
210
+ apply(handler, this, args);
211
} else {
212
const len = handler.length;
213
const listeners = arrayClone(handler, len);
214
for (var i = 0; i < len; ++i)
- Reflect.apply(listeners[i], this, args);
215
+ apply(listeners[i], this, args);
216
}
217
218
return true;
0 commit comments