diff options
author | cjihrig <cjihrig@gmail.com> | 2019-07-07 12:44:07 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-07-09 16:50:59 -0400 |
commit | b851469855862f5fd1e5da38bbcd944c9987cd02 (patch) | |
tree | 3c0aa1b015a6b23f08b117c1527d3aae60946745 | |
parent | 012ed4910ff66a349568ad7b7d3dcf3e894888c4 (diff) | |
download | android-node-v8-b851469855862f5fd1e5da38bbcd944c9987cd02.tar.gz android-node-v8-b851469855862f5fd1e5da38bbcd944c9987cd02.tar.bz2 android-node-v8-b851469855862f5fd1e5da38bbcd944c9987cd02.zip |
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>
-rw-r--r-- | src/node_options.cc | 9 | ||||
-rw-r--r-- | test/sequential/test-inspector-invalid-args.js | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/node_options.cc b/src/node_options.cc index beb272d146..b118d69525 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -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; diff --git a/test/sequential/test-inspector-invalid-args.js b/test/sequential/test-inspector-invalid-args.js index ae051b92ce..846a46a429 100644 --- a/test/sequential/test-inspector-invalid-args.js +++ b/test/sequential/test-inspector-invalid-args.js @@ -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, |