mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
remove unused createNewInstance support
This commit is contained in:
@@ -44,10 +44,10 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
// Everything declared here should be cleared out in the "after" callback.
|
||||
let justName: string;
|
||||
let content: string;
|
||||
let testCaseContent: { settings: Harness.TestCaseParser.CompilerSetting[]; testUnitData: Harness.TestCaseParser.TestUnitData[]; };
|
||||
let testCaseContent: { settings: Harness.TestCaseParser.CompilerSettings; testUnitData: Harness.TestCaseParser.TestUnitData[]; };
|
||||
|
||||
let units: Harness.TestCaseParser.TestUnitData[];
|
||||
let tcSettings: Harness.TestCaseParser.CompilerSetting[];
|
||||
let tcSettings: Harness.TestCaseParser.CompilerSettings;
|
||||
|
||||
let lastUnit: Harness.TestCaseParser.TestUnitData;
|
||||
let rootDir: string;
|
||||
@@ -61,15 +61,12 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
let otherFiles: { unitName: string; content: string }[];
|
||||
let harnessCompiler: Harness.Compiler.HarnessCompiler;
|
||||
|
||||
let createNewInstance = false;
|
||||
|
||||
before(() => {
|
||||
justName = fileName.replace(/^.*[\\\/]/, ""); // strips the fileName from the path.
|
||||
content = Harness.IO.readFile(fileName);
|
||||
testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName);
|
||||
units = testCaseContent.testUnitData;
|
||||
tcSettings = testCaseContent.settings;
|
||||
createNewInstance = false;
|
||||
lastUnit = units[units.length - 1];
|
||||
rootDir = lastUnit.originalFilePath.indexOf("conformance") === -1 ? "tests/cases/compiler/" : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf("/")) + "/";
|
||||
harnessCompiler = Harness.Compiler.getCompiler();
|
||||
@@ -100,27 +97,6 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
/* The compiler doesn't handle certain flags flipping during a single compilation setting. Tests on these flags will need
|
||||
a fresh compiler instance for themselves and then create a fresh one for the next test. Would be nice to get dev fixes
|
||||
eventually to remove this limitation. */
|
||||
for (let 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();
|
||||
harnessCompiler.setCompilerSettings(tcSettings);
|
||||
createNewInstance = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (createNewInstance) {
|
||||
harnessCompiler = Harness.Compiler.getCompiler();
|
||||
createNewInstance = false;
|
||||
}
|
||||
});
|
||||
|
||||
after(() => {
|
||||
// Mocha holds onto the closure environment of the describe callback even after the test is done.
|
||||
// Therefore we have to clean out large objects after the test is done.
|
||||
@@ -402,10 +378,6 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
else {
|
||||
this.tests.forEach(test => this.checkTestCodeOutput(test));
|
||||
}
|
||||
|
||||
describe("Cleanup after compiler baselines", () => {
|
||||
let harnessCompiler = Harness.Compiler.getCompiler();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user