1313const {
1414 ArrayIsArray,
1515 Error,
16+ ErrorCaptureStackTrace,
1617 ErrorPrototypeToString,
1718 JSONStringify,
1819 Map,
@@ -302,8 +303,7 @@ function hideStackFrames(fn) {
302303function addCodeToName ( err , name , code ) {
303304 // Set the stack
304305 if ( excludedStackFn !== undefined ) {
305- // eslint-disable-next-line no-restricted-syntax
306- Error . captureStackTrace ( err , excludedStackFn ) ;
306+ ErrorCaptureStackTrace ( err , excludedStackFn ) ;
307307 }
308308 // Add the error code to the name to include it in the stack trace.
309309 err . name = `${ name } [${ code } ]` ;
@@ -439,9 +439,7 @@ function uvException(ctx) {
439439 if ( dest ) {
440440 err . dest = dest ;
441441 }
442-
443- // eslint-disable-next-line no-restricted-syntax
444- Error . captureStackTrace ( err , excludedStackFn || uvException ) ;
442+ ErrorCaptureStackTrace ( err , excludedStackFn || uvException ) ;
445443 return err ;
446444}
447445
@@ -482,9 +480,7 @@ function uvExceptionWithHostPort(err, syscall, address, port) {
482480 if ( port ) {
483481 ex . port = port ;
484482 }
485-
486- // eslint-disable-next-line no-restricted-syntax
487- Error . captureStackTrace ( ex , excludedStackFn || uvExceptionWithHostPort ) ;
483+ ErrorCaptureStackTrace ( ex , excludedStackFn || uvExceptionWithHostPort ) ;
488484 return ex ;
489485}
490486
@@ -511,9 +507,7 @@ function errnoException(err, syscall, original) {
511507 ex . errno = err ;
512508 ex . code = code ;
513509 ex . syscall = syscall ;
514-
515- // eslint-disable-next-line no-restricted-syntax
516- Error . captureStackTrace ( ex , excludedStackFn || errnoException ) ;
510+ ErrorCaptureStackTrace ( ex , excludedStackFn || errnoException ) ;
517511 return ex ;
518512}
519513
@@ -560,9 +554,7 @@ function exceptionWithHostPort(err, syscall, address, port, additional) {
560554 if ( port ) {
561555 ex . port = port ;
562556 }
563-
564- // eslint-disable-next-line no-restricted-syntax
565- Error . captureStackTrace ( ex , excludedStackFn || exceptionWithHostPort ) ;
557+ ErrorCaptureStackTrace ( ex , excludedStackFn || exceptionWithHostPort ) ;
566558 return ex ;
567559}
568560
@@ -606,9 +598,7 @@ function dnsException(code, syscall, hostname) {
606598 if ( hostname ) {
607599 ex . hostname = hostname ;
608600 }
609-
610- // eslint-disable-next-line no-restricted-syntax
611- Error . captureStackTrace ( ex , excludedStackFn || dnsException ) ;
601+ ErrorCaptureStackTrace ( ex , excludedStackFn || dnsException ) ;
612602 return ex ;
613603}
614604
0 commit comments