Skip to content

Commit 5a494ae

Browse files
danbevtargos
authored andcommitted
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 15a59bb commit 5a494ae

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
@@ -161,6 +161,9 @@ Environment::Environment(IsolateData* isolate_data,
161161

162162
isolate()->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
163163
BuildEmbedderGraph, this);
164+
if (options_->no_force_async_hooks_checks) {
165+
async_hooks_.no_force_checks();
166+
}
164167
}
165168

166169
Environment::~Environment() {

src/node.cc

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

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

0 commit comments

Comments
 (0)