Skip to content

Commit

Permalink
src: simplify DEP0062 logic
Browse files Browse the repository at this point in the history
This commit simplifies the DEP0062 error logic. Instead of
looking for certain combinations of flags, just show an error
for any usage of --debug or --debug-brk.

PR-URL: #28589
Fixes: #28588
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Jul 20, 2019
1 parent 608d6ed commit c432ab1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
}
#endif

if (deprecated_debug && !inspector_enabled) {
if (deprecated_debug) {
errors->push_back("[DEP0062]: `node --debug` and `node --debug-brk` "
"are invalid. Please use `node --inspect` or "
"are invalid. Please use `node --inspect` and "
"`node --inspect-brk` instead.");
}

if (deprecated_debug && inspector_enabled && break_first_line) {
errors->push_back("[DEP0062]: `node --inspect --debug-brk` is deprecated. "
"Please use `node --inspect-brk` instead.");
}

std::vector<std::string> destinations =
SplitString(inspect_publish_uid_string, ',');
inspect_publish_uid.console = false;
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-inspector-invalid-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const execFile = require('child_process').execFile;
const mainScript = fixtures.path('loop.js');
const expected =
'`node --debug` and `node --debug-brk` are invalid. ' +
'Please use `node --inspect` or `node --inspect-brk` instead.';
'Please use `node --inspect` and `node --inspect-brk` instead.';
for (const invalidArg of ['--debug-brk', '--debug']) {
execFile(
process.execPath,
Expand Down

0 comments on commit c432ab1

Please sign in to comment.