summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stream_base-inl.h3
-rw-r--r--src/stream_base.h3
-rw-r--r--src/tty_wrap.cc2
-rw-r--r--test/pseudo-tty/test-tty-stdin-end.js7
-rw-r--r--test/pseudo-tty/test-tty-stdin-end.out0
5 files changed, 10 insertions, 5 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h
index 392dc2c87c..4f4252073d 100644
--- a/src/stream_base-inl.h
+++ b/src/stream_base-inl.h
@@ -335,8 +335,7 @@ void StreamBase::AddMethods(Environment* env,
env->SetProtoMethod(t, "readStart", JSMethod<Base, &StreamBase::ReadStartJS>);
env->SetProtoMethod(t, "readStop", JSMethod<Base, &StreamBase::ReadStopJS>);
- if ((flags & kFlagNoShutdown) == 0)
- env->SetProtoMethod(t, "shutdown", JSMethod<Base, &StreamBase::Shutdown>);
+ env->SetProtoMethod(t, "shutdown", JSMethod<Base, &StreamBase::Shutdown>);
if ((flags & kFlagHasWritev) != 0)
env->SetProtoMethod(t, "writev", JSMethod<Base, &StreamBase::Writev>);
env->SetProtoMethod(t,
diff --git a/src/stream_base.h b/src/stream_base.h
index 96b8589b06..94a091988c 100644
--- a/src/stream_base.h
+++ b/src/stream_base.h
@@ -257,8 +257,7 @@ class StreamBase : public StreamResource {
public:
enum Flags {
kFlagNone = 0x0,
- kFlagHasWritev = 0x1,
- kFlagNoShutdown = 0x2
+ kFlagHasWritev = 0x1
};
template <class Base>
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index 9977738afc..c5abc6bf9b 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -61,7 +61,7 @@ void TTYWrap::Initialize(Local<Object> target,
env->SetProtoMethod(t, "ref", HandleWrap::Ref);
env->SetProtoMethod(t, "hasRef", HandleWrap::HasRef);
- LibuvStreamWrap::AddMethods(env, t, StreamBase::kFlagNoShutdown);
+ LibuvStreamWrap::AddMethods(env, t);
env->SetProtoMethod(t, "getWindowSize", TTYWrap::GetWindowSize);
env->SetProtoMethod(t, "setRawMode", SetRawMode);
diff --git a/test/pseudo-tty/test-tty-stdin-end.js b/test/pseudo-tty/test-tty-stdin-end.js
new file mode 100644
index 0000000000..c78f58446d
--- /dev/null
+++ b/test/pseudo-tty/test-tty-stdin-end.js
@@ -0,0 +1,7 @@
+'use strict';
+require('../common');
+
+// This test ensures that Node.js doesn't crash on `process.stdin.emit("end")`.
+// https://github.com/nodejs/node/issues/1068
+
+process.stdin.emit('end');
diff --git a/test/pseudo-tty/test-tty-stdin-end.out b/test/pseudo-tty/test-tty-stdin-end.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/pseudo-tty/test-tty-stdin-end.out