summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-18 03:15:57 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-12-20 13:52:44 +0100
commitd4c91f28148af8a6c1a95392e5c88cb93d4b61c6 (patch)
tree482eb1a0470591925cb7a89c74f13b3b85717acb /lib/tty.js
parent4b7a530f2b1a789b3feb64e3698d61b4ccc6bab5 (diff)
downloadandroid-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.gz
android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.bz2
android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.zip
lib: remove internal `util._extends()` usage
This removes all internal calls to the deprecated `_extends()` function. It is slower than `Object.assign()` and the object spread notation since V8 6.8 and using the spread notation often also results in shorter code. PR-URL: https://github.com/nodejs/node/pull/25105 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 62945a78eb..6efaac6e43 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -21,7 +21,7 @@
'use strict';
-const { inherits, _extend } = require('util');
+const { inherits } = require('util');
const net = require('net');
const { TTY, isTTY } = internalBinding('tty_wrap');
const errors = require('internal/errors');
@@ -47,14 +47,13 @@ function ReadStream(fd, options) {
throw new ERR_TTY_INIT_FAILED(ctx);
}
- options = _extend({
+ net.Socket.call(this, {
highWaterMark: 0,
readable: true,
writable: false,
- handle: tty
- }, options);
-
- net.Socket.call(this, options);
+ handle: tty,
+ ...options
+ });
this.isRaw = false;
this.isTTY = true;