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 24
24
const {
25
25
ArrayPrototypeIncludes,
26
26
ArrayPrototypeJoin,
27
+ ArrayPrototypePush,
27
28
ArrayPrototypeSlice,
28
29
FunctionPrototypeBind,
29
30
StringPrototypeCharCodeAt,
@@ -521,22 +522,21 @@ const win32 = {
521
522
if ( args . length === 0 )
522
523
return '.' ;
523
524
524
- let joined ;
525
- let firstPart ;
525
+ const path = [ ] ;
526
526
for ( let i = 0 ; i < args . length ; ++ i ) {
527
527
const arg = args [ i ] ;
528
528
validateString ( arg , 'path' ) ;
529
529
if ( arg . length > 0 ) {
530
- if ( joined === undefined )
531
- joined = firstPart = arg ;
532
- else
533
- joined += `\\${ arg } ` ;
530
+ ArrayPrototypePush ( path , arg ) ;
534
531
}
535
532
}
536
533
537
- if ( joined === undefined )
534
+ if ( path . length === 0 )
538
535
return '.' ;
539
536
537
+ const firstPart = path [ 0 ] ;
538
+ let joined = ArrayPrototypeJoin ( path , '\\' ) ;
539
+
540
540
// Make sure that the joined path doesn't start with two slashes, because
541
541
// normalize() will mistake it for a UNC path then.
542
542
//
You can’t perform that action at this time.
0 commit comments