src: disable debug options when inspector is unavailable
This fixes `parallel/test-cli-node-print-help` when Node.js is compiled without the inspector. PR-URL: https://github.com/nodejs/node/pull/22657 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
This commit is contained in:
parent
04060e35b1
commit
c100d400bd
@ -23,6 +23,7 @@ namespace options_parser {
|
||||
// TODO(addaleax): Make that unnecessary.
|
||||
|
||||
DebugOptionsParser::DebugOptionsParser() {
|
||||
#if HAVE_INSPECTOR
|
||||
AddOption("--inspect-port",
|
||||
"set host:port for inspector",
|
||||
&DebugOptions::host_port,
|
||||
@ -52,6 +53,7 @@ DebugOptionsParser::DebugOptionsParser() {
|
||||
AddOption("--debug-brk", "", &DebugOptions::break_first_line);
|
||||
Implies("--debug-brk", "--debug");
|
||||
AddAlias("--debug-brk=", { "--inspect-port", "--debug-brk" });
|
||||
#endif
|
||||
}
|
||||
|
||||
DebugOptionsParser DebugOptionsParser::instance;
|
||||
|
@ -6,10 +6,12 @@ require('../common');
|
||||
const assert = require('assert');
|
||||
const spawn = require('child_process').spawnSync;
|
||||
|
||||
requiresArgument('--inspect-port');
|
||||
requiresArgument('--inspect-port=');
|
||||
requiresArgument('--debug-port');
|
||||
requiresArgument('--debug-port=');
|
||||
if (process.config.variables.v8_enable_inspector === 1) {
|
||||
requiresArgument('--inspect-port');
|
||||
requiresArgument('--inspect-port=');
|
||||
requiresArgument('--debug-port');
|
||||
requiresArgument('--debug-port=');
|
||||
}
|
||||
requiresArgument('--eval');
|
||||
|
||||
function requiresArgument(option) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user