diff options
Diffstat (limited to 'lib/internal/process/warning.js')
-rw-r--r-- | lib/internal/process/warning.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 8c0a503239..a970b622c8 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -122,9 +122,9 @@ function setupProcessWarnings() { code = undefined; } if (code !== undefined && typeof code !== 'string') - throw new ERR_INVALID_ARG_TYPE('code', 'string'); + throw new ERR_INVALID_ARG_TYPE('code', 'string', code); if (type !== undefined && typeof type !== 'string') - throw new ERR_INVALID_ARG_TYPE('type', 'string'); + throw new ERR_INVALID_ARG_TYPE('type', 'string', type); if (warning === undefined || typeof warning === 'string') { // eslint-disable-next-line no-restricted-syntax warning = new Error(warning); @@ -134,7 +134,7 @@ function setupProcessWarnings() { Error.captureStackTrace(warning, ctor || process.emitWarning); } if (!(warning instanceof Error)) { - throw new ERR_INVALID_ARG_TYPE('warning', ['Error', 'string']); + throw new ERR_INVALID_ARG_TYPE('warning', ['Error', 'string'], warning); } if (warning.name === 'DeprecationWarning') { if (process.noDeprecation) |