Skip to content

Commit

Permalink
src: move no_async_hooks_checks to env
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danbev authored and targos committed Sep 20, 2018
1 parent 15a59bb commit 5a494ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,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() {
Expand Down
6 changes: 0 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2896,12 +2896,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);
Expand Down

0 comments on commit 5a494ae

Please sign in to comment.