@@ -59,10 +59,10 @@ function fork(modulePath /* , args, options */) {
59
59
validateString ( modulePath , 'modulePath' ) ;
60
60
61
61
// Get options and args arguments.
62
- var execArgv ;
63
- var options = { } ;
64
- var args = [ ] ;
65
- var pos = 1 ;
62
+ let execArgv ;
63
+ let options = { } ;
64
+ let args = [ ] ;
65
+ let pos = 1 ;
66
66
if ( pos < arguments . length && Array . isArray ( arguments [ pos ] ) ) {
67
67
args = arguments [ pos ++ ] ;
68
68
}
@@ -235,23 +235,23 @@ function execFile(file /* , args, options, callback */) {
235
235
windowsVerbatimArguments : ! ! options . windowsVerbatimArguments
236
236
} ) ;
237
237
238
- var encoding ;
238
+ let encoding ;
239
239
const _stdout = [ ] ;
240
240
const _stderr = [ ] ;
241
241
if ( options . encoding !== 'buffer' && Buffer . isEncoding ( options . encoding ) ) {
242
242
encoding = options . encoding ;
243
243
} else {
244
244
encoding = null ;
245
245
}
246
- var stdoutLen = 0 ;
247
- var stderrLen = 0 ;
248
- var killed = false ;
249
- var exited = false ;
250
- var timeoutId ;
246
+ let stdoutLen = 0 ;
247
+ let stderrLen = 0 ;
248
+ let killed = false ;
249
+ let exited = false ;
250
+ let timeoutId ;
251
251
252
- var ex = null ;
252
+ let ex = null ;
253
253
254
- var cmd = file ;
254
+ let cmd = file ;
255
255
256
256
function exithandler ( code , signal ) {
257
257
if ( exited ) return ;
@@ -265,8 +265,8 @@ function execFile(file /* , args, options, callback */) {
265
265
if ( ! callback ) return ;
266
266
267
267
// merge chunks
268
- var stdout ;
269
- var stderr ;
268
+ let stdout ;
269
+ let stderr ;
270
270
if ( encoding ||
271
271
(
272
272
child . stdout &&
@@ -566,15 +566,15 @@ function spawnSync(file, args, options) {
566
566
options . stdio = getValidStdio ( options . stdio || 'pipe' , true ) . stdio ;
567
567
568
568
if ( options . input ) {
569
- var stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
569
+ const stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
570
570
stdin . input = options . input ;
571
571
}
572
572
573
573
// We may want to pass data in on any given fd, ensure it is a valid buffer
574
- for ( var i = 0 ; i < options . stdio . length ; i ++ ) {
575
- var input = options . stdio [ i ] && options . stdio [ i ] . input ;
574
+ for ( let i = 0 ; i < options . stdio . length ; i ++ ) {
575
+ const input = options . stdio [ i ] && options . stdio [ i ] . input ;
576
576
if ( input != null ) {
577
- var pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
577
+ const pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
578
578
if ( isArrayBufferView ( input ) ) {
579
579
pipe . input = input ;
580
580
} else if ( typeof input === 'string' ) {
@@ -595,11 +595,11 @@ function spawnSync(file, args, options) {
595
595
596
596
597
597
function checkExecSyncError ( ret , args , cmd ) {
598
- var err ;
598
+ let err ;
599
599
if ( ret . error ) {
600
600
err = ret . error ;
601
601
} else if ( ret . status !== 0 ) {
602
- var msg = 'Command failed: ' ;
602
+ let msg = 'Command failed: ' ;
603
603
msg += cmd || args . join ( ' ' ) ;
604
604
if ( ret . stderr && ret . stderr . length > 0 )
605
605
msg += `\n${ ret . stderr . toString ( ) } ` ;
0 commit comments