Skip to content

Commit e3c5cc6

Browse files
billyjanitschtypescript-bot
authored andcommitted
Fix library inclusions for ES2024 target (#60622)
1 parent 97fa216 commit e3c5cc6

File tree

54 files changed

+2659
-62
lines changed

Some content is hidden

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

54 files changed

+2659
-62
lines changed

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ export const inverseJsxOptionMap: Map<string, string> = new Map(mapIterator(jsxO
147147
// augmented in another lib.
148148
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
149149
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
150-
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
151-
// lib/esnext.*.d.ts file.
150+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
151+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
152152
const libEntries: [string, string][] = [
153153
// JavaScript only
154154
["es5", "lib.es5.d.ts"],

src/compiler/transformers/esnext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ const enum UsingKind {
7474
export function transformESNext(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle {
7575
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
7676
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
77-
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
78-
// lib/esnext.*.d.ts file.
77+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
78+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
7979

8080
const {
8181
factory,

src/compiler/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7580,8 +7580,8 @@ export const enum ScriptKind {
75807580

75817581
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
75827582
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
7583-
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
7584-
// lib/esnext.*.d.ts file.
7583+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
7584+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
75857585
export const enum ScriptTarget {
75867586
/** @deprecated */
75877587
ES3 = 0,
@@ -8389,8 +8389,8 @@ export type LanugageFeatures =
83898389
// Upcoming Features
83908390
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
83918391
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
8392-
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
8393-
// lib/esnext.*.d.ts file.
8392+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
8393+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
83948394
| "UsingAndAwaitUsing" // `using x = y`, `await using x = y`
83958395
| "ClassAndClassElementDecorators" // `@dec class C {}`, `class C { @dec m() {} }`
83968396
;

src/compiler/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,8 +1374,8 @@ export type ScriptTargetFeatures = ReadonlyMap<string, ReadonlyMap<string, strin
13741374

13751375
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
13761376
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
1377-
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
1378-
// lib/esnext.*.d.ts file.
1377+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
1378+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
13791379
/** @internal */
13801380
export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__ */ memoize((): ScriptTargetFeatures =>
13811381
new Map(Object.entries({

src/compiler/utilitiesPublic.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,13 @@ export function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics:
305305
}
306306

307307
/** @internal */
308+
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
309+
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
310+
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
311+
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
308312
export const targetToLibMap: Map<ScriptTarget, string> = new Map([
309313
[ScriptTarget.ESNext, "lib.esnext.full.d.ts"],
314+
[ScriptTarget.ES2024, "lib.es2024.full.d.ts"],
310315
[ScriptTarget.ES2023, "lib.es2023.full.d.ts"],
311316
[ScriptTarget.ES2022, "lib.es2022.full.d.ts"],
312317
[ScriptTarget.ES2021, "lib.es2021.full.d.ts"],
@@ -322,6 +327,7 @@ export function getDefaultLibFileName(options: CompilerOptions): string {
322327
const target = getEmitScriptTarget(options);
323328
switch (target) {
324329
case ScriptTarget.ESNext:
330+
case ScriptTarget.ES2024:
325331
case ScriptTarget.ES2023:
326332
case ScriptTarget.ES2022:
327333
case ScriptTarget.ES2021:

0 commit comments

Comments
 (0)