mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
remove unused arguments for getCompiler
This commit is contained in:
parent
13a6487cd3
commit
00bfc06bc7
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user