mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
process: replace var with let/const
PR-URL: https://github.com/nodejs/node/pull/30382 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
18ce3a3b05
commit
ecfebee90f
1 file changed
+9
-9
@@ -19,9 +19,9 @@ function dummyDestroy(err, cb) {
|
||||
}
|
||||
|
||||
function getMainThreadStdio() {
|
||||
var stdin;
|
||||
var stdout;
|
||||
var stderr;
|
||||
let stdin;
|
||||
let stdout;
|
||||
let stderr;
|
||||
|
||||
function getStdout() {
|
||||
if (stdout) return stdout;
|
||||
@@ -53,7 +53,7 @@ function getMainThreadStdio() {
|
||||
|
||||
switch (guessHandleType(fd)) {
|
||||
case 'TTY':
|
||||
var tty = require('tty');
|
||||
const tty = require('tty');
|
||||
stdin = new tty.ReadStream(fd, {
|
||||
highWaterMark: 0,
|
||||
readable: true,
|
||||
@@ -62,13 +62,13 @@ function getMainThreadStdio() {
|
||||
break;
|
||||
|
||||
case 'FILE':
|
||||
var fs = require('fs');
|
||||
const fs = require('fs');
|
||||
stdin = new fs.ReadStream(null, { fd: fd, autoClose: false });
|
||||
break;
|
||||
|
||||
case 'PIPE':
|
||||
case 'TCP':
|
||||
var net = require('net');
|
||||
const net = require('net');
|
||||
|
||||
// It could be that process has been started with an IPC channel
|
||||
// sitting on fd=0, in such case the pipe for this fd is already
|
||||
@@ -147,11 +147,11 @@ function getMainThreadStdio() {
|
||||
}
|
||||
|
||||
function createWritableStdioStream(fd) {
|
||||
var stream;
|
||||
let stream;
|
||||
// Note stream._type is used for test-module-load-list.js
|
||||
switch (guessHandleType(fd)) {
|
||||
case 'TTY':
|
||||
var tty = require('tty');
|
||||
const tty = require('tty');
|
||||
stream = new tty.WriteStream(fd);
|
||||
stream._type = 'tty';
|
||||
break;
|
||||
@@ -164,7 +164,7 @@ function createWritableStdioStream(fd) {
|
||||
|
||||
case 'PIPE':
|
||||
case 'TCP':
|
||||
var net = require('net');
|
||||
const net = require('net');
|
||||
|
||||
// If fd is already being used for the IPC channel, libuv will return
|
||||
// an error when trying to use it again. In that case, create the socket
|
||||
|
||||
Reference in new issue
Block a user