diff options
Diffstat (limited to 'src/js/node/tty.js')
-rw-r--r-- | src/js/node/tty.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/js/node/tty.js b/src/js/node/tty.js index 1c3fb2fac..6e138b0cf 100644 --- a/src/js/node/tty.js +++ b/src/js/node/tty.js @@ -1,14 +1,13 @@ const { ttySetMode, isatty, getWindowSize: _getWindowSize } = $lazy("tty"); // primordials -const StringPrototypeSplit = Function.prototype.call.bind(String.prototype.split); const NumberIsInteger = Number.isInteger; function ReadStream(fd) { if (!(this instanceof ReadStream)) return new ReadStream(fd); if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer"); - const stream = require("node:fs").ReadStream.call(this, "", { + const stream = require("node:fs").ReadStream.$call(this, "", { fd, }); Object.setPrototypeOf(stream, ReadStream.prototype); @@ -103,7 +102,7 @@ function WriteStream(fd) { if (!(this instanceof WriteStream)) return new WriteStream(fd); if (fd >> 0 !== fd || fd < 0) throw new RangeError("fd must be a positive integer"); - const stream = require("node:fs").WriteStream.call(this, "", { + const stream = require("node:fs").WriteStream.$call(this, "", { fd, }); @@ -193,7 +192,7 @@ Object.defineProperty(WriteStream, "prototype", { // Lazy load for startup performance. if (OSRelease === undefined) { const { release } = require("node:os"); - OSRelease = StringPrototypeSplit(release(), "."); + OSRelease = release().split("."); } // Windows 10 build 10586 is the first Windows release that supports 256 // colors. Windows 10 build 14931 is the first release that supports |