aboutsummaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-11-20 19:57:20 +0100
committerAnna Henningsen <anna@addaleax.net>2017-11-29 15:58:42 +0100
commit4503da8a3a3b0b71d950a63de729ce495965f6ea (patch)
tree66ad243cd90cea3df8fc11eb7cf29597ddd56eb3 /src/env-inl.h
parent04e3aa28bbcdf62f677dd314ad8c12556c18c15f (diff)
downloadandroid-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.tar.gz
android-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.tar.bz2
android-node-v8-4503da8a3a3b0b71d950a63de729ce495965f6ea.zip
process: add flag for uncaught exception abort
Introduce `process.shouldAbortOnUncaughtException` to control `--abort-on-uncaught-exception` behaviour, and implement some of the domains functionality on top of it. PR-URL: https://github.com/nodejs/node/pull/17159 Refs: https://github.com/nodejs/node/issues/17143 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index 78f53c9f0f..98702ddc4a 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -268,6 +268,7 @@ inline Environment::Environment(IsolateData* isolate_data,
emit_napi_warning_(true),
makecallback_cntr_(0),
scheduled_immediate_count_(isolate_, 1),
+ should_abort_on_uncaught_toggle_(isolate_, 1),
#if HAVE_INSPECTOR
inspector_agent_(new inspector::Agent(this)),
#endif
@@ -305,6 +306,9 @@ inline Environment::Environment(IsolateData* isolate_data,
performance_state_->milestones[
performance::NODE_PERFORMANCE_MILESTONE_V8_START] =
performance::performance_v8_start;
+
+ // By default, always abort when --abort-on-uncaught-exception was passed.
+ should_abort_on_uncaught_toggle_[0] = 1;
}
inline Environment::~Environment() {
@@ -399,6 +403,11 @@ inline void Environment::set_abort_on_uncaught_exception(bool value) {
abort_on_uncaught_exception_ = value;
}
+inline AliasedBuffer<uint32_t, v8::Uint32Array>&
+Environment::should_abort_on_uncaught_toggle() {
+ return should_abort_on_uncaught_toggle_;
+}
+
inline std::vector<double>* Environment::destroy_async_id_list() {
return &destroy_async_id_list_;
}