@@ -55,10 +55,10 @@ function fork(modulePath /* , args, options */){
5555validateString ( 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 ;
6262if ( pos < arguments . length && Array . isArray ( arguments [ pos ] ) ) {
6363args = arguments [ pos ++ ] ;
6464}
@@ -231,23 +231,23 @@ function execFile(file /* , args, options, callback */){
231231windowsVerbatimArguments : ! ! options . windowsVerbatimArguments
232232} ) ;
233233
234- var encoding ;
234+ let encoding ;
235235const _stdout = [ ] ;
236236const _stderr = [ ] ;
237237if ( options . encoding !== 'buffer' && Buffer . isEncoding ( options . encoding ) ) {
238238encoding = options . encoding ;
239239} else {
240240encoding = 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
252252function exithandler ( code , signal ) {
253253if ( exited ) return ;
@@ -261,8 +261,8 @@ function execFile(file /* , args, options, callback */){
261261if ( ! callback ) return ;
262262
263263// merge chunks
264- var stdout ;
265- var stderr ;
264+ let stdout ;
265+ let stderr ;
266266if ( encoding ||
267267(
268268child . stdout &&
@@ -562,15 +562,15 @@ function spawnSync(file, args, options){
562562options . stdio = getValidStdio ( options . stdio || 'pipe' , true ) . stdio ;
563563
564564if ( options . input ) {
565- var stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
565+ const stdin = options . stdio [ 0 ] = { ...options . stdio [ 0 ] } ;
566566stdin . 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 ;
572572if ( input != null ) {
573- var pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
573+ const pipe = options . stdio [ i ] = { ...options . stdio [ i ] } ;
574574if ( isArrayBufferView ( input ) ) {
575575pipe . 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 ;
595595if ( ret . error ) {
596596err = ret . error ;
597597} else if ( ret . status !== 0 ) {
598- var msg = 'Command failed: ' ;
598+ let msg = 'Command failed: ' ;
599599msg += cmd || args . join ( ' ' ) ;
600600if ( ret . stderr && ret . stderr . length > 0 )
601601msg += `\n${ ret . stderr . toString ( ) } ` ;
0 commit comments