Merge pull request #21205 from uniqueiniquity/resolveTripleSlashReferencePaths

Fix Windows-style absolute paths in triple-slash directives
This commit is contained in:
Benjamin Lichtman
2018-01-17 12:31:46 -08:00
committed by GitHub
6 changed files with 69 additions and 1 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',