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>
This commit is contained in:
parent
012ed4910f
commit
b851469855
@ -34,17 +34,12 @@ void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (deprecated_debug && !inspector_enabled) {
|
if (deprecated_debug) {
|
||||||
errors->push_back("[DEP0062]: `node --debug` and `node --debug-brk` "
|
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.");
|
"`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 =
|
std::vector<std::string> destinations =
|
||||||
SplitString(inspect_publish_uid_string, ',');
|
SplitString(inspect_publish_uid_string, ',');
|
||||||
inspect_publish_uid.console = false;
|
inspect_publish_uid.console = false;
|
||||||
|
@ -10,7 +10,7 @@ const execFile = require('child_process').execFile;
|
|||||||
const mainScript = fixtures.path('loop.js');
|
const mainScript = fixtures.path('loop.js');
|
||||||
const expected =
|
const expected =
|
||||||
'`node --debug` and `node --debug-brk` are invalid. ' +
|
'`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']) {
|
for (const invalidArg of ['--debug-brk', '--debug']) {
|
||||||
execFile(
|
execFile(
|
||||||
process.execPath,
|
process.execPath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user