console: fixup error message

Use "options.inspectOptions" instead of just "inspectOptions"

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

PR-URL: https://github.com/nodejs/node/pull/32475
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
James M Snell authored and Michaël Zasso committed 2020-04-22 18:27:02 +02:00
1 parent b85bc0cc02
commit 790841597d
3 files changed
+7 -4

No files matched your search

+5 -2
View File
@@ -104,11 +104,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
+1 -1
View File
@@ -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'
}
+1 -1
View File
@@ -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'
}