Skip to content

Commit 7908415

Browse files
jasnelltargos
authored andcommittedApr 22, 2020
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>
1 parent b85bc0c commit 7908415

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed
 

‎lib/internal/console/constructor.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
104104
if (inspectOptions.colors !== undefined &&
105105
options.colorMode !== undefined) {
106106
throw new ERR_INCOMPATIBLE_OPTION_PAIR(
107-
'inspectOptions.color', 'colorMode');
107+
'options.inspectOptions.color', 'colorMode');
108108
}
109109
optionsMap.set(this, inspectOptions);
110110
} else if (inspectOptions !== undefined) {
111-
throw new ERR_INVALID_ARG_TYPE('inspectOptions', 'object', inspectOptions);
111+
throw new ERR_INVALID_ARG_TYPE(
112+
'options.inspectOptions',
113+
'object',
114+
inspectOptions);
112115
}
113116

114117
// Bind the prototype functions to this Console instance

‎test/parallel/test-console-instance.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ out.write = err.write = (d) => {};
140140
});
141141
},
142142
{
143-
message: 'The "inspectOptions" argument must be of type object.' +
143+
message: 'The "options.inspectOptions" property must be of type object.' +
144144
common.invalidArgTypeHelper(inspectOptions),
145145
code: 'ERR_INVALID_ARG_TYPE'
146146
}

‎test/parallel/test-console-tty-colors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ check(false, false, false);
8686
});
8787
},
8888
{
89-
message: 'Option "inspectOptions.color" cannot be used in ' +
89+
message: 'Option "options.inspectOptions.color" cannot be used in ' +
9090
'combination with option "colorMode"',
9191
code: 'ERR_INCOMPATIBLE_OPTION_PAIR'
9292
}

0 commit comments

Comments
 (0)
Please sign in to comment.