summaryrefslogtreecommitdiff
path: root/src/pipe_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 132b2662f5..8c251f1f74 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -69,6 +69,8 @@ void PipeWrap::Initialize(Local<Object> target,
t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Pipe"));
t->InstanceTemplate()->SetInternalFieldCount(1);
+ env->SetProtoMethod(t, "getAsyncId", AsyncWrap::GetAsyncId);
+
env->SetProtoMethod(t, "close", HandleWrap::Close);
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
@@ -95,9 +97,11 @@ void PipeWrap::Initialize(Local<Object> target,
// Create FunctionTemplate for PipeConnectWrap.
auto constructor = [](const FunctionCallbackInfo<Value>& args) {
CHECK(args.IsConstructCall());
+ ClearWrap(args.This());
};
auto cwt = FunctionTemplate::New(env->isolate(), constructor);
cwt->InstanceTemplate()->SetInternalFieldCount(1);
+ env->SetProtoMethod(cwt, "getAsyncId", AsyncWrap::GetAsyncId);
cwt->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "PipeConnectWrap"));
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "PipeConnectWrap"),
cwt->GetFunction());