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: https://github.com/nodejs/node/pull/22784
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Daniel Bevenius 2018-09-10 06:23:59 +02:00
parent b7661a8311
commit 1747d707d7
2 changed files with 3 additions and 6 deletions

View File

@ -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() {

View File

@ -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);