File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 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;
400400EventEmitter . prototype . emit = function emit ( ...args ) {
401401 const domain = this . domain ;
402402 if ( domain === null || domain === undefined || this === process ) {
403- return eventEmit . apply ( this , args ) ;
403+ return Reflect . apply ( eventEmit , this , args ) ;
404404 }
405405
406406 const type = args [ 0 ] ;
@@ -415,7 +415,7 @@ EventEmitter.prototype.emit = function emit(...args) {
415415
416416 domain . enter ( ) ;
417417 try {
418- return eventEmit . apply ( this , args ) ;
418+ return Reflect . apply ( eventEmit , this , args ) ;
419419 } catch ( er ) {
420420 if ( typeof er === 'object' && er !== null ) {
421421 er . domainEmitter = this ;
Original file line number Diff line number Diff line change @@ -123,12 +123,12 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
123123 return false ;
124124
125125 if ( typeof handler === 'function' ) {
126- handler . apply ( this , args ) ;
126+ Reflect . apply ( handler , this , args ) ;
127127 } else {
128128 const len = handler . length ;
129129 const listeners = arrayClone ( handler , len ) ;
130130 for ( var i = 0 ; i < len ; ++ i )
131- listeners [ i ] . apply ( this , args ) ;
131+ Reflect . apply ( listeners [ i ] , this , args ) ;
132132 }
133133
134134 return true ;
@@ -215,7 +215,7 @@ function onceWrapper(...args) {
215215 if ( ! this . fired ) {
216216 this . target . removeListener ( this . type , this . wrapFn ) ;
217217 this . fired = true ;
218- this . listener . apply ( this . target , args ) ;
218+ Reflect . apply ( this . listener , this . target , args ) ;
219219 }
220220}
221221
You can’t perform that action at this time.
0 commit comments