@@ -55,10 +55,10 @@ function fork(modulePath /* , args, options */) {
55
55
validateString ( modulePath , 'modulePath' ) ;
56
56
57
57
// Get options and args arguments.
58
- var execArgv ;
59
- var options = { } ;
60
- var args = [ ] ;
61
- var pos = 1 ;
58
+ let execArgv ;
59
+ let options = { } ;
60
+ let args = [ ] ;
61
+ let pos = 1 ;
62
62
if ( pos < arguments . length && Array . isArray ( arguments [ pos ] ) ) {
63
63
args = arguments [ pos ++ ] ;
64
64
}
@@ -231,23 +231,23 @@ function execFile(file /* , args, options, callback */) {
231
231
windowsVerbatimArguments : ! ! options . windowsVerbatimArguments
232
232
} ) ;
233
233
234
- var encoding ;
234
+ let encoding ;
235
235
const _stdout = [ ] ;
236
236
const _stderr = [ ] ;
237
237
if ( options . encoding !== 'buffer' && Buffer . isEncoding ( options . encoding ) ) {
238
238
encoding = options . encoding ;
239
239
} else {
240
240
encoding = null ;
241
241
}
242
- var stdoutLen = 0 ;
243
- var stderrLen = 0 ;
244
- var killed = false ;
245
- var exited = false ;
246
- var timeoutId ;
242
+ let stdoutLen = 0 ;
243
+ let stderrLen = 0 ;
244
+ let killed = false ;
245
+ let exited = false ;
246
+ let timeoutId ;
247
247
248
- var ex = null ;
248
+ let ex = null ;
249
249
250
- var cmd = file ;
250
+ let cmd = file ;
251
251
252
252
function exithandler ( code , signal ) {
253
253
if ( exited ) return ;
@@ -261,8 +261,8 @@ function execFile(file /* , args, options, callback */) {
261
261
if ( ! callback ) return ;
262
262
263
263
// merge chunks
264
- var stdout ;
265
- var stderr ;
264
+ let stdout ;
265
+ let stderr ;
266
266
if ( encoding ||
267
267
(
268
268
child . stdout &&
@@ -580,15 +580,15 @@ function spawnSync(file, args, options) {
580
580
options . stdio = getValidStdio ( options . stdio || 'pipe' , true ) . stdio ;
581
581
582
582
if ( options . input ) {
583
- var stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
583
+ const stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
584
584
stdin . input = options . input ;
585
585
}
586
586
587
587
// We may want to pass data in on any given fd, ensure it is a valid buffer
588
- for ( var i = 0 ; i < options . stdio . length ; i ++ ) {
589
- var input = options . stdio [ i ] && options . stdio [ i ] . input ;
588
+ for ( let i = 0 ; i < options . stdio . length ; i ++ ) {
589
+ const input = options . stdio [ i ] && options . stdio [ i ] . input ;
590
590
if ( input != null ) {
591
- var pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
591
+ const pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
592
592
if ( isArrayBufferView ( input ) ) {
593
593
pipe . input = input ;
594
594
} else if ( typeof input === 'string' ) {
@@ -609,11 +609,11 @@ function spawnSync(file, args, options) {
609
609
610
610
611
611
function checkExecSyncError ( ret , args , cmd ) {
612
- var err ;
612
+ let err ;
613
613
if ( ret . error ) {
614
614
err = ret . error ;
615
615
} else if ( ret . status !== 0 ) {
616
- var msg = 'Command failed: ' ;
616
+ let msg = 'Command failed: ' ;
617
617
msg += cmd || args . join ( ' ' ) ;
618
618
if ( ret . stderr && ret . stderr . length > 0 )
619
619
msg += `\n${ ret . stderr . toString ( ) } ` ;
0 commit comments