remove unused arguments for getCompiler

This commit is contained in:
Mohamed Hegazy 2014-11-10 17:33:30 -08:00
parent 13a6487cd3
commit 00bfc06bc7
3 changed files with 6 additions and 26 deletions

View File

@ -10,7 +10,7 @@ const enum CompilerTestType {
}
class CompilerBaselineRunner extends RunnerBase {
private basePath = 'tests/cases';
protected basePath = 'tests/cases';
private errors: boolean;
private emit: boolean;
private decl: boolean;
@ -113,10 +113,7 @@ class CompilerBaselineRunner extends RunnerBase {
for (var i = 0; i < tcSettings.length; ++i) {
// noImplicitAny is passed to getCompiler, but target is just passed in the settings blob to setCompilerSettings
if (!createNewInstance && (tcSettings[i].flag == "noimplicitany" || tcSettings[i].flag === 'target')) {
harnessCompiler = Harness.Compiler.getCompiler({
useExistingInstance: false,
optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: tcSettings[i].flag === "noimplicitany" }
});
harnessCompiler = Harness.Compiler.getCompiler();
harnessCompiler.setCompilerSettings(tcSettings);
createNewInstance = true;
}
@ -125,10 +122,7 @@ class CompilerBaselineRunner extends RunnerBase {
afterEach(() => {
if (createNewInstance) {
harnessCompiler = Harness.Compiler.getCompiler({
useExistingInstance: false,
optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false }
});
harnessCompiler = Harness.Compiler.getCompiler();
createNewInstance = false;
}
});
@ -312,10 +306,7 @@ class CompilerBaselineRunner extends RunnerBase {
public initializeTests() {
describe("Setup compiler for compiler baselines", () => {
var harnessCompiler = Harness.Compiler.getCompiler({
useExistingInstance: false,
optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false }
});
var harnessCompiler = Harness.Compiler.getCompiler();
this.parseOptions();
});
@ -332,10 +323,7 @@ class CompilerBaselineRunner extends RunnerBase {
}
describe("Cleanup after compiler baselines", () => {
var harnessCompiler = Harness.Compiler.getCompiler({
useExistingInstance: false,
optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false }
});
var harnessCompiler = Harness.Compiler.getCompiler();
});
}

View File

@ -15,10 +15,6 @@ class FourslashRunner extends RunnerBase {
}
describe("fourslash tests", () => {
before(() => {
Harness.Compiler.getCompiler({ useExistingInstance: false });
});
this.tests.forEach((fn: string) => {
fn = ts.normalizeSlashes(fn);
var justName = fn.replace(/^.*[\\\/]/, '');
@ -33,10 +29,6 @@ class FourslashRunner extends RunnerBase {
});
}
});
after(() => {
Harness.Compiler.getCompiler({ useExistingInstance: false });
});
});
describe('Generate Tao XML', () => {

View File

@ -1029,7 +1029,7 @@ module Harness {
/** Returns the singleton harness compiler instance for generating and running tests.
If required a fresh compiler instance will be created, otherwise the existing singleton will be re-used.
*/
export function getCompiler(opts?: { useExistingInstance: boolean; optionsForFreshInstance?: { useMinimalDefaultLib: boolean; noImplicitAny: boolean; } }) {
export function getCompiler() {
return harnessCompiler = harnessCompiler || new HarnessCompiler();
}