@@ -383,12 +383,11 @@ module ts {
383
383
return [ path . substr ( 0 , rootLength ) ] . concat ( normalizedParts ) ;
384
384
}
385
385
386
- export function getNormalizedPathComponents ( path : string , getCurrentDirectory : ( ) => string ) {
386
+ export function getNormalizedPathComponents ( path : string , currentDirectory : string ) {
387
387
var path = normalizeSlashes ( path ) ;
388
388
var rootLength = getRootLength ( path ) ;
389
389
if ( rootLength == 0 ) {
390
390
// If the path is not rooted it is relative to current directory
391
- var currentDirectory = getCurrentDirectory ( ) ;
392
391
path = combinePaths ( normalizeSlashes ( currentDirectory ) , path ) ;
393
392
rootLength = getRootLength ( path ) ;
394
393
}
@@ -444,18 +443,18 @@ module ts {
444
443
}
445
444
}
446
445
447
- function getNormalizedPathOrUrlComponents ( pathOrUrl : string , getCurrentDirectory : ( ) => string ) {
446
+ function getNormalizedPathOrUrlComponents ( pathOrUrl : string , currentDirectory : string ) {
448
447
if ( isUrl ( pathOrUrl ) ) {
449
448
return getNormalizedPathComponentsOfUrl ( pathOrUrl ) ;
450
449
}
451
450
else {
452
- return getNormalizedPathComponents ( pathOrUrl , getCurrentDirectory ) ;
451
+ return getNormalizedPathComponents ( pathOrUrl , currentDirectory ) ;
453
452
}
454
453
}
455
454
456
- export function getRelativePathToDirectoryOrUrl ( directoryPathOrUrl : string , relativeOrAbsolutePath : string , getCurrentDirectory : ( ) => string , isAbsolutePathAnUrl : boolean ) {
457
- var pathComponents = getNormalizedPathOrUrlComponents ( relativeOrAbsolutePath , getCurrentDirectory ) ;
458
- var directoryComponents = getNormalizedPathOrUrlComponents ( directoryPathOrUrl , getCurrentDirectory ) ;
455
+ export function getRelativePathToDirectoryOrUrl ( directoryPathOrUrl : string , relativeOrAbsolutePath : string , currentDirectory : string , isAbsolutePathAnUrl : boolean ) {
456
+ var pathComponents = getNormalizedPathOrUrlComponents ( relativeOrAbsolutePath , currentDirectory ) ;
457
+ var directoryComponents = getNormalizedPathOrUrlComponents ( directoryPathOrUrl , currentDirectory ) ;
459
458
if ( directoryComponents . length > 1 && directoryComponents [ directoryComponents . length - 1 ] === "" ) {
460
459
// If the directory path given was of type test/cases/ then we really need components of directory to be only till its name
461
460
// that is ["test", "cases", ""] needs to be actually ["test", "cases"]
0 commit comments