★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/814d88a01aNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
console: fixup error message
Use "options.inspectOptions" instead of just "inspectOptions"

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #32475
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell authored and addaleax committed Mar 30, 2020
1 parent 8770fd9 commit 814d88a01a15655fd9ea34dbd3a93e35a5a9e024
Showing with 7 additions and 4 deletions.
  1. +5 −2 lib/internal/console/constructor.js
  2. +1 −1 test/parallel/test-console-instance.js
  3. +1 −1 test/parallel/test-console-tty-colors.js
@@ -110,11 +110,14 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
if (inspectOptions.colors !== undefined &&
options.colorMode !== undefined) {
throw new ERR_INCOMPATIBLE_OPTION_PAIR(
'inspectOptions.color', 'colorMode');
'options.inspectOptions.color', 'colorMode');
}
optionsMap.set(this, inspectOptions);
} else if (inspectOptions !== undefined) {
throw new ERR_INVALID_ARG_TYPE('inspectOptions', 'object', inspectOptions);
throw new ERR_INVALID_ARG_TYPE(
'options.inspectOptions',
'object',
inspectOptions);
}

// Bind the prototype functions to this Console instance
@@ -140,7 +140,7 @@ out.write = err.write = (d) => {};
});
},
{
message: 'The "inspectOptions" argument must be of type object.' +
message: 'The "options.inspectOptions" property must be of type object.' +
common.invalidArgTypeHelper(inspectOptions),
code: 'ERR_INVALID_ARG_TYPE'
}
@@ -86,7 +86,7 @@ check(false, false, false);
});
},
{
message: 'Option "inspectOptions.color" cannot be used in ' +
message: 'Option "options.inspectOptions.color" cannot be used in ' +
'combination with option "colorMode"',
code: 'ERR_INCOMPATIBLE_OPTION_PAIR'
}

0 comments on commit 814d88a

Please sign in to comment.