Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5157a5c

Browse filesBrowse 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: #9753 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 3e5be7f commit 5157a5c
Copy full SHA for 5157a5c

File tree

Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-5
lines changed
Open diff view settings
Collapse file

‎src/async-wrap.cc‎

Copy file name to clipboardExpand all lines: src/async-wrap.cc
+6-5Lines changed: 6 additions & 5 deletions
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)
Collapse file

‎src/async-wrap.h‎

Copy file name to clipboardExpand all lines: src/async-wrap.h
+4Lines changed: 4 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.