mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
tty: remove util.inherits usage
PR-URL: https://github.com/nodejs/node/pull/26797 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
parent
bf2b57e46f
commit
83f6ec8876
|
|
@ -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');
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user