@@ -1598,10 +1598,7 @@ if (isWindows) {
15981598
15991599const emptyObj = ObjectCreate ( null ) ;
16001600function realpathSync ( p , options ) {
1601- if ( ! options )
1602- options = emptyObj ;
1603- else
1604- options = getOptions ( options , emptyObj ) ;
1601+ options = getOptions ( options , emptyObj ) ;
16051602 p = toPathIfFileURL ( p ) ;
16061603 if ( typeof p !== 'string' ) {
16071604 p += '' ;
@@ -1633,7 +1630,7 @@ function realpathSync(p, options) {
16331630 pos = current . length ;
16341631
16351632 // On windows, check that the root exists. On unix there is no need.
1636- if ( isWindows && ! knownHard [ base ] ) {
1633+ if ( isWindows ) {
16371634 const ctx = { path : base } ;
16381635 binding . lstat ( pathModule . toNamespacedPath ( base ) , false , undefined , ctx ) ;
16391636 handleErrorFromBinding ( ctx ) ;
@@ -1831,7 +1828,7 @@ function realpath(p, options, callback) {
18311828 const ino = stats . ino . toString ( 32 ) ;
18321829 id = `${ dev } :${ ino } ` ;
18331830 if ( seenLinks [ id ] ) {
1834- return gotTarget ( null , seenLinks [ id ] , base ) ;
1831+ return gotTarget ( null , seenLinks [ id ] ) ;
18351832 }
18361833 }
18371834 fs . stat ( base , ( err ) => {
@@ -1844,7 +1841,7 @@ function realpath(p, options, callback) {
18441841 } ) ;
18451842 }
18461843
1847- function gotTarget ( err , target , base ) {
1844+ function gotTarget ( err , target ) {
18481845 if ( err ) return callback ( err ) ;
18491846
18501847 gotResolvedLink ( pathModule . resolve ( previous , target ) ) ;
0 commit comments