From 4b2c78644972cdbeeb498f287640e3d6067a814f Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Mon, 4 May 2015 15:59:07 -0600 Subject: [PATCH] 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 --- src/async-wrap-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index ba84af19c02..46d0e19e536 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -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 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");