@@ -42,20 +42,22 @@ function createWritableStdioStream(fd) {
4242 let stream ;
4343 // Note stream._type is used for test-module-load-list.js
4444 switch ( guessHandleType ( fd ) ) {
45- case 'TTY' :
45+ case 'TTY' : {
4646 const tty = require ( 'tty' ) ;
4747 stream = new tty . WriteStream ( fd ) ;
4848 stream . _type = 'tty' ;
4949 break ;
50+ }
5051
51- case 'FILE' :
52+ case 'FILE' : {
5253 const SyncWriteStream = require ( 'internal/fs/sync_write_stream' ) ;
5354 stream = new SyncWriteStream ( fd , { autoClose : false } ) ;
5455 stream . _type = 'fs' ;
5556 break ;
57+ }
5658
5759 case 'PIPE' :
58- case 'TCP' :
60+ case 'TCP' : {
5961 const 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
7981 stream . _type = 'pipe' ;
8082 break ;
83+ }
8184
82- default :
85+ default : {
8386 // Provide a dummy black-hole output for e.g. non-console
8487 // Windows applications.
8588 const { Writable } = require ( 'stream' ) ;
@@ -88,6 +91,7 @@ function createWritableStdioStream(fd) {
8891 cb ( ) ;
8992 }
9093 } ) ;
94+ }
9195 }
9296
9397 // For supporting legacy API we put the FD here.
@@ -147,18 +151,20 @@ function getStdin() {
147151 const fd = 0 ;
148152
149153 switch ( guessHandleType ( fd ) ) {
150- case 'TTY' :
154+ case 'TTY' : {
151155 const tty = require ( 'tty' ) ;
152156 stdin = new tty . ReadStream ( fd ) ;
153157 break ;
158+ }
154159
155- case 'FILE' :
160+ case 'FILE' : {
156161 const fs = require ( 'fs' ) ;
157162 stdin = new fs . ReadStream ( null , { fd : fd , autoClose : false } ) ;
158163 break ;
164+ }
159165
160166 case 'PIPE' :
161- case 'TCP' :
167+ case 'TCP' : {
162168 const 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
184190 stdin . _writableState . ended = true ;
185191 break ;
192+ }
186193
187- default :
194+ default : {
188195 // Provide a dummy contentless input for e.g. non-console
189196 // Windows applications.
190197 const { Readable } = require ( 'stream' ) ;
191198 stdin = new Readable ( { read ( ) { } } ) ;
192199 stdin . push ( null ) ;
200+ }
193201 }
194202
195203 // For supporting legacy API we put the FD here.
0 commit comments