diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-08-11 14:12:10 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-08-12 00:58:50 +0300 |
commit | fd038a1f1556e4d525ffb9ba07b2951e14e81cda (patch) | |
tree | c7790a5caf3775c838839e467769d5bb30a667a1 /src/api | |
parent | f86e3ea9dfc90b96d2e198a33dea07a491a608d7 (diff) |
worker: fix --abort-on-uncaught-exception handling
The `set_abort_on_uncaught_exception(false)` line was supposed to
prevent aborting when running Workers in
`--abort-on-uncaught-exception` mode, but it was incorrectly set
and not checked properly in the should-abort callback.
PR-URL: https://github.com/nodejs/node/pull/34724
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/environment.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc index 8e5caac20bd..a99201e7621 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -43,6 +43,7 @@ static bool ShouldAbortOnUncaughtException(Isolate* isolate) { Environment* env = Environment::GetCurrent(isolate); return env != nullptr && (env->is_main_thread() || !env->is_stopping()) && + env->abort_on_uncaught_exception() && env->should_abort_on_uncaught_toggle()[0] && !env->inside_should_not_abort_on_uncaught_scope(); } |