summaryrefslogtreecommitdiff
path: root/src/node_report_module.cc
diff options
context:
space:
mode:
authorHarshitha KP <harshi46@in.ibm.com>2020-03-16 02:13:10 -0400
committerSam Roberts <vieuxtech@gmail.com>2020-03-25 12:43:45 -0700
commit2fa74e3e38bb028339e48763138456b3ed10ed97 (patch)
tree5290bc573103d0e6088c5ddcd5625d919f6ceb82 /src/node_report_module.cc
parent388cef61e8a4859b7505f7b5cf988eba27ce17b4 (diff)
downloadnode-new-2fa74e3e38bb028339e48763138456b3ed10ed97.tar.gz
report: handle on-fatalerror better
--report-on-fatalerror was not honored properly, as there was no way to check the value which was stored in the Environment pointer which can be inaccessible under certain fatal error situations. Move the flag out of Environment pointer so that this is doable. Co-authored-by: Shobhit Chittora schittora@paypal.com PR-URL: https://github.com/nodejs/node/pull/32207 Fixes: https://github.com/nodejs/node/issues/31576 Refs: https://github.com/nodejs/node/pull/29881 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Diffstat (limited to 'src/node_report_module.cc')
-rw-r--r--src/node_report_module.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_report_module.cc b/src/node_report_module.cc
index e06fe52514..769511ec46 100644
--- a/src/node_report_module.cc
+++ b/src/node_report_module.cc
@@ -131,13 +131,13 @@ static void SetSignal(const FunctionCallbackInfo<Value>& info) {
static void ShouldReportOnFatalError(const FunctionCallbackInfo<Value>& info) {
Environment* env = Environment::GetCurrent(info);
info.GetReturnValue().Set(
- env->isolate_data()->options()->report_on_fatalerror);
+ node::per_process::cli_options->report_on_fatalerror);
}
static void SetReportOnFatalError(const FunctionCallbackInfo<Value>& info) {
Environment* env = Environment::GetCurrent(info);
CHECK(info[0]->IsBoolean());
- env->isolate_data()->options()->report_on_fatalerror = info[0]->IsTrue();
+ node::per_process::cli_options->report_on_fatalerror = info[0]->IsTrue();
}
static void ShouldReportOnSignal(const FunctionCallbackInfo<Value>& info) {