Skip to content

Commit 1747d70

Browse files
committed
src: move no_async_hooks_checks to env
This commit moves the setting of AsyncHooks no_force_checks to the Environment constructor instead of from the Start function in node.cc. PR-URL: #22784 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b7661a8 commit 1747d70

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/env.cc

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ Environment::Environment(IsolateData* isolate_data,
189189

190190
isolate()->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
191191
BuildEmbedderGraph, this);
192+
if (options_->no_force_async_hooks_checks) {
193+
async_hooks_.no_force_checks();
194+
}
192195
}
193196

194197
Environment::~Environment() {

src/node.cc

-6
Original file line numberDiff line numberDiff line change
@@ -2894,12 +2894,6 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
28942894
return 12; // Signal internal error.
28952895
}
28962896

2897-
// TODO(addaleax): Maybe access this option directly instead of setting
2898-
// a boolean member of Environment. Ditto below for trace_sync_io.
2899-
if (env.options()->no_force_async_hooks_checks) {
2900-
env.async_hooks()->no_force_checks();
2901-
}
2902-
29032897
{
29042898
Environment::AsyncCallbackScope callback_scope(&env);
29052899
env.async_hooks()->push_async_ids(1, 0);

0 commit comments

Comments
 (0)