lib: validate Error.captureStackTrace() calls · nodejs/node@3fe1e80 (original) (raw)

Original file line number Diff line number Diff line change
@@ -354,6 +354,7 @@ function uvException(ctx) {
354 354 err.dest = dest;
355 355 }
356 356
357 +// eslint-disable-next-line no-restricted-syntax
357 358 Error.captureStackTrace(err, excludedStackFn |
358 359 return err;
359 360 }
@@ -396,6 +397,7 @@ function uvExceptionWithHostPort(err, syscall, address, port) {
396 397 ex.port = port;
397 398 }
398 399
400 +// eslint-disable-next-line no-restricted-syntax
399 401 Error.captureStackTrace(ex, excludedStackFn |
400 402 return ex;
401 403 }
@@ -424,6 +426,7 @@ function errnoException(err, syscall, original) {
424 426 ex.code = ex.errno = code;
425 427 ex.syscall = syscall;
426 428
429 +// eslint-disable-next-line no-restricted-syntax
427 430 Error.captureStackTrace(ex, excludedStackFn |
428 431 return ex;
429 432 }
@@ -472,6 +475,7 @@ function exceptionWithHostPort(err, syscall, address, port, additional) {
472 475 ex.port = port;
473 476 }
474 477
478 +// eslint-disable-next-line no-restricted-syntax
475 479 Error.captureStackTrace(ex, excludedStackFn |
476 480 return ex;
477 481 }
@@ -512,6 +516,7 @@ function dnsException(code, syscall, hostname) {
512 516 ex.hostname = hostname;
513 517 }
514 518
519 +// eslint-disable-next-line no-restricted-syntax
515 520 Error.captureStackTrace(ex, excludedStackFn |
516 521 return ex;
517 522 }