Revert path normalization in favor of checking for backslash

This commit is contained in:
uniqueiniquity 2018-01-16 17:04:14 -08:00
parent 5ea43db6ec
commit 5320ce2552
2 changed files with 2 additions and 3 deletions

View File

@ -1909,7 +1909,7 @@ namespace ts {
return p2 + 1;
}
if (path.charCodeAt(1) === CharacterCodes.colon) {
if (path.charCodeAt(2) === CharacterCodes.slash) return 3;
if (path.charCodeAt(2) === CharacterCodes.slash || path.charCodeAt(2) === CharacterCodes.backslash) return 3;
}
// Per RFC 1738 'file' URI schema has the shape file://<host>/<path>
// if <host> is omitted then it is assumed that host value is 'localhost',

View File

@ -15,8 +15,7 @@ namespace ts {
export function resolveTripleslashReference(moduleName: string, containingFile: string): string {
const basePath = getDirectoryPath(containingFile);
const normalizedModuleName = normalizePath(moduleName);
const referencedFileName = isRootedDiskPath(normalizedModuleName) ? normalizedModuleName : combinePaths(basePath, normalizedModuleName);
const referencedFileName = isRootedDiskPath(moduleName) ? moduleName : combinePaths(basePath, moduleName);
return normalizePath(referencedFileName);
}