From 11c672bc77a3286bb9d3b7d625410f1ff662b943 Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Wed, 20 Jan 2016 18:20:43 +0100 Subject: async_wrap: add parent uid to init hook When the parent uid is required it is not necessary to store the uid in the parent handle object. PR-URL: https://github.com/nodejs/node/pull/4600 Reviewed-By: Trevor Norris Reviewed-By: Sakthipriyan Vairamani --- src/async-wrap-inl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/async-wrap-inl.h') diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index e68c6af4d6..e6b24af7fd 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -42,11 +42,14 @@ inline AsyncWrap::AsyncWrap(Environment* env, v8::Local argv[] = { v8::Integer::New(env->isolate(), get_uid()), v8::Int32::New(env->isolate(), provider), + Null(env->isolate()), Null(env->isolate()) }; - if (parent != nullptr) - argv[2] = parent->object(); + if (parent != nullptr) { + argv[2] = v8::Integer::New(env->isolate(), parent->get_uid()); + argv[3] = parent->object(); + } v8::MaybeLocal ret = init_fn->Call(env->context(), object, ARRAY_SIZE(argv), argv); -- cgit v1.2.1