From e93507dceba6c5827d6acc41bee053f3ed1d8c38 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 24 Mar 2020 15:17:02 -0700 Subject: [PATCH 1/2] console: fixup error message Use "options.inspectOptions" instead of just "inspectOptions" Signed-off-by: James M Snell --- lib/internal/console/constructor.js | 7 +++++-- test/parallel/test-console-instance.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index f1ba8fbbd7c7e6..dc8dcaa1d054ed 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.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 diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index 19c4271d243ea7..bf22314e22e031 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -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' } From 9fdae2fbfa8603165780dbda5cd02f9c7f5e3ea8 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 25 Mar 2020 09:54:44 -0700 Subject: [PATCH 2/2] fixup! console: fixup error message --- test/parallel/test-console-tty-colors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-console-tty-colors.js b/test/parallel/test-console-tty-colors.js index 41e72c3c8513bc..e906c71c186177 100644 --- a/test/parallel/test-console-tty-colors.js +++ b/test/parallel/test-console-tty-colors.js @@ -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' }