File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -335,23 +335,21 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
335335 } else if ( ! doError )
336336 return false ;
337337
338- const domain = this . domain ;
339-
340338 // If there is no 'error' event listener then throw.
341339 if ( doError ) {
342340 let er ;
343341 if ( args . length > 0 )
344342 er = args [ 0 ] ;
345- if ( domain ) {
343+ if ( this . domain ) {
346344 if ( ! er ) {
347345 er = new ERR_UNHANDLED_ERROR ( ) ;
348346 }
349347 if ( typeof er === 'object' ) {
350348 er . domainEmitter = this ;
351- er . domain = domain ;
349+ er . domain = this . domain ;
352350 er . domainThrown = false ;
353351 }
354- domain . emit ( 'error' , er ) ;
352+ this . domain . emit ( 'error' , er ) ;
355353 } else if ( er instanceof Error ) {
356354 try {
357355 const capture = { } ;
@@ -389,8 +387,8 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
389387 return false ;
390388
391389 let needDomainExit = false ;
392- if ( domain && this !== process ) {
393- domain . enter ( ) ;
390+ if ( this . domain && this !== process ) {
391+ this . domain . enter ( ) ;
394392 needDomainExit = true ;
395393 }
396394
@@ -421,7 +419,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
421419 }
422420
423421 if ( needDomainExit )
424- domain . exit ( ) ;
422+ this . domain . exit ( ) ;
425423
426424 return true ;
427425} ;
You can’t perform that action at this time.
0 commit comments