Skip to content

Commit 3e5b2eb

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. PR-URL: #10096 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 9ed60d3 commit 3e5b2eb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/async-wrap.cc

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ using v8::Function;
1414
using v8::FunctionCallbackInfo;
1515
using v8::HandleScope;
1616
using v8::HeapProfiler;
17+
using v8::Int32;
1718
using v8::Integer;
1819
using v8::Isolate;
1920
using v8::Local;
@@ -155,9 +156,9 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
155156
}
156157

157158

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

362363
} // namespace node
363364

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

src/async-wrap.h

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class AsyncWrap : public BaseObject {
5656

5757
virtual ~AsyncWrap();
5858

59+
static void Initialize(v8::Local<v8::Object> target,
60+
v8::Local<v8::Value> unused,
61+
v8::Local<v8::Context> context);
62+
5963
inline ProviderType provider_type() const;
6064

6165
inline int64_t get_uid() const;

0 commit comments

Comments
 (0)