Skip to content

Commit

Permalink
Revert "tty: make _read throw ERR_TTY_WRITABLE_NOT_READABLE"
Browse files Browse the repository at this point in the history
This reverts commit 91eec00.

Refs: nodejs#21654
Refs: nodejs#21203
  • Loading branch information
addaleax committed Sep 24, 2018
1 parent 4da11f2 commit a4e4e48
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 38 deletions.
6 changes: 0 additions & 6 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1713,12 +1713,6 @@ A `Transform` stream finished with data still in the write buffer.

The initialization of a TTY failed due to a system error.

<a id="ERR_TTY_WRITABLE_NOT_READABLE"></a>
### ERR_TTY_WRITABLE_NOT_READABLE

This `Error` is thrown when a read is attempted on a TTY `WriteStream`,
such as `process.stdout.on('data')`.

<a id="ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET"></a>
### ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET

Expand Down
3 changes: 0 additions & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,6 @@ E('ERR_TRANSFORM_ALREADY_TRANSFORMING',
E('ERR_TRANSFORM_WITH_LENGTH_0',
'Calling transform done when writableState.length != 0', Error);
E('ERR_TTY_INIT_FAILED', 'TTY initialization failed', SystemError);
E('ERR_TTY_WRITABLE_NOT_READABLE',
'The Writable side of a TTY is not Readable',
Error);
E('ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET',
'`process.setupUncaughtExceptionCapture()` was called while a capture ' +
'callback was already active',
Expand Down
13 changes: 1 addition & 12 deletions lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ const net = require('net');
const { internalBinding } = require('internal/bootstrap/loaders');
const { TTY, isTTY } = internalBinding('tty_wrap');
const errors = require('internal/errors');
const {
ERR_INVALID_FD,
ERR_TTY_INIT_FAILED,
ERR_TTY_WRITABLE_NOT_READABLE
} = errors.codes;
const { ERR_INVALID_FD, ERR_TTY_INIT_FAILED } = errors.codes;
const { getColorDepth } = require('internal/tty');

// Lazy loaded for startup performance.
Expand Down Expand Up @@ -132,13 +128,6 @@ WriteStream.prototype._refreshSize = function() {
}
};

// A WriteStream is not readable from, so _read become a no-op.
// this method could still be called because net.Socket()
// is a duplex
WriteStream.prototype._read = function() {
this.destroy(new ERR_TTY_WRITABLE_NOT_READABLE());
};

// Backwards-compat
WriteStream.prototype.cursorTo = function(x, y) {
if (readline === undefined) readline = require('readline');
Expand Down
17 changes: 0 additions & 17 deletions test/pseudo-tty/test-tty-write-stream-resume-crash.js

This file was deleted.

Empty file.

0 comments on commit a4e4e48

Please sign in to comment.