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: https://github.com/iojs/io.js/pull/1614
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Trevor Norris committed 2015-05-04 20:07:50 -06:00
1 parent 84bf609fd2
commit 4b2c786449
1 file changed
+2 -1
+2 -1
View File
@@ -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");