From 28dbc460c63d905d6fccba87a115e7aca1b87ae0 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Tue, 22 Nov 2016 17:05:14 -0700 Subject: [PATCH] async_wrap: make Initialize a static class member This is how it's done everywhere else in core. Make it follow suit. Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- src/async-wrap.cc | 11 ++++++----- src/async-wrap.h | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 7b983fb7b6..5a9c91dcc3 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -15,6 +15,7 @@ using v8::Function; using v8::FunctionCallbackInfo; using v8::HandleScope; using v8::HeapProfiler; +using v8::Int32; using v8::Integer; using v8::Isolate; using v8::Local; @@ -156,9 +157,9 @@ static void SetupHooks(const FunctionCallbackInfo& args) { } -static void Initialize(Local target, - Local unused, - Local context) { +void AsyncWrap::Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); HandleScope scope(isolate); @@ -196,7 +197,7 @@ AsyncWrap::AsyncWrap(Environment* env, Local object, ProviderType provider, AsyncWrap* parent) - : BaseObject(env,object), bits_(static_cast(provider) << 1), + : BaseObject(env, object), bits_(static_cast(provider) << 1), uid_(env->get_async_wrap_uid()) { CHECK_NE(provider, PROVIDER_NONE); CHECK_GE(object->InternalFieldCount(), 1); @@ -362,4 +363,4 @@ Local AsyncWrap::MakeCallback(const Local cb, } // namespace node -NODE_MODULE_CONTEXT_AWARE_BUILTIN(async_wrap, node::Initialize) +NODE_MODULE_CONTEXT_AWARE_BUILTIN(async_wrap, node::AsyncWrap::Initialize) diff --git a/src/async-wrap.h b/src/async-wrap.h index f37e1ac7e1..4499942184 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -54,6 +54,10 @@ class AsyncWrap : public BaseObject { virtual ~AsyncWrap(); + static void Initialize(v8::Local target, + v8::Local unused, + v8::Local context); + inline ProviderType provider_type() const; inline int64_t get_uid() const;