Skip to content

Commit c8b05e4

Browse files
trevnorrisFishrock123
authored andcommitted
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: nodejs#1614 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent a2b6650 commit c8b05e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/async-wrap-inl.h

Lines changed: 2 additions & 1 deletion
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)