@@ -42,20 +42,22 @@ function createWritableStdioStream(fd) {
4242let stream ;
4343// Note stream._type is used for test-module-load-list.js
4444switch ( guessHandleType ( fd ) ) {
45- case 'TTY' :
45+ case 'TTY' :{
4646const tty = require ( 'tty' ) ;
4747stream = new tty . WriteStream ( fd ) ;
4848stream . _type = 'tty' ;
4949break ;
50+ }
5051
51- case 'FILE' :
52+ case 'FILE' :{
5253const SyncWriteStream = require ( 'internal/fs/sync_write_stream' ) ;
5354stream = new SyncWriteStream ( fd , { autoClose : false } ) ;
5455stream . _type = 'fs' ;
5556break ;
57+ }
5658
5759case 'PIPE' :
58- case 'TCP' :
60+ case 'TCP' :{
5961const net = require ( 'net' ) ;
6062
6163// If fd is already being used for the IPC channel, libuv will return
@@ -78,8 +80,9 @@ function createWritableStdioStream(fd) {
7880
7981stream . _type = 'pipe' ;
8082break ;
83+ }
8184
82- default :
85+ default :{
8386// Provide a dummy black-hole output for e.g. non-console
8487// Windows applications.
8588const { Writable } = require ( 'stream' ) ;
@@ -88,6 +91,7 @@ function createWritableStdioStream(fd) {
8891cb ( ) ;
8992}
9093} ) ;
94+ }
9195}
9296
9397// For supporting legacy API we put the FD here.
@@ -147,18 +151,20 @@ function getStdin() {
147151const fd = 0 ;
148152
149153switch ( guessHandleType ( fd ) ) {
150- case 'TTY' :
154+ case 'TTY' :{
151155const tty = require ( 'tty' ) ;
152156stdin = new tty . ReadStream ( fd ) ;
153157break ;
158+ }
154159
155- case 'FILE' :
160+ case 'FILE' :{
156161const fs = require ( 'fs' ) ;
157162stdin = new fs . ReadStream ( null , { fd : fd , autoClose : false } ) ;
158163break ;
164+ }
159165
160166case 'PIPE' :
161- case 'TCP' :
167+ case 'TCP' :{
162168const net = require ( 'net' ) ;
163169
164170// It could be that process has been started with an IPC channel
@@ -183,13 +189,15 @@ function getStdin() {
183189// Make sure the stdin can't be `.end()`-ed
184190stdin . _writableState . ended = true ;
185191break ;
192+ }
186193
187- default :
194+ default :{
188195// Provide a dummy contentless input for e.g. non-console
189196// Windows applications.
190197const { Readable } = require ( 'stream' ) ;
191198stdin = new Readable ( { read ( ) { } } ) ;
192199stdin . push ( null ) ;
200+ }
193201}
194202
195203// For supporting legacy API we put the FD here.
0 commit comments