From c432ab13918c087597ecfcdf137cc4fd319c05e7 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 7 Jul 2019 12:44:07 -0400 Subject: [PATCH] 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 Reviewed-By: Franziska Hinkelmann Reviewed-By: Rich Trott --- src/node_options.cc | 9 ++------- 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 59b474166150ad..8666de948b6b3a 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -34,17 +34,12 @@ void DebugOptions::CheckOptions(std::vector* 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 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 ae051b92ceda23..846a46a429ff73 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,