Permalink
Browse files

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: #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>
  • Loading branch information...
addaleax committed Sep 2, 2018
1 parent 04060e3 commit c100d400bde53017931a7c93308e3293d50e21db
Showing with 8 additions and 4 deletions.
  1. +2 −0 src/node_options.cc
  2. +6 −4 test/parallel/test-cli-bad-options.js
View
@@ -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) {

0 comments on commit c100d40

Please sign in to comment.