Skip to content

Commit

Permalink
tty: remove util.inherits usage
Browse files Browse the repository at this point in the history
PR-URL: #26797
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
  • Loading branch information
nissy-dev authored and targos committed Mar 27, 2019
1 parent bf2b57e commit 83f6ec8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

'use strict';

const { inherits } = require('util');
const net = require('net');
const { TTY, isTTY } = internalBinding('tty_wrap');
const errors = require('internal/errors');
Expand Down Expand Up @@ -61,7 +60,9 @@ function ReadStream(fd, options) {
this.isRaw = false;
this.isTTY = true;
}
inherits(ReadStream, net.Socket);

Object.setPrototypeOf(ReadStream.prototype, net.Socket.prototype);
Object.setPrototypeOf(ReadStream, net.Socket);

ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
Expand Down Expand Up @@ -106,7 +107,9 @@ function WriteStream(fd) {
this.rows = winSize[1];
}
}
inherits(WriteStream, net.Socket);

Object.setPrototypeOf(WriteStream.prototype, net.Socket.prototype);
Object.setPrototypeOf(WriteStream, net.Socket);

WriteStream.prototype.isTTY = true;

Expand Down

0 comments on commit 83f6ec8

Please sign in to comment.