Fix file path resolution in RWC

This commit is contained in:
Yui T 2015-03-09 15:10:47 -07:00
parent 5556683227
commit 4c7891ce09
2 changed files with 3 additions and 12 deletions

View file

@ -152,7 +152,7 @@ class CompilerBaselineRunner extends RunnerBase {
if (this.errors) {
Harness.Baseline.runBaseline('Correct errors for ' + fileName, justName.replace(/\.ts$/, '.errors.txt'), (): string => {
if (result.errors.length === 0) return null;
debugger;
return getErrorBaseline(toBeCompiled, otherFiles, result);
});
}

View file

@ -835,7 +835,7 @@ module Harness {
// Register input files
function register(file: { unitName: string; content: string; }) {
if (file.content !== undefined) {
var fileName = ts.normalizeSlashes(file.unitName);
var fileName = ts.normalizePath(file.unitName);
filemap[getCanonicalFileName(fileName)] = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget);
}
};
@ -844,6 +844,7 @@ module Harness {
return {
getCurrentDirectory,
getSourceFile: (fn, languageVersion) => {
fn = ts.normalizePath(fn);
if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) {
return filemap[getCanonicalFileName(fn)];
}
@ -1078,16 +1079,6 @@ module Harness {
}
});
var filemap: { [name: string]: ts.SourceFile; } = {};
var register = (file: { unitName: string; content: string; }) => {
if (file.content !== undefined) {
var fileName = ts.normalizeSlashes(file.unitName);
filemap[getCanonicalFileName(fileName)] = createSourceFileAndAssertInvariants(fileName, file.content, options.target, assertInvariants);
}
};
inputFiles.forEach(register);
otherFiles.forEach(register);
var fileOutputs: GeneratedFile[] = [];
var programFiles = inputFiles.map(file => file.unitName);