aboutsummaryrefslogtreecommitdiff
path: root/src/async-wrap.h
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2015-10-01 18:57:36 -0600
committerTrevor Norris <trev.norris@gmail.com>2015-10-07 13:27:46 -0600
commitaeee956ac73de7af914b747926168714fe4d1c4c (patch)
treee7ba29088a954bdcacf797b3dd08ad82f719a8e9 /src/async-wrap.h
parent07a84191c09d6124f2826d1e88bd9dd961c98fc6 (diff)
downloadandroid-node-v8-aeee956ac73de7af914b747926168714fe4d1c4c.tar.gz
android-node-v8-aeee956ac73de7af914b747926168714fe4d1c4c.tar.bz2
android-node-v8-aeee956ac73de7af914b747926168714fe4d1c4c.zip
async_wrap: correctly pass parent to init callback
Previous logic didn't allow parent to propagate to the init callback properly. The fix now allows the init callback to be called and receive the parent if: - async wrap callbacks are enabled and parent exists - the init callback has been called on the parent and an init callback exists then it will be called regardless of whether async wrap callbacks are disabled. Change the init/pre/post callback checks to see if it has been properly set. This allows removal of the Environment "using_asyncwrap" variable. Pass Isolate to a TryCatch instance. Fixes: https://github.com/nodejs/node/issues/2986 PR-URL: https://github.com/nodejs/node/pull/3216 Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'src/async-wrap.h')
-rw-r--r--src/async-wrap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/async-wrap.h b/src/async-wrap.h
index 3999607bb2..330f3454f4 100644
--- a/src/async-wrap.h
+++ b/src/async-wrap.h
@@ -70,7 +70,7 @@ class AsyncWrap : public BaseObject {
private:
inline AsyncWrap();
- inline bool has_async_queue() const;
+ inline bool ran_init_callback() const;
// When the async hooks init JS function is called from the constructor it is
// expected the context object will receive a _asyncQueue object property