Skip to content

Commit ae582a2

Browse files
saschanazorta
andauthoredNov 4, 2021
Add target: "es2022" (#46291)
* Add `target: "es2022"` * Add Object.hasOwn * formatToParts is es2018 * ref update * optional parameter * Revert "optional parameter" This reverts commit e67d6e5. * undefined * error cause * Lint fix Co-authored-by: Orta <git@orta.io>
1 parent ff75b8a commit ae582a2

File tree

57 files changed

+973
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+973
-47
lines changed
 

‎src/compiler/commandLineParser.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace ts {
2929
["es2019", "lib.es2019.d.ts"],
3030
["es2020", "lib.es2020.d.ts"],
3131
["es2021", "lib.es2021.d.ts"],
32+
["es2022", "lib.es2022.d.ts"],
3233
["esnext", "lib.esnext.d.ts"],
3334
// Host only
3435
["dom", "lib.dom.d.ts"],
@@ -72,12 +73,16 @@ namespace ts {
7273
["es2021.string", "lib.es2021.string.d.ts"],
7374
["es2021.weakref", "lib.es2021.weakref.d.ts"],
7475
["es2021.intl", "lib.es2021.intl.d.ts"],
75-
["esnext.array", "lib.es2019.array.d.ts"],
76+
["es2022.array", "lib.es2022.array.d.ts"],
77+
["es2022.error", "lib.es2022.error.d.ts"],
78+
["es2022.object", "lib.es2022.object.d.ts"],
79+
["es2022.string", "lib.es2022.string.d.ts"],
80+
["esnext.array", "lib.es2022.array.d.ts"],
7681
["esnext.symbol", "lib.es2019.symbol.d.ts"],
7782
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
7883
["esnext.intl", "lib.esnext.intl.d.ts"],
7984
["esnext.bigint", "lib.es2020.bigint.d.ts"],
80-
["esnext.string", "lib.es2021.string.d.ts"],
85+
["esnext.string", "lib.es2022.string.d.ts"],
8186
["esnext.promise", "lib.es2021.promise.d.ts"],
8287
["esnext.weakref", "lib.es2021.weakref.d.ts"]
8388
];
@@ -314,6 +319,7 @@ namespace ts {
314319
es2019: ScriptTarget.ES2019,
315320
es2020: ScriptTarget.ES2020,
316321
es2021: ScriptTarget.ES2021,
322+
es2022: ScriptTarget.ES2022,
317323
esnext: ScriptTarget.ESNext,
318324
})),
319325
affectsSourceFile: true,

‎src/compiler/types.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -6268,6 +6268,7 @@ namespace ts {
62686268
ES2019 = 6,
62696269
ES2020 = 7,
62706270
ES2021 = 8,
6271+
ES2022 = 9,
62716272
ESNext = 99,
62726273
JSON = 100,
62736274
Latest = ESNext,
@@ -6725,15 +6726,16 @@ namespace ts {
67256726
ContainsTypeScript = 1 << 0,
67266727
ContainsJsx = 1 << 1,
67276728
ContainsESNext = 1 << 2,
6728-
ContainsES2021 = 1 << 3,
6729-
ContainsES2020 = 1 << 4,
6730-
ContainsES2019 = 1 << 5,
6731-
ContainsES2018 = 1 << 6,
6732-
ContainsES2017 = 1 << 7,
6733-
ContainsES2016 = 1 << 8,
6734-
ContainsES2015 = 1 << 9,
6735-
ContainsGenerator = 1 << 10,
6736-
ContainsDestructuringAssignment = 1 << 11,
6729+
ContainsES2022 = 1 << 3,
6730+
ContainsES2021 = 1 << 4,
6731+
ContainsES2020 = 1 << 5,
6732+
ContainsES2019 = 1 << 6,
6733+
ContainsES2018 = 1 << 7,
6734+
ContainsES2017 = 1 << 8,
6735+
ContainsES2016 = 1 << 9,
6736+
ContainsES2015 = 1 << 10,
6737+
ContainsGenerator = 1 << 11,
6738+
ContainsDestructuringAssignment = 1 << 12,
67376739

67386740
// Markers
67396741
// - Flags used to indicate that a subtree contains a specific transformation.
@@ -6762,6 +6764,7 @@ namespace ts {
67626764
AssertTypeScript = ContainsTypeScript,
67636765
AssertJsx = ContainsJsx,
67646766
AssertESNext = ContainsESNext,
6767+
AssertES2022 = ContainsES2022,
67656768
AssertES2021 = ContainsES2021,
67666769
AssertES2020 = ContainsES2020,
67676770
AssertES2019 = ContainsES2019,

0 commit comments

Comments
 (0)