From 302cc9e92c2e9a2154bef568d4fa2e7e9f64e05e Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Mon, 27 Jul 2020 18:53:13 -0300 Subject: [PATCH 1/3] debugger: add usage example for `--port` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/38400 Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/internal/inspector/_inspect.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/inspector/_inspect.js b/lib/internal/inspector/_inspect.js index b326a772fd39c9..dcfa74aed3efb9 100644 --- a/lib/internal/inspector/_inspect.js +++ b/lib/internal/inspector/_inspect.js @@ -340,6 +340,7 @@ function startInspect(argv = process.argv.slice(2), console.error(`Usage: ${invokedAs} script.js`); console.error(` ${invokedAs} :`); + console.error(` ${invokedAs} --port=`); console.error(` ${invokedAs} -p `); process.exit(1); } From 01e0e3212d6b446b7bd5504c7775f2f2b66fd113 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 19 Sep 2020 09:01:00 -0700 Subject: [PATCH 2/3] debugger: align message with Node.js standard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Node.js uses (or will use) _Ctrl+C_ with no spaces. To unify the messages from inspect with other messages from the REPL and elsewhere, make that change in node-inspect too. PR-URL: https://github.com/nodejs/node/pull/38400 Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/internal/inspector/inspect_repl.js | 4 ++-- test/inspector-cli/test-inspector-cli-exec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 32ee1c3f8c31ba..840ef101c77e34 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -1027,7 +1027,7 @@ function createRepl(inspector) { repl.setPrompt('> '); - print('Press Ctrl + C to leave debug repl'); + print('Press Ctrl+C to leave debug repl'); repl.displayPrompt(); }, @@ -1096,7 +1096,7 @@ function createRepl(inspector) { repl.on('reset', initializeContext); repl.defineCommand('interrupt', () => { - // We want this for testing purposes where sending CTRL-C can be tricky. + // We want this for testing purposes where sending Ctrl+C can be tricky. repl.emit('SIGINT'); }); diff --git a/test/inspector-cli/test-inspector-cli-exec.js b/test/inspector-cli/test-inspector-cli-exec.js index 15e7e212cf2466..f47eaaa5a6f62d 100644 --- a/test/inspector-cli/test-inspector-cli-exec.js +++ b/test/inspector-cli/test-inspector-cli-exec.js @@ -31,7 +31,7 @@ const assert = require('assert'); .then(() => { assert.match( cli.output, - /Press Ctrl \+ C to leave debug repl\n+> /, + /Press Ctrl\+C to leave debug repl\n+> /, 'shows hint for how to leave repl'); assert.doesNotMatch(cli.output, /debug>/, 'changes the repl style'); }) From 751d215eb8334bff0e50b7a379b55180870b7f5c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 11 Dec 2020 07:40:36 -0800 Subject: [PATCH 3/3] debugger: remove unused function argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `{colors: true}` removed here is ignored by the function it is being sent to. PR-URL: https://github.com/nodejs/node/pull/38400 Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/internal/inspector/inspect_repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 840ef101c77e34..4827ad1f914c86 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -581,7 +581,7 @@ function createRepl(inspector) { const lines = watchedExpressions .map((expr, idx) => { const prefix = `${leftPad(idx, ' ', lastIndex)}: ${expr} =`; - const value = inspect(values[idx], { colors: true }); + const value = inspect(values[idx]); if (value.indexOf('\n') === -1) { return `${prefix} ${value}`; }