Skip to content

Commit 28dbc46

Browse files
trevnorrisMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent bb05cd1 commit 28dbc46

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/async-wrap.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ using v8::Function;
1515
using v8::FunctionCallbackInfo;
1616
using v8::HandleScope;
1717
using v8::HeapProfiler;
18+
using v8::Int32;
1819
using v8::Integer;
1920
using v8::Isolate;
2021
using v8::Local;
@@ -156,9 +157,9 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
156157
}
157158

158159

159-
static void Initialize(Local<Object> target,
160-
Local<Value> unused,
161-
Local<Context> context) {
160+
void AsyncWrap::Initialize(Local<Object> target,
161+
Local<Value> unused,
162+
Local<Context> context) {
162163
Environment* env = Environment::GetCurrent(context);
163164
Isolate* isolate = env->isolate();
164165
HandleScope scope(isolate);
@@ -196,7 +197,7 @@ AsyncWrap::AsyncWrap(Environment* env,
196197
Local<Object> object,
197198
ProviderType provider,
198199
AsyncWrap* parent)
199-
: BaseObject(env,object), bits_(static_cast<uint32_t>(provider) << 1),
200+
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1),
200201
uid_(env->get_async_wrap_uid()) {
201202
CHECK_NE(provider, PROVIDER_NONE);
202203
CHECK_GE(object->InternalFieldCount(), 1);
@@ -362,4 +363,4 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
362363

363364
} // namespace node
364365

365-
NODE_MODULE_CONTEXT_AWARE_BUILTIN(async_wrap, node::Initialize)
366+
NODE_MODULE_CONTEXT_AWARE_BUILTIN(async_wrap, node::AsyncWrap::Initialize)

src/async-wrap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class AsyncWrap : public BaseObject {
5454

5555
virtual ~AsyncWrap();
5656

57+
static void Initialize(v8::Local<v8::Object> target,
58+
v8::Local<v8::Value> unused,
59+
v8::Local<v8::Context> context);
60+
5761
inline ProviderType provider_type() const;
5862

5963
inline int64_t get_uid() const;

0 commit comments

Comments
 (0)