src: simplify DEP0062 logic

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: https://github.com/nodejs/node/pull/28589
Fixes: https://github.com/nodejs/node/issues/28588
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
pull/28589/head
cjihrig 2019-07-07 12:44:07 -04:00
parent 012ed4910f
commit b851469855
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
2 changed files with 3 additions and 8 deletions

View File

@ -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;

View File

@ -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,