diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index fc6d65b45e9..232360116f3 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -87,7 +87,7 @@ namespace ts { if (diagnostic.file) { let loc = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); const relativeFileName = host - ? toRelativePath(diagnostic.file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName)) + ? convertToRelativePath(diagnostic.file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName)) : diagnostic.file.fileName; output += `${ relativeFileName }(${ loc.line + 1 },${ loc.character + 1 }): `; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index fb6d2686b15..fd991039d3e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2182,7 +2182,7 @@ namespace ts { return result; } - export function toRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string { + export function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string { return !isRootedDiskPath(absoluteOrRelativePath) ? absoluteOrRelativePath : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /* isAbsolutePathAnUrl */ false); diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 52d4b85f6b8..e587aad3ddb 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -377,10 +377,10 @@ class ProjectRunner extends RunnerBase { bug: testCase.bug, rootDir: testCase.rootDir, resolvedInputFiles: ts.map(compilerResult.program.getSourceFiles(), inputFile => { - return ts.toRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); + return ts.convertToRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); }), emittedFiles: ts.map(compilerResult.outputFiles, outputFile => { - return ts.toRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); + return ts.convertToRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); }) };