Skip to content

Commit

Permalink
async-wrap: pass PROVIDER as first arg to init
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
trevnorris committed May 5, 2015
1 parent 84bf609 commit 4b2c786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/async-wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ inline AsyncWrap::AsyncWrap(Environment* env,
FatalError("node::AsyncWrap::AsyncWrap", "parent pre hook threw");
}

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

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

0 comments on commit 4b2c786

Please sign in to comment.