mirror of https://github.com/nodejs/node.git
asyncwrap: fix nullptr parent check
The nullptr check for parent on entry to the constructor should be == not !=. This allows reqs that have a parent to run their own init hook callbacks even if kCallInitHook has been disabled.pull/741/head
parent
62512bb29c
commit
8d1179952a
|
@ -23,7 +23,7 @@ inline AsyncWrap::AsyncWrap(Environment* env,
|
||||||
// Check user controlled flag to see if the init callback should run.
|
// Check user controlled flag to see if the init callback should run.
|
||||||
if (!env->using_asyncwrap())
|
if (!env->using_asyncwrap())
|
||||||
return;
|
return;
|
||||||
if (!env->call_async_init_hook() && parent != nullptr)
|
if (!env->call_async_init_hook() && parent == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO(trevnorris): Until it's verified all passed object's are not weak,
|
// TODO(trevnorris): Until it's verified all passed object's are not weak,
|
||||||
|
|
Loading…
Reference in New Issue