diff options
author | cjihrig <cjihrig@gmail.com> | 2019-01-20 17:43:53 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-01-22 17:58:51 -0500 |
commit | a0223378b2d2051e7ae05f6e336a56ad53a4635a (patch) | |
tree | 767028297b10ac5cd77ce91759ed355d96ed6e33 /src/node_options.cc | |
parent | 5003314e5ac04bc02aa469b5de1878bbb5b918e2 (diff) | |
download | android-node-v8-a0223378b2d2051e7ae05f6e336a56ad53a4635a.tar.gz android-node-v8-a0223378b2d2051e7ae05f6e336a56ad53a4635a.tar.bz2 android-node-v8-a0223378b2d2051e7ae05f6e336a56ad53a4635a.zip |
report: simplify option checking
Also update the code for house style.
PR-URL: https://github.com/nodejs/node/pull/25597
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'src/node_options.cc')
-rw-r--r-- | src/node_options.cc | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/node_options.cc b/src/node_options.cc index a3a5e0233a..6d141f52aa 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -36,29 +36,45 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) { void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) { per_env->CheckOptions(errors); #ifdef NODE_REPORT - if (!report_directory.empty() && !per_env->experimental_report) + if (per_env->experimental_report) + return; + + if (!report_directory.empty()) { errors->push_back("--diagnostic-report-directory option is valid only when " "--experimental-report is set"); - if (!report_filename.empty() && !per_env->experimental_report) + } + + if (!report_filename.empty()) { errors->push_back("--diagnostic-report-filename option is valid only when " "--experimental-report is set"); - if (!report_signal.empty() && !per_env->experimental_report) + } + + if (!report_signal.empty()) { errors->push_back("--diagnostic-report-signal option is valid only when " "--experimental-report is set"); - if (report_on_fatalerror && !per_env->experimental_report) + } + + if (report_on_fatalerror) { errors->push_back( "--diagnostic-report-on-fatalerror option is valid only when " "--experimental-report is set"); - if (report_on_signal && !per_env->experimental_report) + } + + if (report_on_signal) { errors->push_back("--diagnostic-report-on-signal option is valid only when " "--experimental-report is set"); - if (report_uncaught_exception && !per_env->experimental_report) + } + + if (report_uncaught_exception) { errors->push_back( "--diagnostic-report-uncaught-exception option is valid only when " "--experimental-report is set"); - if (report_verbose && !per_env->experimental_report) + } + + if (report_verbose) { errors->push_back("--diagnostic-report-verbose option is valid only when " "--experimental-report is set"); + } #endif // NODE_REPORT } |