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) {
335
335
} else if ( ! doError )
336
336
return false ;
337
337
338
- const domain = this . domain ;
339
-
340
338
// If there is no 'error' event listener then throw.
341
339
if ( doError ) {
342
340
let er ;
343
341
if ( args . length > 0 )
344
342
er = args [ 0 ] ;
345
- if ( domain ) {
343
+ if ( this . domain ) {
346
344
if ( ! er ) {
347
345
er = new ERR_UNHANDLED_ERROR ( ) ;
348
346
}
349
347
if ( typeof er === 'object' ) {
350
348
er . domainEmitter = this ;
351
- er . domain = domain ;
349
+ er . domain = this . domain ;
352
350
er . domainThrown = false ;
353
351
}
354
- domain . emit ( 'error' , er ) ;
352
+ this . domain . emit ( 'error' , er ) ;
355
353
} else if ( er instanceof Error ) {
356
354
try {
357
355
const capture = { } ;
@@ -389,8 +387,8 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
389
387
return false ;
390
388
391
389
let needDomainExit = false ;
392
- if ( domain && this !== process ) {
393
- domain . enter ( ) ;
390
+ if ( this . domain && this !== process ) {
391
+ this . domain . enter ( ) ;
394
392
needDomainExit = true ;
395
393
}
396
394
@@ -421,7 +419,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
421
419
}
422
420
423
421
if ( needDomainExit )
424
- domain . exit ( ) ;
422
+ this . domain . exit ( ) ;
425
423
426
424
return true ;
427
425
} ;
You can’t perform that action at this time.
0 commit comments