mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove target=es3 (#57525)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: [{
|
||||
|
||||
Reference in New Issue
Block a user