diff --git a/src/node_worker.cc b/src/node_worker.cc index 1172dd7e9a8b5e..d184d16ac8ee8b 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -272,6 +272,11 @@ void Worker::Run() { DeleteFnPtr env_; auto cleanup_env = OnScopeLeave([&]() { + // TODO(addaleax): This call is harmless but should not be necessary. + // Figure out why V8 is raising a DCHECK() here without it + // (in test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js). + isolate_->CancelTerminateExecution(); + if (!env_) return; env_->set_can_call_into_js(false); Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_,