summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index 08c50d911f..186f2f0100 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -36,26 +36,10 @@ void TTYWrap::Initialize(Handle<Object> target,
t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "TTY"));
t->InstanceTemplate()->SetInternalFieldCount(1);
- enum PropertyAttribute attributes =
- static_cast<PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
- t->InstanceTemplate()->SetAccessor(env->fd_string(),
- StreamWrap::GetFD,
- nullptr,
- Handle<Value>(),
- v8::DEFAULT,
- attributes);
-
env->SetProtoMethod(t, "close", HandleWrap::Close);
env->SetProtoMethod(t, "unref", HandleWrap::Unref);
- env->SetProtoMethod(t, "readStart", StreamWrap::ReadStart);
- env->SetProtoMethod(t, "readStop", StreamWrap::ReadStop);
-
- env->SetProtoMethod(t, "writeBuffer", StreamWrap::WriteBuffer);
- env->SetProtoMethod(t, "writeAsciiString", StreamWrap::WriteAsciiString);
- env->SetProtoMethod(t, "writeUtf8String", StreamWrap::WriteUtf8String);
- env->SetProtoMethod(t, "writeUcs2String", StreamWrap::WriteUcs2String);
- env->SetProtoMethod(t, "writeBinaryString", StreamWrap::WriteBinaryString);
+ StreamWrap::AddMethods(env, t);
env->SetProtoMethod(t, "getWindowSize", TTYWrap::GetWindowSize);
env->SetProtoMethod(t, "setRawMode", SetRawMode);