Skip to content

Commit c432ab1

Browse files
cjihrigtargos
authored andcommitted
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: #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>
1 parent 608d6ed commit c432ab1

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/node_options.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,12 @@ void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
3434
}
3535
#endif
3636

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

43-
if (deprecated_debug && inspector_enabled && break_first_line) {
44-
errors->push_back("[DEP0062]: `node --inspect --debug-brk` is deprecated. "
45-
"Please use `node --inspect-brk` instead.");
46-
}
47-
4843
std::vector<std::string> destinations =
4944
SplitString(inspect_publish_uid_string, ',');
5045
inspect_publish_uid.console = false;

test/sequential/test-inspector-invalid-args.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const execFile = require('child_process').execFile;
1010
const mainScript = fixtures.path('loop.js');
1111
const expected =
1212
'`node --debug` and `node --debug-brk` are invalid. ' +
13-
'Please use `node --inspect` or `node --inspect-brk` instead.';
13+
'Please use `node --inspect` and `node --inspect-brk` instead.';
1414
for (const invalidArg of ['--debug-brk', '--debug']) {
1515
execFile(
1616
process.execPath,

0 commit comments

Comments
 (0)