diff options
author | Jon Moss <me@jonathanmoss.me> | 2018-07-11 20:53:05 +0300 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2018-07-13 19:08:20 +0300 |
commit | 45732c7c19672869a7e517e252c83b371a863bee (patch) | |
tree | 14b333f5a45f53bec769cd0b60c2201b1ba46049 /src/tcp_wrap.cc | |
parent | d2ee7d64aa3afd593ec8c0b14f497244403c5589 (diff) |
src: add HandleWrap::AddWrapMethods
Extracts common setters to a single location
PR-URL: https://github.com/nodejs/node/pull/21769
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r-- | src/tcp_wrap.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index aa130d22e02..805e566bfab 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -86,13 +86,7 @@ void TCPWrap::Initialize(Local<Object> target, t->InstanceTemplate()->Set(env->onconnection_string(), Null(env->isolate())); AsyncWrap::AddWrapMethods(env, t, AsyncWrap::kFlagHasReset); - - env->SetProtoMethod(t, "close", HandleWrap::Close); - - env->SetProtoMethod(t, "ref", HandleWrap::Ref); - env->SetProtoMethod(t, "unref", HandleWrap::Unref); - env->SetProtoMethod(t, "hasRef", HandleWrap::HasRef); - + HandleWrap::AddWrapMethods(env, t); LibuvStreamWrap::AddMethods(env, t); env->SetProtoMethod(t, "open", Open); |