@@ -55,10 +55,10 @@ function fork(modulePath /* , args, options */) {
5555 validateString ( modulePath , 'modulePath' ) ;
5656
5757 // 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 ;
6262 if ( pos < arguments . length && Array . isArray ( arguments [ pos ] ) ) {
6363 args = arguments [ pos ++ ] ;
6464 }
@@ -231,23 +231,23 @@ function execFile(file /* , args, options, callback */) {
231231 windowsVerbatimArguments : ! ! options . windowsVerbatimArguments
232232 } ) ;
233233
234- var encoding ;
234+ let encoding ;
235235 const _stdout = [ ] ;
236236 const _stderr = [ ] ;
237237 if ( options . encoding !== 'buffer' && Buffer . isEncoding ( options . encoding ) ) {
238238 encoding = options . encoding ;
239239 } else {
240240 encoding = null ;
241241 }
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 ;
247247
248- var ex = null ;
248+ let ex = null ;
249249
250- var cmd = file ;
250+ let cmd = file ;
251251
252252 function exithandler ( code , signal ) {
253253 if ( exited ) return ;
@@ -261,8 +261,8 @@ function execFile(file /* , args, options, callback */) {
261261 if ( ! callback ) return ;
262262
263263 // merge chunks
264- var stdout ;
265- var stderr ;
264+ let stdout ;
265+ let stderr ;
266266 if ( encoding ||
267267 (
268268 child . stdout &&
@@ -580,15 +580,15 @@ function spawnSync(file, args, options) {
580580 options . stdio = getValidStdio ( options . stdio || 'pipe' , true ) . stdio ;
581581
582582 if ( options . input ) {
583- var stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
583+ const stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
584584 stdin . input = options . input ;
585585 }
586586
587587 // 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 ;
590590 if ( input != null ) {
591- var pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
591+ const pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
592592 if ( isArrayBufferView ( input ) ) {
593593 pipe . input = input ;
594594 } else if ( typeof input === 'string' ) {
@@ -609,11 +609,11 @@ function spawnSync(file, args, options) {
609609
610610
611611function checkExecSyncError ( ret , args , cmd ) {
612- var err ;
612+ let err ;
613613 if ( ret . error ) {
614614 err = ret . error ;
615615 } else if ( ret . status !== 0 ) {
616- var msg = 'Command failed: ' ;
616+ let msg = 'Command failed: ' ;
617617 msg += cmd || args . join ( ' ' ) ;
618618 if ( ret . stderr && ret . stderr . length > 0 )
619619 msg += `\n${ ret . stderr . toString ( ) } ` ;
0 commit comments