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:
parent
b7661a8311
commit
1747d707d7
@ -189,6 +189,9 @@ Environment::Environment(IsolateData* isolate_data,
|
|||||||
|
|
||||||
isolate()->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
|
isolate()->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
|
||||||
BuildEmbedderGraph, this);
|
BuildEmbedderGraph, this);
|
||||||
|
if (options_->no_force_async_hooks_checks) {
|
||||||
|
async_hooks_.no_force_checks();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Environment::~Environment() {
|
Environment::~Environment() {
|
||||||
|
@ -2894,12 +2894,6 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
|
|||||||
return 12; // Signal internal error.
|
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);
|
Environment::AsyncCallbackScope callback_scope(&env);
|
||||||
env.async_hooks()->push_async_ids(1, 0);
|
env.async_hooks()->push_async_ids(1, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user