aboutsummaryrefslogtreecommitdiff
path: root/src/async-wrap-inl.h
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2015-05-04 16:11:58 -0600
committerTrevor Norris <trev.norris@gmail.com>2015-05-04 20:08:00 -0600
commit7dde95a8bdd1b5aaeb3bb68a1f0abf7cfc8b3c96 (patch)
tree86636c3db069fcde4077a4e5eb89c214951d0a55 /src/async-wrap-inl.h
parentbd42ba056afe1efe9a4f58f1274d9305c4998a1f (diff)
downloadandroid-node-v8-7dde95a8bdd1b5aaeb3bb68a1f0abf7cfc8b3c96.tar.gz
android-node-v8-7dde95a8bdd1b5aaeb3bb68a1f0abf7cfc8b3c96.tar.bz2
android-node-v8-7dde95a8bdd1b5aaeb3bb68a1f0abf7cfc8b3c96.zip
async-wrap: remove before/after calls in init
It doesn't make sense to call before/after callbacks in init to the parent because they'll be made anyway from MakeCallback. If information does need to be propagated then it should be done automatically. Will deal with this if the issue arrises in the future. PR-URL: https://github.com/iojs/io.js/pull/1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/async-wrap-inl.h')
-rw-r--r--src/async-wrap-inl.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h
index 46d0e19e53..bad634ddaf 100644
--- a/src/async-wrap-inl.h
+++ b/src/async-wrap-inl.h
@@ -30,24 +30,9 @@ inline AsyncWrap::AsyncWrap(Environment* env,
if (!env->async_wrap_callbacks_enabled() && !parent->has_async_queue())
return;
- // TODO(trevnorris): Until it's verified all passed object's are not weak,
- // add a HandleScope to make sure there's no leak.
v8::HandleScope scope(env->isolate());
-
- v8::Local<v8::Object> parent_obj;
-
v8::TryCatch try_catch;
- // If a parent value was sent then call its pre/post functions to let it know
- // a conceptual "child" is being instantiated (e.g. that a server has
- // received a connection).
- if (parent != nullptr) {
- parent_obj = parent->object();
- env->async_hooks_pre_function()->Call(parent_obj, 0, nullptr);
- if (try_catch.HasCaught())
- FatalError("node::AsyncWrap::AsyncWrap", "parent pre hook threw");
- }
-
v8::Local<v8::Value> n = v8::Int32::New(env->isolate(), provider);
env->async_hooks_init_function()->Call(object, 1, &n);
@@ -55,12 +40,6 @@ inline AsyncWrap::AsyncWrap(Environment* env,
FatalError("node::AsyncWrap::AsyncWrap", "init hook threw");
bits_ |= 1; // has_async_queue() is true now.
-
- if (parent != nullptr) {
- env->async_hooks_post_function()->Call(parent_obj, 0, nullptr);
- if (try_catch.HasCaught())
- FatalError("node::AsyncWrap::AsyncWrap", "parent post hook threw");
- }
}