summaryrefslogtreecommitdiff
path: root/lib/events.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events.js')
-rw-r--r--lib/events.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/events.js b/lib/events.js
index f6e4996d20..1356806f65 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;