File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ const eventEmit = EventEmitter.prototype.emit;
400
400
EventEmitter . prototype . emit = function emit ( ...args ) {
401
401
const domain = this . domain ;
402
402
if ( domain === null || domain === undefined || this === process ) {
403
- return eventEmit . apply ( this , args ) ;
403
+ return Reflect . apply ( eventEmit , this , args ) ;
404
404
}
405
405
406
406
const type = args [ 0 ] ;
@@ -415,7 +415,7 @@ EventEmitter.prototype.emit = function emit(...args) {
415
415
416
416
domain . enter ( ) ;
417
417
try {
418
- return eventEmit . apply ( this , args ) ;
418
+ return Reflect . apply ( eventEmit , this , args ) ;
419
419
} catch ( er ) {
420
420
if ( typeof er === 'object' && er !== null ) {
421
421
er . domainEmitter = this ;
Original file line number Diff line number Diff line change @@ -124,12 +124,12 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
124
124
return false ;
125
125
126
126
if ( typeof handler === 'function' ) {
127
- handler . apply ( this , args ) ;
127
+ Reflect . apply ( handler , this , args ) ;
128
128
} else {
129
129
const len = handler . length ;
130
130
const listeners = arrayClone ( handler , len ) ;
131
131
for ( var i = 0 ; i < len ; ++ i )
132
- listeners [ i ] . apply ( this , args ) ;
132
+ Reflect . apply ( listeners [ i ] , this , args ) ;
133
133
}
134
134
135
135
return true ;
@@ -216,7 +216,7 @@ function onceWrapper(...args) {
216
216
if ( ! this . fired ) {
217
217
this . target . removeListener ( this . type , this . wrapFn ) ;
218
218
this . fired = true ;
219
- this . listener . apply ( this . target , args ) ;
219
+ Reflect . apply ( this . listener , this . target , args ) ;
220
220
}
221
221
}
222
222
You can’t perform that action at this time.
0 commit comments