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,
@@ -521,22 +522,21 @@ const win32 = {
521522 if ( args . length === 0 )
522523 return '.' ;
523524
524- let joined ;
525- let firstPart ;
525+ const path = [ ] ;
526526 for ( let i = 0 ; i < args . length ; ++ i ) {
527527 const arg = args [ i ] ;
528528 validateString ( arg , 'path' ) ;
529529 if ( arg . length > 0 ) {
530- if ( joined === undefined )
531- joined = firstPart = arg ;
532- else
533- joined += `\\${ arg } ` ;
530+ ArrayPrototypePush ( path , arg ) ;
534531 }
535532 }
536533
537- if ( joined === undefined )
534+ if ( path . length === 0 )
538535 return '.' ;
539536
537+ const firstPart = path [ 0 ] ;
538+ let joined = ArrayPrototypeJoin ( path , '\\' ) ;
539+
540540 // Make sure that the joined path doesn't start with two slashes, because
541541 // normalize() will mistake it for a UNC path then.
542542 //
You can’t perform that action at this time.
0 commit comments