Call toPath on sourceRoot to ensure it is always absolute (#25838)

* Call toPath on sourceRoot to ensure it is always absolute

* Leave canonicalization to avoid a Path/string union
This commit is contained in:
Wesley Wigham
2018-07-24 14:14:41 -07:00
committed by GitHub
parent 59854bbd55
commit 797d8bd07b
2 changed files with 41 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ namespace ts.sourcemaps {
export function decode(host: SourceMapDecodeHost, mapPath: string, map: SourceMapData, program?: Program, fallbackCache = createSourceFileLikeCache(host)): SourceMapper {
const currentDirectory = getDirectoryPath(mapPath);
const sourceRoot = map.sourceRoot || currentDirectory;
const sourceRoot = map.sourceRoot ? getNormalizedAbsolutePath(map.sourceRoot, currentDirectory) : currentDirectory;
let decodedMappings: ProcessedSourceMapPosition[];
let generatedOrderedMappings: ProcessedSourceMapPosition[];
let sourceOrderedMappings: ProcessedSourceMapPosition[];