Merge pull request #19824 from Microsoft/fix-rwc-lib-in-tsconfig

Fix RWC's handling of "lib" from tsconfig
This commit is contained in:
Nathan Shively-Sanders 2017-11-08 08:28:32 -08:00 committed by GitHub
commit 7a45573311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -2146,8 +2146,8 @@ namespace Harness {
return filePath.indexOf(Harness.libFolder) === 0;
}
export function getDefaultLibraryFile(io: Harness.Io): Harness.Compiler.TestFile {
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + Harness.Compiler.defaultLibFileName;
export function getDefaultLibraryFile(filePath: string, io: Harness.Io): Harness.Compiler.TestFile {
const libFile = Harness.userSpecifiedRoot + Harness.libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath));
return { unitName: libFile, content: io.readFile(libFile) };
}

View file

@ -131,13 +131,14 @@ namespace RWC {
}
else {
// set the flag to put default library to the beginning of the list
inputFiles.unshift(Harness.getDefaultLibraryFile(oldIO));
inputFiles.unshift(Harness.getDefaultLibraryFile(fileRead.path, oldIO));
}
}
}
}
// do not use lib since we already read it in above
opts.options.lib = undefined;
opts.options.noLib = true;
// Emit the results