Skip to content

Commit 2c29db1

Browse files
deadbeef84targos
authored andcommitted
process: replace var with let/const
PR-URL: #30382 Reviewed-By: James M Snell <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent a31ace5 commit 2c29db1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/internal/process/stdio.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ function dummyDestroy(err, cb) {
1919
}
2020

2121
function getMainThreadStdio() {
22-
var stdin;
23-
var stdout;
24-
var stderr;
22+
let stdin;
23+
let stdout;
24+
let stderr;
2525

2626
function getStdout() {
2727
if (stdout) return stdout;
@@ -53,7 +53,7 @@ function getMainThreadStdio() {
5353

5454
switch (guessHandleType(fd)) {
5555
case 'TTY':
56-
var tty = require('tty');
56+
const tty = require('tty');
5757
stdin = new tty.ReadStream(fd, {
5858
highWaterMark: 0,
5959
readable: true,
@@ -62,13 +62,13 @@ function getMainThreadStdio() {
6262
break;
6363

6464
case 'FILE':
65-
var fs = require('fs');
65+
const fs = require('fs');
6666
stdin = new fs.ReadStream(null, { fd: fd, autoClose: false });
6767
break;
6868

6969
case 'PIPE':
7070
case 'TCP':
71-
var net = require('net');
71+
const net = require('net');
7272

7373
// It could be that process has been started with an IPC channel
7474
// sitting on fd=0, in such case the pipe for this fd is already
@@ -147,11 +147,11 @@ function getMainThreadStdio() {
147147
}
148148

149149
function createWritableStdioStream(fd) {
150-
var stream;
150+
let stream;
151151
// Note stream._type is used for test-module-load-list.js
152152
switch (guessHandleType(fd)) {
153153
case 'TTY':
154-
var tty = require('tty');
154+
const tty = require('tty');
155155
stream = new tty.WriteStream(fd);
156156
stream._type = 'tty';
157157
break;
@@ -164,7 +164,7 @@ function createWritableStdioStream(fd) {
164164

165165
case 'PIPE':
166166
case 'TCP':
167-
var net = require('net');
167+
const net = require('net');
168168

169169
// If fd is already being used for the IPC channel, libuv will return
170170
// an error when trying to use it again. In that case, create the socket

0 commit comments

Comments
 (0)