summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-09-23 19:24:33 +0200
committerAnna Henningsen <anna@addaleax.net>2018-10-03 13:43:42 -0700
commitd527dde3600655eae7ce0ba5da9263ec4560cd11 (patch)
treecb9186b8b85a696ec7f916f40fcec935ba86fdc9 /src/tty_wrap.cc
parent2ebdba12297348649620e3d302b156c149d85a6e (diff)
downloadandroid-node-v8-d527dde3600655eae7ce0ba5da9263ec4560cd11.tar.gz
android-node-v8-d527dde3600655eae7ce0ba5da9263ec4560cd11.tar.bz2
android-node-v8-d527dde3600655eae7ce0ba5da9263ec4560cd11.zip
src: use JS inheritance for `AsyncWrap`
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. PR-URL: https://github.com/nodejs/node/pull/23094 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index e7b684a7ee..1d0ea90f36 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -24,7 +24,6 @@
#include "env-inl.h"
#include "handle_wrap.h"
#include "node_buffer.h"
-#include "node_wrap.h"
#include "stream_base-inl.h"
#include "stream_wrap.h"
#include "util-inl.h"
@@ -52,10 +51,7 @@ void TTYWrap::Initialize(Local<Object> target,
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->SetClassName(ttyString);
t->InstanceTemplate()->SetInternalFieldCount(1);
-
- AsyncWrap::AddWrapMethods(env, t);
- HandleWrap::AddWrapMethods(env, t);
- LibuvStreamWrap::AddMethods(env, t);
+ t->Inherit(LibuvStreamWrap::GetConstructorTemplate(env));
env->SetProtoMethodNoSideEffect(t, "getWindowSize", TTYWrap::GetWindowSize);
env->SetProtoMethod(t, "setRawMode", SetRawMode);