Skip to content

Commit 4b2c786

Browse files
committed
async-wrap: pass PROVIDER as first arg to init
Allow the init callback to see the PROVIDER type easily by being able to compare the flag with the list of providers on the exported async_wrap object. PR-URL: #1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 84bf609 commit 4b2c786

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/async-wrap-inl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ inline AsyncWrap::AsyncWrap(Environment* env,
4848
FatalError("node::AsyncWrap::AsyncWrap", "parent pre hook threw");
4949
}
5050

51-
env->async_hooks_init_function()->Call(object, 0, nullptr);
51+
v8::Local<v8::Value> n = v8::Int32::New(env->isolate(), provider);
52+
env->async_hooks_init_function()->Call(object, 1, &n);
5253

5354
if (try_catch.HasCaught())
5455
FatalError("node::AsyncWrap::AsyncWrap", "init hook threw");

0 commit comments

Comments
 (0)