Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
danbev committed Sep 10, 2018
commit 39a46c45951c779c1bd932e201dfce6250f01a8a
3 changes: 3 additions & 0 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 0 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2977,12 +2977,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