Skip to content
Permalink
Browse files

report: simplify option checking

Also update the code for house style.

PR-URL: #25597
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
  • Loading branch information...
cjihrig authored and targos committed Jan 20, 2019
1 parent c598d98 commit a02b62131242a65c4040f9b81c3a92b1d93b5d3a
Showing with 23 additions and 7 deletions.
  1. +23 −7 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
}

0 comments on commit a02b621

Please sign in to comment.
You can’t perform that action at this time.