Remove target=es3 (#57525)

This commit is contained in:
Jake Bailey
2024-02-27 11:40:18 -08:00
committed by GitHub
parent 23156cb970
commit 65de938e4e
397 changed files with 324 additions and 2291 deletions
@@ -24,7 +24,7 @@ describe("unittests:: services:: DocumentRegistry", () => {
assert(f1 === f2, "Expected to have the same document instance");
// change value of compilation setting that is used during production of AST - new document is required
compilerOptions.target = ts.ScriptTarget.ES3;
compilerOptions.target = ts.ScriptTarget.ESNext;
const f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), /* version */ "1");
assert(f1 !== f3, "Changed target: Expected to have different instances of document");
@@ -20,7 +20,7 @@ describe("unittests:: services:: Transpile", () => {
transpileOptions.compilerOptions = {};
}
if (transpileOptions.compilerOptions.target === undefined) {
transpileOptions.compilerOptions.target = ts.ScriptTarget.ES3;
transpileOptions.compilerOptions.target = ts.ScriptTarget.ES5;
}
if (transpileOptions.compilerOptions.newLine === undefined) {
+2 -2
View File
@@ -592,13 +592,13 @@ module MyModule {
// https://github.com/Microsoft/TypeScript/issues/24709
testBaseline("issue24709", () => {
const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ true);
const transformed = ts.transform(ts.createSourceFile("source.ts", "class X { echo(x: string) { return x; } }", ts.ScriptTarget.ES3), [transformSourceFile]);
const transformed = ts.transform(ts.createSourceFile("source.ts", "class X { echo(x: string) { return x; } }", ts.ScriptTarget.ES5), [transformSourceFile]);
const transformedSourceFile = transformed.transformed[0];
transformed.dispose();
const host = new fakes.CompilerHost(fs);
host.getSourceFile = () => transformedSourceFile;
const program = ts.createProgram(["source.ts"], {
target: ts.ScriptTarget.ES3,
target: ts.ScriptTarget.ES5,
module: ts.ModuleKind.None,
noLib: true,
}, host);
+1 -1
View File
@@ -282,7 +282,7 @@ describe("unittests:: tsbuild:: on 'sample1' project", () => {
fs: () => projFs,
commandLineArgs: ["--b", "tests", "--verbose"],
modifyFs: fs => {
fs.writeFileSync("tests/tsconfig.base.json", jsonToReadableText({ compilerOptions: { target: "es3" } }));
fs.writeFileSync("tests/tsconfig.base.json", jsonToReadableText({ compilerOptions: { target: "es5" } }));
replaceText(fs, "tests/tsconfig.json", `"references": [`, `"extends": "./tsconfig.base.json", "references": [`);
},
edits: [{