@@ -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 &&
@@ -562,15 +562,15 @@ function spawnSync(file, args, options) {
562562 options . stdio = getValidStdio ( options . stdio || 'pipe' , true ) . stdio ;
563563
564564 if ( options . input ) {
565- var stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
565+ const stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
566566 stdin . input = options . input ;
567567 }
568568
569569 // We may want to pass data in on any given fd, ensure it is a valid buffer
570- for ( var i = 0 ; i < options . stdio . length ; i ++ ) {
571- var input = options . stdio [ i ] && options . stdio [ i ] . input ;
570+ for ( let i = 0 ; i < options . stdio . length ; i ++ ) {
571+ const input = options . stdio [ i ] && options . stdio [ i ] . input ;
572572 if ( input != null ) {
573- var pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
573+ const pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
574574 if ( isArrayBufferView ( input ) ) {
575575 pipe . input = input ;
576576 } else if ( typeof input === 'string' ) {
@@ -591,11 +591,11 @@ function spawnSync(file, args, options) {
591591
592592
593593function checkExecSyncError ( ret , args , cmd ) {
594- var err ;
594+ let err ;
595595 if ( ret . error ) {
596596 err = ret . error ;
597597 } else if ( ret . status !== 0 ) {
598- var msg = 'Command failed: ' ;
598+ let msg = 'Command failed: ' ;
599599 msg += cmd || args . join ( ' ' ) ;
600600 if ( ret . stderr && ret . stderr . length > 0 )
601601 msg += `\n${ ret . stderr . toString ( ) } ` ;
0 commit comments