diff --git a/src/env.cc b/src/env.cc index a2145ab46b9ffc..0b0664b28616b8 100644 --- a/src/env.cc +++ b/src/env.cc @@ -189,6 +189,9 @@ Environment::Environment(IsolateData* isolate_data, isolate()->GetHeapProfiler()->AddBuildEmbedderGraphCallback( BuildEmbedderGraph, this); + if (options_->no_force_async_hooks_checks) { + async_hooks_.no_force_checks(); + } } Environment::~Environment() { diff --git a/src/node.cc b/src/node.cc index b4481f348b40ac..4a161eb3b28350 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2894,12 +2894,6 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, return 12; // Signal internal error. } - // TODO(addaleax): Maybe access this option directly instead of setting - // a boolean member of Environment. Ditto below for trace_sync_io. - if (env.options()->no_force_async_hooks_checks) { - env.async_hooks()->no_force_checks(); - } - { Environment::AsyncCallbackScope callback_scope(&env); env.async_hooks()->push_async_ids(1, 0);