Skip to content

Commit a02b621

Browse files
cjihrigtargos
authored andcommitted
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>
1 parent c598d98 commit a02b621

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

src/node_options.cc

+23-7
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,45 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) {
3636
void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
3737
per_env->CheckOptions(errors);
3838
#ifdef NODE_REPORT
39-
if (!report_directory.empty() && !per_env->experimental_report)
39+
if (per_env->experimental_report)
40+
return;
41+
42+
if (!report_directory.empty()) {
4043
errors->push_back("--diagnostic-report-directory option is valid only when "
4144
"--experimental-report is set");
42-
if (!report_filename.empty() && !per_env->experimental_report)
45+
}
46+
47+
if (!report_filename.empty()) {
4348
errors->push_back("--diagnostic-report-filename option is valid only when "
4449
"--experimental-report is set");
45-
if (!report_signal.empty() && !per_env->experimental_report)
50+
}
51+
52+
if (!report_signal.empty()) {
4653
errors->push_back("--diagnostic-report-signal option is valid only when "
4754
"--experimental-report is set");
48-
if (report_on_fatalerror && !per_env->experimental_report)
55+
}
56+
57+
if (report_on_fatalerror) {
4958
errors->push_back(
5059
"--diagnostic-report-on-fatalerror option is valid only when "
5160
"--experimental-report is set");
52-
if (report_on_signal && !per_env->experimental_report)
61+
}
62+
63+
if (report_on_signal) {
5364
errors->push_back("--diagnostic-report-on-signal option is valid only when "
5465
"--experimental-report is set");
55-
if (report_uncaught_exception && !per_env->experimental_report)
66+
}
67+
68+
if (report_uncaught_exception) {
5669
errors->push_back(
5770
"--diagnostic-report-uncaught-exception option is valid only when "
5871
"--experimental-report is set");
59-
if (report_verbose && !per_env->experimental_report)
72+
}
73+
74+
if (report_verbose) {
6075
errors->push_back("--diagnostic-report-verbose option is valid only when "
6176
"--experimental-report is set");
77+
}
6278
#endif // NODE_REPORT
6379
}
6480

0 commit comments

Comments
 (0)