Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Correctly compare paths to files in the current directory. #152

Merged
merged 1 commit into from
Jun 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ function createSourceReplacingCompilerHost(
fileName: string, languageVersion: ts.ScriptTarget,
onError?: (message: string) => void): ts.SourceFile {
let sourceText: string;
if (substituteSource.hasOwnProperty(fileName)) {
sourceText = substituteSource[fileName];
return ts.createSourceFile(fileName, sourceText, languageVersion);
let path: string = ts.sys.resolvePath(fileName);
if (substituteSource.hasOwnProperty(path)) {
sourceText = substituteSource[path];
return ts.createSourceFile(path, sourceText, languageVersion);
}
return delegate.getSourceFile(fileName, languageVersion, onError);
return delegate.getSourceFile(path, languageVersion, onError);
}
}

Expand Down Expand Up @@ -182,7 +183,7 @@ function toClosureJS(options: ts.CompilerOptions, fileNames: string[]):
if (diagnostics.length > 0) {
return {errors: diagnostics};
}
tsickleOutput[fileName] = output;
tsickleOutput[ts.sys.resolvePath(fileName)] = output;
if (externs) {
tsickleExterns += externs;
}
Expand Down