File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,7 +471,7 @@ const win32 = {
471471 } while ( ( index = StringPrototypeIndexOf ( path , ':' , index + 1 ) ) !== - 1 ) ;
472472 }
473473 const colonIndex = StringPrototypeIndexOf ( path , ':' ) ;
474- if ( colonIndex !== - 1 && isWindowsReservedName ( path , colonIndex ) ) {
474+ if ( isWindowsReservedName ( path , colonIndex ) ) {
475475 return `.\\${ device ?? '' } ${ tail } ` ;
476476 }
477477 if ( device === undefined ) {
Original file line number Diff line number Diff line change @@ -69,17 +69,6 @@ assert.strictEqual(path.win32.normalize('//server/share/dir/../../../?/D:/file')
6969assert . strictEqual ( path . win32 . normalize ( '//server/goodshare/../badshare/file' ) ,
7070 '\\\\server\\goodshare\\badshare\\file' ) ;
7171
72- // A path is only a Windows reserved device name when the reserved name is
73- // followed by a colon. A name that merely starts with a reserved name (and has
74- // no colon) must be left untouched and not be prefixed with `.\`.
75- assert . strictEqual ( path . win32 . normalize ( 'CONx' ) , 'CONx' ) ;
76- assert . strictEqual ( path . win32 . normalize ( 'NULs' ) , 'NULs' ) ;
77- assert . strictEqual ( path . win32 . normalize ( 'LPT1x' ) , 'LPT1x' ) ;
78- assert . strictEqual ( path . win32 . normalize ( 'PRNzzz' ) , 'PRNzzz' ) ;
79- assert . strictEqual ( path . win32 . normalize ( 'CON' ) , 'CON' ) ;
80- // With a trailing colon the reserved-name handling still applies.
81- assert . strictEqual ( path . win32 . normalize ( 'CON:' ) , '.\\CON:.' ) ;
82-
8372assert . strictEqual ( path . posix . normalize ( './fixtures///b/../b/c.js' ) ,
8473 'fixtures/b/c.js' ) ;
8574assert . strictEqual ( path . posix . normalize ( '/foo/../../../bar' ) , '/bar' ) ;
You can’t perform that action at this time.
0 commit comments