diff options
author | Trevor Norris <trev.norris@gmail.com> | 2015-02-05 15:54:12 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2015-02-05 16:10:13 -0700 |
commit | 05f4dff97519ada5d3149a16ca9e5a04df948a61 (patch) | |
tree | 363d26473eb18d943e77547e1ba806a704518139 /src/async-wrap-inl.h | |
parent | 10277d2e57ee7fe9e0e3f63f10b9ea521e86e7f0 (diff) | |
download | android-node-v8-05f4dff97519ada5d3149a16ca9e5a04df948a61.tar.gz android-node-v8-05f4dff97519ada5d3149a16ca9e5a04df948a61.tar.bz2 android-node-v8-05f4dff97519ada5d3149a16ca9e5a04df948a61.zip |
asyncwrap: fix constructor condition for early ret
AsyncWrap should always properly propagate asynchronous calls to any
child that is created. Regardless whether kCallInitHook is currently
active. The previous logic would always return early if kCallInitHook
wasn't set.
PR-URL: https://github.com/iojs/io.js/pull/732
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/async-wrap-inl.h')
-rw-r--r-- | src/async-wrap-inl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 647a381e88..6b434c08c0 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -21,7 +21,9 @@ inline AsyncWrap::AsyncWrap(Environment* env, has_async_queue_(false), provider_type_(provider) { // Check user controlled flag to see if the init callback should run. - if (!env->call_async_init_hook()) + if (!env->using_asyncwrap()) + return; + if (!env->call_async_init_hook() && parent != nullptr) return; // TODO(trevnorris): Until it's verified all passed object's are not weak, |