Skip to content

Commit 7dde95a

Browse files
committed
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: #1614 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent bd42ba0 commit 7dde95a

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/async-wrap-inl.h

-21
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,16 @@ inline AsyncWrap::AsyncWrap(Environment* env,
3030
if (!env->async_wrap_callbacks_enabled() && !parent->has_async_queue())
3131
return;
3232

33-
// TODO(trevnorris): Until it's verified all passed object's are not weak,
34-
// add a HandleScope to make sure there's no leak.
3533
v8::HandleScope scope(env->isolate());
36-
37-
v8::Local<v8::Object> parent_obj;
38-
3934
v8::TryCatch try_catch;
4035

41-
// If a parent value was sent then call its pre/post functions to let it know
42-
// a conceptual "child" is being instantiated (e.g. that a server has
43-
// received a connection).
44-
if (parent != nullptr) {
45-
parent_obj = parent->object();
46-
env->async_hooks_pre_function()->Call(parent_obj, 0, nullptr);
47-
if (try_catch.HasCaught())
48-
FatalError("node::AsyncWrap::AsyncWrap", "parent pre hook threw");
49-
}
50-
5136
v8::Local<v8::Value> n = v8::Int32::New(env->isolate(), provider);
5237
env->async_hooks_init_function()->Call(object, 1, &n);
5338

5439
if (try_catch.HasCaught())
5540
FatalError("node::AsyncWrap::AsyncWrap", "init hook threw");
5641

5742
bits_ |= 1; // has_async_queue() is true now.
58-
59-
if (parent != nullptr) {
60-
env->async_hooks_post_function()->Call(parent_obj, 0, nullptr);
61-
if (try_catch.HasCaught())
62-
FatalError("node::AsyncWrap::AsyncWrap", "parent post hook threw");
63-
}
6443
}
6544

6645

0 commit comments

Comments
 (0)