File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 2424const {
2525 ArrayPrototypeIncludes,
2626 ArrayPrototypeJoin,
27+ ArrayPrototypePush,
2728 ArrayPrototypeSlice,
2829 FunctionPrototypeBind,
2930 StringPrototypeCharCodeAt,
@@ -506,22 +507,21 @@ const win32 = {
506507 if ( args . length === 0 )
507508 return '.' ;
508509
509- let joined ;
510- let firstPart ;
510+ const path = [ ] ;
511511 for ( let i = 0 ; i < args . length ; ++ i ) {
512512 const arg = args [ i ] ;
513513 validateString ( arg , 'path' ) ;
514514 if ( arg . length > 0 ) {
515- if ( joined === undefined )
516- joined = firstPart = arg ;
517- else
518- joined += `\\${ arg } ` ;
515+ ArrayPrototypePush ( path , arg ) ;
519516 }
520517 }
521518
522- if ( joined === undefined )
519+ if ( path . length === 0 )
523520 return '.' ;
524521
522+ const firstPart = path [ 0 ] ;
523+ let joined = ArrayPrototypeJoin ( path , '\\' ) ;
524+
525525 // Make sure that the joined path doesn't start with two slashes, because
526526 // normalize() will mistake it for a UNC path then.
527527 //
You can’t perform that action at this time.
0 commit comments