GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: add HandleWrap::AddWrapMethods · nodejs/node@4ed5d1a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • handle_wrap.cc
    • handle_wrap.h
    • node_messaging.cc
    • node_stat_watcher.cc
    • pipe_wrap.cc
    • process_wrap.cc
    • signal_wrap.cc
    • tcp_wrap.cc
    • timer_wrap.cc
    • tty_wrap.cc
    • udp_wrap.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/handle_wrap.cc‎

Copy file name to clipboardExpand all lines: src/handle_wrap.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace node {
2929

3030
using v8::Context;
3131
using v8::FunctionCallbackInfo;
32+
using v8::FunctionTemplate;
3233
using v8::HandleScope;
3334
using v8::Local;
3435
using v8::Object;
@@ -130,4 +131,13 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
130131
}
131132

132133

134+
void HandleWrap::AddWrapMethods(Environment* env,
135+
Local<FunctionTemplate> t) {
136+
env->SetProtoMethod(t, "close", HandleWrap::Close);
137+
env->SetProtoMethodNoSideEffect(t, "hasRef", HandleWrap::HasRef);
138+
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
139+
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
140+
}
141+
142+
133143
} // namespace node
Collapse file

‎src/handle_wrap.h‎

Copy file name to clipboardExpand all lines: src/handle_wrap.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ class HandleWrap : public AsyncWrap {
7373
virtual void Close(
7474
v8::Local<v8::Value> close_callback = v8::Local<v8::Value>());
7575

76+
static void AddWrapMethods(Environment* env,
77+
v8::Local<v8::FunctionTemplate> constructor);
78+
7679
protected:
7780
HandleWrap(Environment* env,
7881
v8::Local<v8::Object> object,
Collapse file

‎src/node_messaging.cc‎

Copy file name to clipboardExpand all lines: src/node_messaging.cc
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -724,15 +724,12 @@ MaybeLocal<Function> GetMessagePortConstructor(
724724
m->InstanceTemplate()->SetInternalFieldCount(1);
725725

726726
AsyncWrap::AddWrapMethods(env, m);
727+
HandleWrap::AddWrapMethods(env, m);
727728

728729
env->SetProtoMethod(m, "postMessage", MessagePort::PostMessage);
729730
env->SetProtoMethod(m, "start", MessagePort::Start);
730731
env->SetProtoMethod(m, "stop", MessagePort::Stop);
731732
env->SetProtoMethod(m, "drain", MessagePort::Drain);
732-
env->SetProtoMethod(m, "close", HandleWrap::Close);
733-
env->SetProtoMethod(m, "unref", HandleWrap::Unref);
734-
env->SetProtoMethod(m, "ref", HandleWrap::Ref);
735-
env->SetProtoMethod(m, "hasRef", HandleWrap::HasRef);
736733

737734
env->set_message_port_constructor_template(m);
738735
}
Collapse file

‎src/node_stat_watcher.cc‎

Copy file name to clipboardExpand all lines: src/node_stat_watcher.cc
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ void StatWatcher::Initialize(Environment* env, Local<Object> target) {
5252
t->SetClassName(statWatcherString);
5353

5454
AsyncWrap::AddWrapMethods(env, t);
55+
HandleWrap::AddWrapMethods(env, t);
56+
5557
env->SetProtoMethod(t, "start", StatWatcher::Start);
56-
env->SetProtoMethod(t, "close", HandleWrap::Close);
57-
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
58-
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
59-
env->SetProtoMethod(t, "hasRef", HandleWrap::HasRef);
6058

6159
target->Set(statWatcherString, t->GetFunction());
6260
}
Collapse file

‎src/pipe_wrap.cc‎

Copy file name to clipboardExpand all lines: src/pipe_wrap.cc
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ void PipeWrap::Initialize(Local<Object> target,
7777
t->InstanceTemplate()->SetInternalFieldCount(1);
7878

7979
AsyncWrap::AddWrapMethods(env, t);
80-
81-
env->SetProtoMethod(t, "close", HandleWrap::Close);
82-
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
83-
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
84-
env->SetProtoMethod(t, "hasRef", HandleWrap::HasRef);
85-
80+
HandleWrap::AddWrapMethods(env, t);
8681
LibuvStreamWrap::AddMethods(env, t);
8782

8883
env->SetProtoMethod(t, "bind", Bind);
Collapse file

‎src/process_wrap.cc‎

Copy file name to clipboardExpand all lines: src/process_wrap.cc
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,11 @@ class ProcessWrap : public HandleWrap {
5858
constructor->SetClassName(processString);
5959

6060
AsyncWrap::AddWrapMethods(env, constructor);
61-
62-
env->SetProtoMethod(constructor, "close", HandleWrap::Close);
61+
HandleWrap::AddWrapMethods(env, constructor);
6362

6463
env->SetProtoMethod(constructor, "spawn", Spawn);
6564
env->SetProtoMethod(constructor, "kill", Kill);
6665

67-
env->SetProtoMethod(constructor, "ref", HandleWrap::Ref);
68-
env->SetProtoMethod(constructor, "unref", HandleWrap::Unref);
69-
env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);
70-
7166
target->Set(processString, constructor->GetFunction());
7267
}
7368

Collapse file

‎src/signal_wrap.cc‎

Copy file name to clipboardExpand all lines: src/signal_wrap.cc
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ class SignalWrap : public HandleWrap {
5252
constructor->SetClassName(signalString);
5353

5454
AsyncWrap::AddWrapMethods(env, constructor);
55-
env->SetProtoMethod(constructor, "close", HandleWrap::Close);
56-
env->SetProtoMethod(constructor, "ref", HandleWrap::Ref);
57-
env->SetProtoMethod(constructor, "unref", HandleWrap::Unref);
58-
env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);
55+
HandleWrap::AddWrapMethods(env, constructor);
56+
5957
env->SetProtoMethod(constructor, "start", Start);
6058
env->SetProtoMethod(constructor, "stop", Stop);
6159

Collapse file

‎src/tcp_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tcp_wrap.cc
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,7 @@ void TCPWrap::Initialize(Local<Object> target,
8686
t->InstanceTemplate()->Set(env->onconnection_string(), Null(env->isolate()));
8787

8888
AsyncWrap::AddWrapMethods(env, t, AsyncWrap::kFlagHasReset);
89-
90-
env->SetProtoMethod(t, "close", HandleWrap::Close);
91-
92-
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
93-
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
94-
env->SetProtoMethod(t, "hasRef", HandleWrap::HasRef);
95-
89+
HandleWrap::AddWrapMethods(env, t);
9690
LibuvStreamWrap::AddMethods(env, t);
9791

9892
env->SetProtoMethod(t, "open", Open);
Collapse file

‎src/timer_wrap.cc‎

Copy file name to clipboardExpand all lines: src/timer_wrap.cc
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ class TimerWrap : public HandleWrap {
5555
env->SetTemplateMethod(constructor, "now", Now);
5656

5757
AsyncWrap::AddWrapMethods(env, constructor);
58-
59-
env->SetProtoMethod(constructor, "close", HandleWrap::Close);
60-
env->SetProtoMethod(constructor, "ref", HandleWrap::Ref);
61-
env->SetProtoMethod(constructor, "unref", HandleWrap::Unref);
62-
env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);
58+
HandleWrap::AddWrapMethods(env, constructor);
6359

6460
env->SetProtoMethod(constructor, "start", Start);
6561
env->SetProtoMethod(constructor, "stop", Stop);
Collapse file

‎src/tty_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tty_wrap.cc
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ void TTYWrap::Initialize(Local<Object> target,
5454
t->InstanceTemplate()->SetInternalFieldCount(1);
5555

5656
AsyncWrap::AddWrapMethods(env, t);
57-
58-
env->SetProtoMethod(t, "close", HandleWrap::Close);
59-
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
60-
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
61-
env->SetProtoMethodNoSideEffect(t, "hasRef", HandleWrap::HasRef);
62-
57+
HandleWrap::AddWrapMethods(env, t);
6358
LibuvStreamWrap::AddMethods(env, t);
6459

6560
env->SetProtoMethodNoSideEffect(t, "getWindowSize", TTYWrap::GetWindowSize);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.