File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -506,21 +506,20 @@ const win32 = {
506506 if ( args . length === 0 )
507507 return '.' ;
508508
509- let joined ;
510- let firstPart ;
509+ const path = [ ] ;
511510 for ( let i = 0 ; i < args . length ; ++ i ) {
512511 const arg = args [ i ] ;
513512 validateString ( arg , 'path' ) ;
514513 if ( arg . length > 0 ) {
515- if ( joined === undefined )
516- joined = firstPart = arg ;
517- else
518- joined += `\\${ arg } ` ;
514+ path . push ( arg ) ;
519515 }
520516 }
521517
522- if ( joined === undefined )
518+ if ( path . length === 0 )
523519 return '.' ;
520+
521+ const firstPart = path [ 0 ] ;
522+ let joined = ArrayPrototypeJoin ( path , '\\' ) ;
524523
525524 // Make sure that the joined path doesn't start with two slashes, because
526525 // normalize() will mistake it for a UNC path then.
You can’t perform that action at this time.
0 commit comments