From df890801dbdace7d66ca53cc2595ceed21a894f2 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 01:25:04 +0000 Subject: [PATCH 01/21] Intl.NumberFormat: fix previous divergences from spec - move properties to correct spec versions - non-optional ResolvedNumberFormatOptions properties --- src/lib/es2020.intl.d.ts | 7 +++---- src/lib/es5.d.ts | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index d63508249ddcb..0b19bec78817f 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -224,22 +224,21 @@ declare namespace Intl { }; interface NumberFormatOptions { + numberingSystem: string | undefined; compactDisplay?: "short" | "long" | undefined; notation?: "standard" | "scientific" | "engineering" | "compact" | undefined; signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined; unit?: string | undefined; unitDisplay?: "short" | "long" | "narrow" | undefined; - currencyDisplay?: string | undefined; currencySign?: string | undefined; } interface ResolvedNumberFormatOptions { compactDisplay?: "short" | "long"; - notation?: "standard" | "scientific" | "engineering" | "compact"; - signDisplay?: "auto" | "never" | "always" | "exceptZero"; + notation: "standard" | "scientific" | "engineering" | "compact"; + signDisplay: "auto" | "never" | "always" | "exceptZero"; unit?: string; unitDisplay?: "short" | "long" | "narrow"; - currencyDisplay?: string; currencySign?: string; } diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index f3df23047022d..602e71da4a55c 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4413,7 +4413,7 @@ declare namespace Intl { localeMatcher?: string | undefined; style?: string | undefined; currency?: string | undefined; - currencySign?: string | undefined; + currencyDisplay?: string | undefined; useGrouping?: boolean | undefined; minimumIntegerDigits?: number | undefined; minimumFractionDigits?: number | undefined; @@ -4427,6 +4427,7 @@ declare namespace Intl { numberingSystem: string; style: string; currency?: string; + currencyDisplay?: string; minimumIntegerDigits: number; minimumFractionDigits: number; maximumFractionDigits: number; From f9612a0b216e3b777b806c84c69061867137eb8c Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 01:46:01 +0000 Subject: [PATCH 02/21] Intl.NumberFormat: add ECMA-402 version 10 changes under es2023.intl --- src/compiler/commandLineParser.ts | 1 + src/lib/es2020.intl.d.ts | 13 +++++++++++-- src/lib/es2023.d.ts | 1 + src/lib/es2023.intl.d.ts | 27 +++++++++++++++++++++++++++ src/lib/es5.d.ts | 8 ++++++-- src/lib/libs.json | 1 + 6 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 src/lib/es2023.intl.d.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index decc8751453a6..e9b5c0960d514 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -215,6 +215,7 @@ const libEntries: [string, string][] = [ ["es2022.regexp", "lib.es2022.regexp.d.ts"], ["es2023.array", "lib.es2023.array.d.ts"], ["es2023.collection", "lib.es2023.collection.d.ts"], + ["es2023.intl", "lib.es2023.intl.d.ts"], ["esnext.array", "lib.es2023.array.d.ts"], ["esnext.collection", "lib.es2023.collection.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 0b19bec78817f..0502302f2647f 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -223,11 +223,20 @@ declare namespace Intl { ): UnicodeBCP47LocaleIdentifier[]; }; + interface NumberFormatOptionsSignDisplayRegistry { + auto: any; + never: any; + always: any; + exceptZero: any; + } + + type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry; + interface NumberFormatOptions { numberingSystem: string | undefined; compactDisplay?: "short" | "long" | undefined; notation?: "standard" | "scientific" | "engineering" | "compact" | undefined; - signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined; + signDisplay?: NumberFormatOptionsSignDisplay | undefined; unit?: string | undefined; unitDisplay?: "short" | "long" | "narrow" | undefined; currencySign?: string | undefined; @@ -236,7 +245,7 @@ declare namespace Intl { interface ResolvedNumberFormatOptions { compactDisplay?: "short" | "long"; notation: "standard" | "scientific" | "engineering" | "compact"; - signDisplay: "auto" | "never" | "always" | "exceptZero"; + signDisplay: NumberFormatOptionsSignDisplay; unit?: string; unitDisplay?: "short" | "long" | "narrow"; currencySign?: string; diff --git a/src/lib/es2023.d.ts b/src/lib/es2023.d.ts index 5c45f807e08a8..2b3132f1c19e8 100644 --- a/src/lib/es2023.d.ts +++ b/src/lib/es2023.d.ts @@ -1,3 +1,4 @@ /// /// /// +/// diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts new file mode 100644 index 0000000000000..6cc4f54df976f --- /dev/null +++ b/src/lib/es2023.intl.d.ts @@ -0,0 +1,27 @@ +declare namespace Intl { + interface NumberFormatUseGroupingRegistry { + true: any; + false: any; + min2: any; + auto: any; + always: any; + } + + interface NumberFormatSignDisplayRegistry { + negative: any; + } + + interface NumberFormatOptions { + roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; + roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; + roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; + } + + interface ResolvedNumberFormatOptions { + roundingPriority: "auto" | "morePrecision" | "lessPrecision"; + roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; + roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; + trailingZeroDisplay: "auto" | "stripIfInteger"; + } +} diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 602e71da4a55c..aa40251ab69a5 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4409,12 +4409,16 @@ declare namespace Intl { var Collator: CollatorConstructor; + interface NumberFormatOptionsUseGroupingRegistry {} + + type NumberFormatOptionsUseGrouping = keyof NumberFormatOptionsUseGroupingRegistry | boolean; + interface NumberFormatOptions { localeMatcher?: string | undefined; style?: string | undefined; currency?: string | undefined; currencyDisplay?: string | undefined; - useGrouping?: boolean | undefined; + useGrouping?: NumberFormatOptionsUseGrouping | undefined; minimumIntegerDigits?: number | undefined; minimumFractionDigits?: number | undefined; maximumFractionDigits?: number | undefined; @@ -4433,7 +4437,7 @@ declare namespace Intl { maximumFractionDigits: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; - useGrouping: boolean; + useGrouping: NumberFormatOptionsUseGrouping; } interface NumberFormat { diff --git a/src/lib/libs.json b/src/lib/libs.json index 0c7fd7d53e777..a9d99dd652b66 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -68,6 +68,7 @@ "es2022.regexp", "es2023.array", "es2023.collection", + "es2023.intl", "esnext.decorators", "esnext.intl", "esnext.disposable", From 50e295d981151fb34f33c9c8ebffb57236240964 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 01:55:40 +0000 Subject: [PATCH 03/21] Intl.NumberFormat: narrow to literal union types --- src/lib/es2020.intl.d.ts | 4 ++++ src/lib/es5.d.ts | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 0502302f2647f..97a960746a63f 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -223,6 +223,10 @@ declare namespace Intl { ): UnicodeBCP47LocaleIdentifier[]; }; + interface NumberFormatOptionsStyleRegistry { + unit: any; + } + interface NumberFormatOptionsSignDisplayRegistry { auto: any; never: any; diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index aa40251ab69a5..6ed8afe4fbe96 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4409,13 +4409,21 @@ declare namespace Intl { var Collator: CollatorConstructor; + interface NumberFormatOptionsStyleRegistry { + decimal: any; + percent: any; + currency: any; + } + + type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry; + interface NumberFormatOptionsUseGroupingRegistry {} type NumberFormatOptionsUseGrouping = keyof NumberFormatOptionsUseGroupingRegistry | boolean; interface NumberFormatOptions { - localeMatcher?: string | undefined; - style?: string | undefined; + localeMatcher?: "lookup" | "best fit" | undefined; + style?: NumberFormatOptionsStyle | undefined; currency?: string | undefined; currencyDisplay?: string | undefined; useGrouping?: NumberFormatOptionsUseGrouping | undefined; @@ -4429,7 +4437,7 @@ declare namespace Intl { interface ResolvedNumberFormatOptions { locale: string; numberingSystem: string; - style: string; + style: NumberFormatOptionsStyle; currency?: string; currencyDisplay?: string; minimumIntegerDigits: number; From 7a9f949a6fd8a8a7ef463917967158a9f1d8404e Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 02:37:19 +0000 Subject: [PATCH 04/21] Intl.NumberFormat: move ES23 methods from esnext.intl to es2023.intl --- src/lib/es2023.intl.d.ts | 9 +++++++++ src/lib/esnext.intl.d.ts | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 6cc4f54df976f..7d65aad6d3aea 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -24,4 +24,13 @@ declare namespace Intl { roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; trailingZeroDisplay: "auto" | "stripIfInteger"; } + + interface NumberRangeFormatPart extends NumberFormatPart { + source: "startRange" | "endRange" | "shared"; + } + + interface NumberFormat { + formatRange(start: number | bigint, end: number | bigint): string; + formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; + } } diff --git a/src/lib/esnext.intl.d.ts b/src/lib/esnext.intl.d.ts index b6d59cfa0d9fc..9aacedd724469 100644 --- a/src/lib/esnext.intl.d.ts +++ b/src/lib/esnext.intl.d.ts @@ -1,10 +1,3 @@ declare namespace Intl { - interface NumberRangeFormatPart extends NumberFormatPart { - source: "startRange" | "endRange" | "shared"; - } - - interface NumberFormat { - formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; - } + // Empty } From ef87a157a69693a5dbfb6346d53667d7ce82463a Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 03:17:03 +0000 Subject: [PATCH 05/21] es2023.intl: CRLF --- src/lib/es2023.intl.d.ts | 72 ++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 7d65aad6d3aea..29602acb06d5e 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,36 +1,36 @@ -declare namespace Intl { - interface NumberFormatUseGroupingRegistry { - true: any; - false: any; - min2: any; - auto: any; - always: any; - } - - interface NumberFormatSignDisplayRegistry { - negative: any; - } - - interface NumberFormatOptions { - roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; - roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; - roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; - trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; - } - - interface ResolvedNumberFormatOptions { - roundingPriority: "auto" | "morePrecision" | "lessPrecision"; - roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; - roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; - trailingZeroDisplay: "auto" | "stripIfInteger"; - } - - interface NumberRangeFormatPart extends NumberFormatPart { - source: "startRange" | "endRange" | "shared"; - } - - interface NumberFormat { - formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; - } -} +declare namespace Intl { + interface NumberFormatUseGroupingRegistry { + true: any; + false: any; + min2: any; + auto: any; + always: any; + } + + interface NumberFormatSignDisplayRegistry { + negative: any; + } + + interface NumberFormatOptions { + roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; + roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; + roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; + } + + interface ResolvedNumberFormatOptions { + roundingPriority: "auto" | "morePrecision" | "lessPrecision"; + roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; + roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; + trailingZeroDisplay: "auto" | "stripIfInteger"; + } + + interface NumberRangeFormatPart extends NumberFormatPart { + source: "startRange" | "endRange" | "shared"; + } + + interface NumberFormat { + formatRange(start: number | bigint, end: number | bigint): string; + formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; + } +} From 8b96367c54a9ff3875cd460e08679a3959922d0b Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 15:22:58 +0000 Subject: [PATCH 06/21] es2023.intl: Fix interface names --- src/lib/es2023.intl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 29602acb06d5e..80c35d9d7b786 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,5 +1,5 @@ declare namespace Intl { - interface NumberFormatUseGroupingRegistry { + interface NumberFormatOptionsUseGroupingRegistry { true: any; false: any; min2: any; @@ -7,7 +7,7 @@ declare namespace Intl { always: any; } - interface NumberFormatSignDisplayRegistry { + interface NumberFormatOptionsSignDisplayRegistry { negative: any; } From 0b137b9e7aea55e96df75f2271325a2b4f2ad284 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 15:27:07 +0000 Subject: [PATCH 07/21] Intl.NumberFormat: conditional type override for useGrouping --- src/lib/es2023.intl.d.ts | 2 -- src/lib/es5.d.ts | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 80c35d9d7b786..882d9bc71ccd5 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,7 +1,5 @@ declare namespace Intl { interface NumberFormatOptionsUseGroupingRegistry { - true: any; - false: any; min2: any; auto: any; always: any; diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 6ed8afe4fbe96..b6c36fd643711 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4419,7 +4419,8 @@ declare namespace Intl { interface NumberFormatOptionsUseGroupingRegistry {} - type NumberFormatOptionsUseGrouping = keyof NumberFormatOptionsUseGroupingRegistry | boolean; + type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean; + type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry; interface NumberFormatOptions { localeMatcher?: "lookup" | "best fit" | undefined; @@ -4445,7 +4446,7 @@ declare namespace Intl { maximumFractionDigits: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; - useGrouping: NumberFormatOptionsUseGrouping; + useGrouping: ResolvedNumberFormatOptionsUseGrouping; } interface NumberFormat { From bb13158146149c6d35f061a4790e545c9a96c0e9 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 15:58:10 +0000 Subject: [PATCH 08/21] Intl.NumberFormat: add false to ResolvedNumberFormatOptionsUseGrouping As per ECMA-402 v10 / 15.1.2 #22-28 Boolean(true), Boolean(false), String("true") and String("false") all have different behaviour, for reasons known unto God --- src/lib/es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index b6c36fd643711..47808df4e3988 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4420,7 +4420,7 @@ declare namespace Intl { interface NumberFormatOptionsUseGroupingRegistry {} type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean; - type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry; + type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | false; interface NumberFormatOptions { localeMatcher?: "lookup" | "best fit" | undefined; From b8578060fe8b1b79b0740c30e89fcb4e1fbc4688 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 16:18:48 +0000 Subject: [PATCH 09/21] Intl.NumberFormat: narrow currencyDisplay type --- src/lib/es2020.intl.d.ts | 4 ++++ src/lib/es5.d.ts | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 97a960746a63f..7098ce911d970 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -227,6 +227,10 @@ declare namespace Intl { unit: any; } + interface NumberFormatOptionsCurrencyDisplayRegistry { + narrowSymbol: any; + } + interface NumberFormatOptionsSignDisplayRegistry { auto: any; never: any; diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 47808df4e3988..e59c0472bf1a8 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4417,6 +4417,14 @@ declare namespace Intl { type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry; + interface NumberFormatOptionsCurrencyDisplayRegistry { + code: any; + symbol: any; + name: any; + } + + type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry; + interface NumberFormatOptionsUseGroupingRegistry {} type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean; @@ -4426,7 +4434,7 @@ declare namespace Intl { localeMatcher?: "lookup" | "best fit" | undefined; style?: NumberFormatOptionsStyle | undefined; currency?: string | undefined; - currencyDisplay?: string | undefined; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay | undefined; useGrouping?: NumberFormatOptionsUseGrouping | undefined; minimumIntegerDigits?: number | undefined; minimumFractionDigits?: number | undefined; @@ -4440,7 +4448,7 @@ declare namespace Intl { numberingSystem: string; style: NumberFormatOptionsStyle; currency?: string; - currencyDisplay?: string; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; minimumIntegerDigits: number; minimumFractionDigits: number; maximumFractionDigits: number; From 481c244f574c74423e0c30984fbb26d091563f3a Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 30 Dec 2023 16:20:07 +0000 Subject: [PATCH 10/21] Intl.NumberFormat: narrow currencySign type --- src/lib/es2020.intl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 7098ce911d970..7129e66df7335 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -247,7 +247,7 @@ declare namespace Intl { signDisplay?: NumberFormatOptionsSignDisplay | undefined; unit?: string | undefined; unitDisplay?: "short" | "long" | "narrow" | undefined; - currencySign?: string | undefined; + currencySign?: "standard" | "accounting" | undefined; } interface ResolvedNumberFormatOptions { @@ -256,7 +256,7 @@ declare namespace Intl { signDisplay: NumberFormatOptionsSignDisplay; unit?: string; unitDisplay?: "short" | "long" | "narrow"; - currencySign?: string; + currencySign?: "standard" | "accounting"; } interface DateTimeFormatOptions { From 0734e7ad9bea864dc7c6ed8901ac62f1cf4a916f Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 00:34:17 +0000 Subject: [PATCH 11/21] es2020.intl: make NumberFormatOptions.numberingSystem optional --- src/lib/es2020.intl.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 7129e66df7335..a511df17ab169 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -241,7 +241,7 @@ declare namespace Intl { type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry; interface NumberFormatOptions { - numberingSystem: string | undefined; + numberingSystem?: string | undefined; compactDisplay?: "short" | "long" | undefined; notation?: "standard" | "scientific" | "engineering" | "compact" | undefined; signDisplay?: NumberFormatOptionsSignDisplay | undefined; From d0876e5690cfb9eec28b2afbcb38ed2a67140b87 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 01:04:30 +0000 Subject: [PATCH 12/21] Update baselines to include lib.es2023.intl.d.ts --- .../Parse --lib option with extra comma.js | 2 +- .../Parse --lib option with trailing white-space.js | 2 +- .../Parse invalid option of library flags.js | 2 +- ... libs array to compiler-options with json api.js | 2 +- ...y to compiler-options with jsonSourceFile api.js | 2 +- ...ion of libs to compiler-options with json api.js | 2 +- ...s to compiler-options with jsonSourceFile api.js | 2 +- ...ion of libs to compiler-options with json api.js | 2 +- ...s to compiler-options with jsonSourceFile api.js | 2 +- ...ion of libs to compiler-options with json api.js | 2 +- ...s to compiler-options with jsonSourceFile api.js | 2 +- .../baselines/reference/formatToPartsBigInt.symbols | 12 ++++++------ .../reference/formatToPartsFractionalSecond.symbols | 2 +- .../does-not-add-color-when-NO_COLOR-is-set.js | 2 +- ...kipped-when-host-can't-provide-terminal-width.js | 2 +- ...-ExitStatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- .../tsserver/telemetry/does-not-expose-paths.js | 2 +- .../typesVersions.ambientModules.trace.json | 12 ++++++++++++ .../reference/typesVersions.emptyTypes.trace.json | 13 +++++++++++++ .../reference/typesVersions.justIndex.trace.json | 13 +++++++++++++ .../reference/typesVersions.multiFile.trace.json | 12 ++++++++++++ .../typesVersionsDeclarationEmit.ambient.trace.json | 12 ++++++++++++ ...ypesVersionsDeclarationEmit.multiFile.trace.json | 12 ++++++++++++ ...tionEmit.multiFileBackReferenceToSelf.trace.json | 12 ++++++++++++ ...Emit.multiFileBackReferenceToUnmapped.trace.json | 12 ++++++++++++ 25 files changed, 120 insertions(+), 22 deletions(-) diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js index 861ee1c19e548..31bb9970acd48 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js index 88eeb66c96a85..196fd2b123424 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: es7,0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js index 13eb3c36e402d..237b551af4a2b 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js @@ -10,4 +10,4 @@ WatchOptions:: FileNames:: 0.ts Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js index 1587cd7b042ac..ba84b41daca21 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js index adc918672fcdd..7bb530c63447a 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. 8 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js index 431cadf048ea1..204195be59dfc 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -33,5 +33,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js index cffd9b9d5aaea..c52a74ce7f3dc 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -33,7 +33,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +tsconfig.json:9:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. 9 ""    ~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js index 12f6fd0d7bbc5..fc6aa4d64b27a 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -35,5 +35,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js index eea74a169262f..3fce3f2ac03ef 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -35,7 +35,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +tsconfig.json:10:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. 10 "incorrectLib"    ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js index c9397df479ab2..7a690f1f8b7c3 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -30,5 +30,5 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js index d4ebbca1e2805..fed37afbff427 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -30,7 +30,7 @@ CompilerOptions:: "configFilePath": "tsconfig.json" } Errors:: -tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. +tsconfig.json:8:7 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'. 8 " "    ~~~~~ diff --git a/tests/baselines/reference/formatToPartsBigInt.symbols b/tests/baselines/reference/formatToPartsBigInt.symbols index afca8e88e0f5b..cc8314825884c 100644 --- a/tests/baselines/reference/formatToPartsBigInt.symbols +++ b/tests/baselines/reference/formatToPartsBigInt.symbols @@ -6,16 +6,16 @@ // Test Intl methods with new parameter type new Intl.NumberFormat("fr").formatToParts(3000n); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) new Intl.NumberFormat("fr").formatToParts(BigInt(123)); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) >BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.symbols b/tests/baselines/reference/formatToPartsFractionalSecond.symbols index 34b86ff0d4d60..8f11bdbf67856 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.symbols +++ b/tests/baselines/reference/formatToPartsFractionalSecond.symbols @@ -5,7 +5,7 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional >new Intl.DateTimeFormat().formatToParts().find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >new Intl.DateTimeFormat().formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) >DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.DateTimeFormat.formatToParts, Decl(lib.es2017.intl.d.ts, --, --)) >find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 144118fae91f8..35c72f84c9bed 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, es2023.intl, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 4f6bbee5e0aca..a1b60ca3dc2f5 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, es2023.intl, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 4f6bbee5e0aca..a1b60ca3dc2f5 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -111,7 +111,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2016.intl, es2017.date, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.object, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, es2023.intl, esnext.intl, esnext.disposable, esnext.promise, esnext.decorators, decorators, decorators.legacy default: undefined --allowJs diff --git a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js index dc21b322516d7..45b9f794dcaa4 100644 --- a/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js +++ b/tests/baselines/reference/tsserver/telemetry/does-not-expose-paths.js @@ -471,7 +471,7 @@ Info seq [hh:mm:ss:mss] event: "line": 34, "offset": 16 }, - "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'.", + "text": "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'esnext.array', 'esnext.collection', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.disposable', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'esnext.decorators', 'decorators', 'decorators.legacy'.", "code": 6046, "category": "error", "fileName": "/tsconfig.json" diff --git a/tests/baselines/reference/typesVersions.ambientModules.trace.json b/tests/baselines/reference/typesVersions.ambientModules.trace.json index b8461698d9e7c..3c1bb3671d995 100644 --- a/tests/baselines/reference/typesVersions.ambientModules.trace.json +++ b/tests/baselines/reference/typesVersions.ambientModules.trace.json @@ -786,6 +786,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.emptyTypes.trace.json b/tests/baselines/reference/typesVersions.emptyTypes.trace.json index 6a0282a43d638..67e757ff282ce 100644 --- a/tests/baselines/reference/typesVersions.emptyTypes.trace.json +++ b/tests/baselines/reference/typesVersions.emptyTypes.trace.json @@ -814,6 +814,19 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.justIndex.trace.json b/tests/baselines/reference/typesVersions.justIndex.trace.json index 6177a45aaace6..ccd31ebf0a067 100644 --- a/tests/baselines/reference/typesVersions.justIndex.trace.json +++ b/tests/baselines/reference/typesVersions.justIndex.trace.json @@ -814,6 +814,19 @@ "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersions.multiFile.trace.json b/tests/baselines/reference/typesVersions.multiFile.trace.json index 589e95c6469be..743a01658c93e 100644 --- a/tests/baselines/reference/typesVersions.multiFile.trace.json +++ b/tests/baselines/reference/typesVersions.multiFile.trace.json @@ -765,6 +765,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json index b8461698d9e7c..3c1bb3671d995 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json @@ -786,6 +786,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json index 589e95c6469be..743a01658c93e 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json @@ -765,6 +765,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json index 231fee4507e60..19d9718a7fa7d 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json @@ -788,6 +788,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json index c31f2afd0f3bf..3004f56981da1 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json @@ -771,6 +771,18 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", "======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", From 72f7d44ff18d5d492257286e3d8debb940775d32 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 02:19:34 +0000 Subject: [PATCH 13/21] Add conformance tests for es2020.intl / es2023.intl Includes test for conditional useGrouping override in lib.es5.d.ts --- .../reference/intlNumberFormatES2020.js | 41 +++++++ .../reference/intlNumberFormatES2020.symbols | 71 ++++++++++++ .../reference/intlNumberFormatES2020.types | 105 ++++++++++++++++++ .../reference/intlNumberFormatES2023.js | 35 ++++++ .../reference/intlNumberFormatES2023.symbols | 60 ++++++++++ .../reference/intlNumberFormatES2023.types | 89 +++++++++++++++ .../intlNumberFormatES5UseGrouping.errors.txt | 15 +++ .../intlNumberFormatES5UseGrouping.js | 16 +++ .../intlNumberFormatES5UseGrouping.symbols | 29 +++++ .../intlNumberFormatES5UseGrouping.types | 44 ++++++++ .../reference/numberFormatCurrencySign.js | 9 -- .../numberFormatCurrencySign.symbols | 14 --- .../reference/numberFormatCurrencySign.types | 22 ---- .../numberFormatCurrencySignResolved.js | 11 -- .../numberFormatCurrencySignResolved.symbols | 20 ---- .../numberFormatCurrencySignResolved.types | 27 ----- .../es2020/intlNumberFormatES2020.ts | 23 ++++ .../es2020/numberFormatCurrencySign.ts | 4 - .../numberFormatCurrencySignResolved.ts | 5 - .../es2023/intlNumberFormatES2023.ts | 20 ++++ .../es2023/intlNumberFormatES5UseGrouping.ts | 8 ++ 21 files changed, 556 insertions(+), 112 deletions(-) create mode 100644 tests/baselines/reference/intlNumberFormatES2020.js create mode 100644 tests/baselines/reference/intlNumberFormatES2020.symbols create mode 100644 tests/baselines/reference/intlNumberFormatES2020.types create mode 100644 tests/baselines/reference/intlNumberFormatES2023.js create mode 100644 tests/baselines/reference/intlNumberFormatES2023.symbols create mode 100644 tests/baselines/reference/intlNumberFormatES2023.types create mode 100644 tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt create mode 100644 tests/baselines/reference/intlNumberFormatES5UseGrouping.js create mode 100644 tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols create mode 100644 tests/baselines/reference/intlNumberFormatES5UseGrouping.types delete mode 100644 tests/baselines/reference/numberFormatCurrencySign.js delete mode 100644 tests/baselines/reference/numberFormatCurrencySign.symbols delete mode 100644 tests/baselines/reference/numberFormatCurrencySign.types delete mode 100644 tests/baselines/reference/numberFormatCurrencySignResolved.js delete mode 100644 tests/baselines/reference/numberFormatCurrencySignResolved.symbols delete mode 100644 tests/baselines/reference/numberFormatCurrencySignResolved.types create mode 100644 tests/cases/conformance/es2020/intlNumberFormatES2020.ts delete mode 100644 tests/cases/conformance/es2020/numberFormatCurrencySign.ts delete mode 100644 tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts create mode 100644 tests/cases/conformance/es2023/intlNumberFormatES2023.ts create mode 100644 tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts diff --git a/tests/baselines/reference/intlNumberFormatES2020.js b/tests/baselines/reference/intlNumberFormatES2020.js new file mode 100644 index 0000000000000..f40cb6c0be71a --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.js @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +//// [intlNumberFormatES2020.ts] +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-NZ', {}); + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); + + +//// [intlNumberFormatES2020.js] +"use strict"; +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +// Empty options +new Intl.NumberFormat('en-NZ', {}); +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); diff --git a/tests/baselines/reference/intlNumberFormatES2020.symbols b/tests/baselines/reference/intlNumberFormatES2020.symbols new file mode 100644 index 0000000000000..7d7198ccab083 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.symbols @@ -0,0 +1,71 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +=== intlNumberFormatES2020.ts === +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +>notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 1, 7)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 1, 17)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 1, 24)) +>new Intl.NumberFormat('en-NZ').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Empty options +new Intl.NumberFormat('en-NZ', {}); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>numberingSystem : Symbol(numberingSystem, Decl(intlNumberFormatES2020.ts, 7, 32)) + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +>currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 7)) +>currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 17)) +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 10, 67)) +>currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 86)) +>currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 103)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +>unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 7)) +>unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 13)) +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>style : Symbol(style, Decl(intlNumberFormatES2020.ts, 13, 62)) +>unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 77)) +>unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 95)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +>compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 7)) +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 16, 59)) +>compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 80)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 19, 32)) + diff --git a/tests/baselines/reference/intlNumberFormatES2020.types b/tests/baselines/reference/intlNumberFormatES2020.types new file mode 100644 index 0000000000000..4714dd42b1ff6 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2020.types @@ -0,0 +1,105 @@ +//// [tests/cases/conformance/es2020/intlNumberFormatES2020.ts] //// + +=== intlNumberFormatES2020.ts === +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); +>notation : "standard" | "scientific" | "engineering" | "compact" +>style : keyof Intl.NumberFormatOptionsStyleRegistry +>signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry +>new Intl.NumberFormat('en-NZ').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ').resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Empty options +new Intl.NumberFormat('en-NZ', {}); +>new Intl.NumberFormat('en-NZ', {}) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{} : {} + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); +>new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ numberingSystem: 'arab' } : { numberingSystem: string; } +>numberingSystem : string +>'arab' : "arab" + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); +>currency : string | undefined +>currencySign : "standard" | "accounting" | undefined +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: "currency"; currency: string; currencySign: "accounting"; } +>style : "currency" +>'currency' : "currency" +>currency : string +>'NZD' : "NZD" +>currencySign : "accounting" +>'accounting' : "accounting" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); +>unit : string | undefined +>unitDisplay : "short" | "long" | "narrow" | undefined +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' } : { style: "unit"; unit: string; unitDisplay: "narrow"; } +>style : "unit" +>'unit' : "unit" +>unit : string +>'kilogram' : "kilogram" +>unitDisplay : "narrow" +>'narrow' : "narrow" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); +>compactDisplay : "short" | "long" | undefined +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ notation: 'compact', compactDisplay: 'long' } : { notation: "compact"; compactDisplay: "long"; } +>notation : "compact" +>'compact' : "compact" +>compactDisplay : "long" +>'long' : "long" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +>new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-NZ' : "en-NZ" +>{ signDisplay: 'always' } : { signDisplay: "always"; } +>signDisplay : "always" +>'always' : "always" + diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js new file mode 100644 index 0000000000000..b0ee92d0ac453 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +//// [intlNumberFormatES2023.ts] +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-GB', {}); + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); + + +//// [intlNumberFormatES2023.js] +"use strict"; +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +// Empty options +new Intl.NumberFormat('en-GB', {}); +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols new file mode 100644 index 0000000000000..02a63f4b105d5 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -0,0 +1,60 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +=== intlNumberFormatES2023.ts === +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>roundingPriority : Symbol(roundingPriority, Decl(intlNumberFormatES2023.ts, 1, 7)) +>roundingMode : Symbol(roundingMode, Decl(intlNumberFormatES2023.ts, 1, 25)) +>roundingIncrement : Symbol(roundingIncrement, Decl(intlNumberFormatES2023.ts, 1, 39)) +>trailingZeroDisplay : Symbol(trailingZeroDisplay, Decl(intlNumberFormatES2023.ts, 1, 58)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 1, 79)) +>new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Empty options +new Intl.NumberFormat('en-GB', {}); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>roundingPriority : Symbol(roundingPriority, Decl(intlNumberFormatES2023.ts, 7, 32)) +>roundingIncrement : Symbol(roundingIncrement, Decl(intlNumberFormatES2023.ts, 7, 67)) +>roundingMode : Symbol(roundingMode, Decl(intlNumberFormatES2023.ts, 7, 91)) + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 7)) +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 56)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 13, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 14, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 15, 32)) + diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types new file mode 100644 index 0000000000000..3fb43c66c0de1 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES2023.ts] //// + +=== intlNumberFormatES2023.ts === +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>roundingPriority : "auto" | "morePrecision" | "lessPrecision" +>roundingMode : "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" +>roundingIncrement : 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 +>trailingZeroDisplay : "auto" | "stripIfInteger" +>useGrouping : false | keyof Intl.NumberFormatOptionsUseGroupingRegistry +>new Intl.NumberFormat('en-GB').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB').resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Empty options +new Intl.NumberFormat('en-GB', {}); +>new Intl.NumberFormat('en-GB', {}) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{} : {} + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); +>new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' } : { roundingPriority: "lessPrecision"; roundingIncrement: 100; roundingMode: "trunc"; } +>roundingPriority : "lessPrecision" +>'lessPrecision' : "lessPrecision" +>roundingIncrement : 100 +>100 : 100 +>roundingMode : "trunc" +>'trunc' : "trunc" + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); +>signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ signDisplay: 'negative' } : { signDisplay: "negative"; } +>signDisplay : "negative" +>'negative' : "negative" +>resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>new Intl.NumberFormat('en-GB', { useGrouping: true }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: true } : { useGrouping: true; } +>useGrouping : true +>true : true + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +>new Intl.NumberFormat('en-GB', { useGrouping: 'true' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'true' } : { useGrouping: "true"; } +>useGrouping : "true" +>'true' : "true" + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +>new Intl.NumberFormat('en-GB', { useGrouping: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'always' } : { useGrouping: "always"; } +>useGrouping : "always" +>'always' : "always" + diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt b/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt new file mode 100644 index 0000000000000..cd22de47d6941 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.errors.txt @@ -0,0 +1,15 @@ +intlNumberFormatES5UseGrouping.ts(2,34): error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. +intlNumberFormatES5UseGrouping.ts(3,34): error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + + +==== intlNumberFormatES5UseGrouping.ts (2 errors) ==== + new Intl.NumberFormat('en-GB', { useGrouping: true }); + new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error + ~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + ~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'boolean | undefined'. + + const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + \ No newline at end of file diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.js b/tests/baselines/reference/intlNumberFormatES5UseGrouping.js new file mode 100644 index 0000000000000..b1162dfbfe59a --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.js @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +//// [intlNumberFormatES5UseGrouping.ts] +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + + +//// [intlNumberFormatES5UseGrouping.js] +"use strict"; +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +var useGrouping = new Intl.NumberFormat('en-GB').resolvedOptions().useGrouping; diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols b/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols new file mode 100644 index 0000000000000..ef972a7c1efbb --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.symbols @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +=== intlNumberFormatES5UseGrouping.ts === +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 0, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 1, 32)) + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 2, 32)) + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES5UseGrouping.ts, 4, 7)) +>new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES5UseGrouping.types b/tests/baselines/reference/intlNumberFormatES5UseGrouping.types new file mode 100644 index 0000000000000..c96a5ed0aee33 --- /dev/null +++ b/tests/baselines/reference/intlNumberFormatES5UseGrouping.types @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts] //// + +=== intlNumberFormatES5UseGrouping.ts === +new Intl.NumberFormat('en-GB', { useGrouping: true }); +>new Intl.NumberFormat('en-GB', { useGrouping: true }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: true } : { useGrouping: true; } +>useGrouping : true +>true : true + +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +>new Intl.NumberFormat('en-GB', { useGrouping: 'true' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'true' } : { useGrouping: string; } +>useGrouping : string +>'true' : "true" + +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error +>new Intl.NumberFormat('en-GB', { useGrouping: 'always' }) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>{ useGrouping: 'always' } : { useGrouping: string; } +>useGrouping : string +>'always' : "always" + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +>useGrouping : boolean +>new Intl.NumberFormat('en-GB').resolvedOptions() : Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB').resolvedOptions : () => Intl.ResolvedNumberFormatOptions +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions + diff --git a/tests/baselines/reference/numberFormatCurrencySign.js b/tests/baselines/reference/numberFormatCurrencySign.js deleted file mode 100644 index 4579848f74f25..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -//// [numberFormatCurrencySign.ts] -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); - - -//// [numberFormatCurrencySign.js] -"use strict"; -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); diff --git a/tests/baselines/reference/numberFormatCurrencySign.symbols b/tests/baselines/reference/numberFormatCurrencySign.symbols deleted file mode 100644 index c473f016b2187..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.symbols +++ /dev/null @@ -1,14 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -=== numberFormatCurrencySign.ts === -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); ->str : Symbol(str, Decl(numberFormatCurrencySign.ts, 0, 5)) ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->style : Symbol(style, Decl(numberFormatCurrencySign.ts, 0, 44)) ->currency : Symbol(currency, Decl(numberFormatCurrencySign.ts, 0, 63)) ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySign.ts, 0, 80)) ->format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - diff --git a/tests/baselines/reference/numberFormatCurrencySign.types b/tests/baselines/reference/numberFormatCurrencySign.types deleted file mode 100644 index b61cddf872e5a..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySign.types +++ /dev/null @@ -1,22 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySign.ts] //// - -=== numberFormatCurrencySign.ts === -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); ->str : string ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999) : string ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : { (value: number): string; (value: number | bigint): string; } ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->'en-NZ' : "en-NZ" ->{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } ->style : string ->'currency' : "currency" ->currency : string ->'NZD' : "NZD" ->currencySign : string ->'accounting' : "accounting" ->format : { (value: number): string; (value: number | bigint): string; } ->999999 : 999999 - diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.js b/tests/baselines/reference/numberFormatCurrencySignResolved.js deleted file mode 100644 index 4d7bcc5a8c432..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -//// [numberFormatCurrencySignResolved.ts] -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; - - -//// [numberFormatCurrencySignResolved.js] -"use strict"; -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols b/tests/baselines/reference/numberFormatCurrencySignResolved.symbols deleted file mode 100644 index bf424c8b4fbc2..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -=== numberFormatCurrencySignResolved.ts === -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); ->options : Symbol(options, Decl(numberFormatCurrencySignResolved.ts, 0, 5)) ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->style : Symbol(style, Decl(numberFormatCurrencySignResolved.ts, 0, 48)) ->currency : Symbol(currency, Decl(numberFormatCurrencySignResolved.ts, 0, 67)) ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySignResolved.ts, 0, 84)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -const currencySign = options.currencySign; ->currencySign : Symbol(currencySign, Decl(numberFormatCurrencySignResolved.ts, 1, 5)) ->options.currencySign : Symbol(Intl.ResolvedNumberFormatOptions.currencySign, Decl(lib.es2020.intl.d.ts, --, --)) ->options : Symbol(options, Decl(numberFormatCurrencySignResolved.ts, 0, 5)) ->currencySign : Symbol(Intl.ResolvedNumberFormatOptions.currencySign, Decl(lib.es2020.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.types b/tests/baselines/reference/numberFormatCurrencySignResolved.types deleted file mode 100644 index 75102f726cb0b..0000000000000 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.types +++ /dev/null @@ -1,27 +0,0 @@ -//// [tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts] //// - -=== numberFormatCurrencySignResolved.ts === -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); ->options : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->'en-NZ' : "en-NZ" ->{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } ->style : string ->'currency' : "currency" ->currency : string ->'NZD' : "NZD" ->currencySign : string ->'accounting' : "accounting" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } - -const currencySign = options.currencySign; ->currencySign : string | undefined ->options.currencySign : string | undefined ->options : Intl.ResolvedNumberFormatOptions ->currencySign : string | undefined - diff --git a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts new file mode 100644 index 0000000000000..3f8ca4304aeeb --- /dev/null +++ b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts @@ -0,0 +1,23 @@ +// @target: es2020 +// @strict: true + +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-NZ', {}); + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); diff --git a/tests/cases/conformance/es2020/numberFormatCurrencySign.ts b/tests/cases/conformance/es2020/numberFormatCurrencySign.ts deleted file mode 100644 index b7b451150d09d..0000000000000 --- a/tests/cases/conformance/es2020/numberFormatCurrencySign.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: esnext -// @lib: esnext -// @strict: true -const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); diff --git a/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts b/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts deleted file mode 100644 index ce6c36fb19fe1..0000000000000 --- a/tests/cases/conformance/es2020/numberFormatCurrencySignResolved.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: esnext -// @lib: esnext -// @strict: true -const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); -const currencySign = options.currencySign; diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts new file mode 100644 index 0000000000000..96acd51df4ef5 --- /dev/null +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -0,0 +1,20 @@ +// @target: es2022 +// @lib: es2022,es2023.intl +// @strict: true + +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-GB', {}); + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); diff --git a/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts new file mode 100644 index 0000000000000..64203bcab254d --- /dev/null +++ b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @strict: true + +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); From 7b73dc7c344444caf190f99d480e466186c7d699 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 13:38:01 +0000 Subject: [PATCH 14/21] Intl.NumberFormat: remove duplicate method override from es2020.bigint --- src/lib/es2020.bigint.d.ts | 1 - .../reference/intlNumberFormatES2020.symbols | 16 ++++++++-------- .../reference/intlNumberFormatES2020.types | 16 ++++++++-------- .../reference/intlNumberFormatES2023.symbols | 8 ++++---- .../reference/intlNumberFormatES2023.types | 8 ++++---- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 597b3822792eb..c2d3267e365e4 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -705,6 +705,5 @@ interface DataView { declare namespace Intl { interface NumberFormat { format(value: number | bigint): string; - resolvedOptions(): ResolvedNumberFormatOptions; } } diff --git a/tests/baselines/reference/intlNumberFormatES2020.symbols b/tests/baselines/reference/intlNumberFormatES2020.symbols index 7d7198ccab083..492b4bc3be029 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.symbols +++ b/tests/baselines/reference/intlNumberFormatES2020.symbols @@ -6,11 +6,11 @@ const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolved >notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 1, 7)) >style : Symbol(style, Decl(intlNumberFormatES2020.ts, 1, 17)) >signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 1, 24)) ->new Intl.NumberFormat('en-NZ').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-NZ').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Empty options new Intl.NumberFormat('en-NZ', {}); @@ -29,38 +29,38 @@ new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); >currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 7)) >currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 17)) ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >style : Symbol(style, Decl(intlNumberFormatES2020.ts, 10, 67)) >currency : Symbol(currency, Decl(intlNumberFormatES2020.ts, 10, 86)) >currencySign : Symbol(currencySign, Decl(intlNumberFormatES2020.ts, 10, 103)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Units const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); >unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 7)) >unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 13)) ->new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >style : Symbol(style, Decl(intlNumberFormatES2020.ts, 13, 62)) >unit : Symbol(unit, Decl(intlNumberFormatES2020.ts, 13, 77)) >unitDisplay : Symbol(unitDisplay, Decl(intlNumberFormatES2020.ts, 13, 95)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Compact const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); >compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 7)) ->new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >notation : Symbol(notation, Decl(intlNumberFormatES2020.ts, 16, 59)) >compactDisplay : Symbol(compactDisplay, Decl(intlNumberFormatES2020.ts, 16, 80)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); diff --git a/tests/baselines/reference/intlNumberFormatES2020.types b/tests/baselines/reference/intlNumberFormatES2020.types index 4714dd42b1ff6..f397dab9a9229 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.types +++ b/tests/baselines/reference/intlNumberFormatES2020.types @@ -7,13 +7,13 @@ const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolved >style : keyof Intl.NumberFormatOptionsStyleRegistry >signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry >new Intl.NumberFormat('en-NZ').resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ').resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ').resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-NZ') : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl >NumberFormat : Intl.NumberFormatConstructor >'en-NZ' : "en-NZ" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Empty options new Intl.NumberFormat('en-NZ', {}); @@ -40,7 +40,7 @@ const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'curr >currency : string | undefined >currencySign : "standard" | "accounting" | undefined >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl @@ -53,14 +53,14 @@ const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'curr >'NZD' : "NZD" >currencySign : "accounting" >'accounting' : "accounting" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Units const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); >unit : string | undefined >unitDisplay : "short" | "long" | "narrow" | undefined >new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }) : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl @@ -73,13 +73,13 @@ const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', un >'kilogram' : "kilogram" >unitDisplay : "narrow" >'narrow' : "narrow" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Compact const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); >compactDisplay : "short" | "long" | undefined >new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }) : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl @@ -90,7 +90,7 @@ const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', >'compact' : "compact" >compactDisplay : "long" >'long' : "long" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index 02a63f4b105d5..a49f739cd8442 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -8,11 +8,11 @@ const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, >roundingIncrement : Symbol(roundingIncrement, Decl(intlNumberFormatES2023.ts, 1, 39)) >trailingZeroDisplay : Symbol(trailingZeroDisplay, Decl(intlNumberFormatES2023.ts, 1, 58)) >useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 1, 79)) ->new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-GB').resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Empty options new Intl.NumberFormat('en-GB', {}); @@ -32,12 +32,12 @@ new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncr // Changes to signDisplay const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); >signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 7)) ->new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2023.ts, 10, 56)) ->resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --)) // Changes to useGrouping new Intl.NumberFormat('en-GB', { useGrouping: true }); diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index 3fb43c66c0de1..f68a31c9098fa 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -9,13 +9,13 @@ const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, >trailingZeroDisplay : "auto" | "stripIfInteger" >useGrouping : false | keyof Intl.NumberFormatOptionsUseGroupingRegistry >new Intl.NumberFormat('en-GB').resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-GB').resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-GB').resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-GB') : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl >NumberFormat : Intl.NumberFormatConstructor >'en-GB' : "en-GB" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Empty options new Intl.NumberFormat('en-GB', {}); @@ -45,7 +45,7 @@ new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncr const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); >signDisplay : keyof Intl.NumberFormatOptionsSignDisplayRegistry >new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions ->new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions : () => Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }) : Intl.NumberFormat >Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl @@ -54,7 +54,7 @@ const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' >{ signDisplay: 'negative' } : { signDisplay: "negative"; } >signDisplay : "negative" >'negative' : "negative" ->resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } +>resolvedOptions : () => Intl.ResolvedNumberFormatOptions // Changes to useGrouping new Intl.NumberFormat('en-GB', { useGrouping: true }); From 6ee47d4021fa53630c18a81c0b7e35122d57eca3 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 14:09:29 +0000 Subject: [PATCH 15/21] Intl.NumberFormat: Registry-ise NumberFormatPartType --- src/lib/es2018.intl.d.ts | 22 +++++++++++++++++----- src/lib/es2020.intl.d.ts | 11 ++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index ee58de50e5c37..a6b7538a26284 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -37,13 +37,25 @@ declare namespace Intl { const PluralRules: PluralRulesConstructor; - // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here: - type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name"; - type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown"; - type NumberFormatPartTypes = ES2018NumberFormatPartType | ES2020NumberFormatPartType; + interface NumberFormatPartTypeRegistry { + literal: any; + nan: any; + infinity: any; + percent: any; + integer: any; + group: any; + decimal: any; + fraction: any; + plusSign: any; + minusSign: any; + percentSign: any; + currency: any; + } + + type NumberFormatPartType = keyof NumberFormatPartTypeRegistry; interface NumberFormatPart { - type: NumberFormatPartTypes; + type: NumberFormatPartType; value: string; } diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index a511df17ab169..16babc96a7615 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -120,7 +120,7 @@ declare namespace Intl { value: string; } | { - type: Exclude; + type: Exclude; value: string; unit: RelativeTimeFormatUnitSingular; }; @@ -259,6 +259,15 @@ declare namespace Intl { currencySign?: "standard" | "accounting"; } + interface NumberFormatPartTypeRegistry { + compact: any; + exponentInteger: any; + exponentMinusSign: any; + exponentSeparator: any; + unit: any; + unknown: any; + } + interface DateTimeFormatOptions { calendar?: string | undefined; dayPeriod?: "narrow" | "short" | "long" | undefined; From f8e9dda72561b6bb43de0fc9a85d7b2ec7310a7b Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 15:43:29 +0000 Subject: [PATCH 16/21] Intl.NumberFormatPartType: add tests / update baselines Remove redundant/outdated esnext.bigint test CRLF --- tests/baselines/reference/es2018IntlAPIs.js | 8 ++- .../reference/es2018IntlAPIs.symbols | 19 +++++++ .../baselines/reference/es2018IntlAPIs.types | 22 +++++++++ ...ext.bigintIncludesNumberFormatPartTypes.js | 10 ---- ...igintIncludesNumberFormatPartTypes.symbols | 9 ---- ....bigintIncludesNumberFormatPartTypes.types | 8 --- .../reference/formatToPartsBigInt.symbols | 12 ++--- .../reference/intlNumberFormatES2020.js | 5 ++ .../reference/intlNumberFormatES2020.symbols | 6 +++ .../reference/intlNumberFormatES2020.types | 9 ++++ ...ext.bigintIncludesNumberFormatPartTypes.ts | 3 -- tests/cases/compiler/formatToPartsBigInt.ts | 2 +- .../conformance/es2018/es2018IntlAPIs.ts | 17 ++++--- .../es2020/intlNumberFormatES2020.ts | 49 ++++++++++--------- .../es2023/intlNumberFormatES2023.ts | 40 +++++++-------- .../es2023/intlNumberFormatES5UseGrouping.ts | 16 +++--- 16 files changed, 139 insertions(+), 96 deletions(-) delete mode 100644 tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js delete mode 100644 tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols delete mode 100644 tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types delete mode 100644 tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts diff --git a/tests/baselines/reference/es2018IntlAPIs.js b/tests/baselines/reference/es2018IntlAPIs.js index 53a320ce48cf3..707c4c65bfb4f 100644 --- a/tests/baselines/reference/es2018IntlAPIs.js +++ b/tests/baselines/reference/es2018IntlAPIs.js @@ -5,7 +5,11 @@ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; const options = { localeMatcher: 'lookup' } as const; -console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); +console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); + +const [ part ] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); + //// [es2018IntlAPIs.js] // Sample from @@ -13,3 +17,5 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; const options = { localeMatcher: 'lookup' }; console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); +const [part] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); diff --git a/tests/baselines/reference/es2018IntlAPIs.symbols b/tests/baselines/reference/es2018IntlAPIs.symbols index 56fe5b94adbb3..e9f24e896c9b4 100644 --- a/tests/baselines/reference/es2018IntlAPIs.symbols +++ b/tests/baselines/reference/es2018IntlAPIs.symbols @@ -25,3 +25,22 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >options : Symbol(options, Decl(es2018IntlAPIs.ts, 3, 5)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +const [ part ] = new Intl.NumberFormat().formatToParts(); +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>new Intl.NumberFormat().formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) + +console.log(part.type, part.value); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>part.type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part.value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(es2018IntlAPIs.ts, 6, 7)) +>value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/es2018IntlAPIs.types b/tests/baselines/reference/es2018IntlAPIs.types index a66c377532125..3c1142abbeaa6 100644 --- a/tests/baselines/reference/es2018IntlAPIs.types +++ b/tests/baselines/reference/es2018IntlAPIs.types @@ -35,3 +35,25 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >join : (separator?: string) => string >', ' : ", " +const [ part ] = new Intl.NumberFormat().formatToParts(); +>part : Intl.NumberFormatPart +>new Intl.NumberFormat().formatToParts() : Intl.NumberFormatPart[] +>new Intl.NumberFormat().formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] +>new Intl.NumberFormat() : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] + +console.log(part.type, part.value); +>console.log(part.type, part.value) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>part.type : keyof Intl.NumberFormatPartTypeRegistry +>part : Intl.NumberFormatPart +>type : keyof Intl.NumberFormatPartTypeRegistry +>part.value : string +>part : Intl.NumberFormatPart +>value : string + diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js deleted file mode 100644 index 9907fdec3818b..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -//// [esnext.bigintIncludesNumberFormatPartTypes.ts] -/// -var t: Intl.NumberFormatPartTypes - - -//// [esnext.bigintIncludesNumberFormatPartTypes.js] -/// -var t; diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols deleted file mode 100644 index 4fe98c172b4f2..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.symbols +++ /dev/null @@ -1,9 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -=== esnext.bigintIncludesNumberFormatPartTypes.ts === -/// -var t: Intl.NumberFormatPartTypes ->t : Symbol(t, Decl(esnext.bigintIncludesNumberFormatPartTypes.ts, 1, 3)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) ->NumberFormatPartTypes : Symbol(Intl.NumberFormatPartTypes, Decl(lib.es2018.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types b/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types deleted file mode 100644 index f909111af3e40..0000000000000 --- a/tests/baselines/reference/esnext.bigintIncludesNumberFormatPartTypes.types +++ /dev/null @@ -1,8 +0,0 @@ -//// [tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts] //// - -=== esnext.bigintIncludesNumberFormatPartTypes.ts === -/// -var t: Intl.NumberFormatPartTypes ->t : Intl.NumberFormatPartTypes ->Intl : any - diff --git a/tests/baselines/reference/formatToPartsBigInt.symbols b/tests/baselines/reference/formatToPartsBigInt.symbols index cc8314825884c..0472ffa18ee3d 100644 --- a/tests/baselines/reference/formatToPartsBigInt.symbols +++ b/tests/baselines/reference/formatToPartsBigInt.symbols @@ -6,16 +6,16 @@ // Test Intl methods with new parameter type new Intl.NumberFormat("fr").formatToParts(3000n); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) new Intl.NumberFormat("fr").formatToParts(BigInt(123)); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 6 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) >BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) diff --git a/tests/baselines/reference/intlNumberFormatES2020.js b/tests/baselines/reference/intlNumberFormatES2020.js index f40cb6c0be71a..d5ed09b0ff2bf 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.js +++ b/tests/baselines/reference/intlNumberFormatES2020.js @@ -21,6 +21,9 @@ const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); + +// New additions to NumberFormatPartType +const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; //// [intlNumberFormatES2020.js] @@ -39,3 +42,5 @@ const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', un const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +// New additions to NumberFormatPartType +const types = ['compact', 'unit', 'unknown']; diff --git a/tests/baselines/reference/intlNumberFormatES2020.symbols b/tests/baselines/reference/intlNumberFormatES2020.symbols index 492b4bc3be029..df4d5f0dc3d7e 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.symbols +++ b/tests/baselines/reference/intlNumberFormatES2020.symbols @@ -69,3 +69,9 @@ new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 19, 32)) +// New additions to NumberFormatPartType +const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +>types : Symbol(types, Decl(intlNumberFormatES2020.ts, 22, 5)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormatPartType : Symbol(Intl.NumberFormatPartType, Decl(lib.es2018.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2020.types b/tests/baselines/reference/intlNumberFormatES2020.types index f397dab9a9229..74532f98cd3a5 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.types +++ b/tests/baselines/reference/intlNumberFormatES2020.types @@ -103,3 +103,12 @@ new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); >signDisplay : "always" >'always' : "always" +// New additions to NumberFormatPartType +const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +>types : (keyof Intl.NumberFormatPartTypeRegistry)[] +>Intl : any +>[ 'compact', 'unit', 'unknown' ] : ("compact" | "unit" | "unknown")[] +>'compact' : "compact" +>'unit' : "unit" +>'unknown' : "unknown" + diff --git a/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts b/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts deleted file mode 100644 index 7e2aae31ea479..0000000000000 --- a/tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @lib: es6 -/// -var t: Intl.NumberFormatPartTypes diff --git a/tests/cases/compiler/formatToPartsBigInt.ts b/tests/cases/compiler/formatToPartsBigInt.ts index 6b50e98b8b6ea..7d54429792974 100644 --- a/tests/cases/compiler/formatToPartsBigInt.ts +++ b/tests/cases/compiler/formatToPartsBigInt.ts @@ -1,4 +1,4 @@ -// @target: esnext +// @target: es2020 // Intl.NumberFormat.formatToParts should support bigInt diff --git a/tests/cases/conformance/es2018/es2018IntlAPIs.ts b/tests/cases/conformance/es2018/es2018IntlAPIs.ts index c1f6739202d72..d09e8fd96a9e4 100644 --- a/tests/cases/conformance/es2018/es2018IntlAPIs.ts +++ b/tests/cases/conformance/es2018/es2018IntlAPIs.ts @@ -1,7 +1,10 @@ -// @target: es2018 - -// Sample from -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf -const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; -const options = { localeMatcher: 'lookup' } as const; -console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); \ No newline at end of file +// @target: es2018 + +// Sample from +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/supportedLocalesOf +const locales = ['ban', 'id-u-co-pinyin', 'de-ID']; +const options = { localeMatcher: 'lookup' } as const; +console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); + +const [ part ] = new Intl.NumberFormat().formatToParts(); +console.log(part.type, part.value); diff --git a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts index 3f8ca4304aeeb..85fe9e96cbf31 100644 --- a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts +++ b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts @@ -1,23 +1,26 @@ -// @target: es2020 -// @strict: true - -// New/updated resolved options in ES2020 -const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); - -// Empty options -new Intl.NumberFormat('en-NZ', {}); - -// Override numbering system -new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); - -// Currency -const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); - -// Units -const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); - -// Compact -const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); - -// Sign display -new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); +// @target: es2020 +// @strict: true + +// New/updated resolved options in ES2020 +const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-NZ', {}); + +// Override numbering system +new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); + +// Currency +const { currency, currencySign } = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions(); + +// Units +const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', unit: 'kilogram', unitDisplay: 'narrow' }).resolvedOptions(); + +// Compact +const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); + +// Sign display +new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); + +// New additions to NumberFormatPartType +const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index 96acd51df4ef5..693b1292e7438 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -1,20 +1,20 @@ -// @target: es2022 -// @lib: es2022,es2023.intl -// @strict: true - -// New / updated resolved options in ES2023, including type change for useGrouping -const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); - -// Empty options -new Intl.NumberFormat('en-GB', {}); - -// Rounding -new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); - -// Changes to signDisplay -const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); - -// Changes to useGrouping -new Intl.NumberFormat('en-GB', { useGrouping: true }); -new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); -new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +// @target: es2022 +// @lib: es2022,es2023.intl +// @strict: true + +// New / updated resolved options in ES2023, including type change for useGrouping +const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); + +// Empty options +new Intl.NumberFormat('en-GB', {}); + +// Rounding +new Intl.NumberFormat('en-GB', { roundingPriority: 'lessPrecision', roundingIncrement: 100, roundingMode: 'trunc' }); + +// Changes to signDisplay +const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' }).resolvedOptions(); + +// Changes to useGrouping +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); diff --git a/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts index 64203bcab254d..d6ffd1c9395cb 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES5UseGrouping.ts @@ -1,8 +1,8 @@ -// @target: es5 -// @strict: true - -new Intl.NumberFormat('en-GB', { useGrouping: true }); -new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error -new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error - -const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); +// @target: es5 +// @strict: true + +new Intl.NumberFormat('en-GB', { useGrouping: true }); +new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error +new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error + +const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); From ca699fc6a75ef2733d58ba48a72b97fd7f741a87 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 19:03:35 +0000 Subject: [PATCH 17/21] Restore name of exported type Intl.NumberFormatPartTypes --- src/lib/es2018.intl.d.ts | 4 ++-- src/lib/es2020.intl.d.ts | 2 +- tests/baselines/reference/intlNumberFormatES2020.js | 6 +++--- tests/baselines/reference/intlNumberFormatES2020.symbols | 6 +++--- tests/baselines/reference/intlNumberFormatES2020.types | 4 ++-- tests/cases/conformance/es2020/intlNumberFormatES2020.ts | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index a6b7538a26284..1b465e3126979 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -52,10 +52,10 @@ declare namespace Intl { currency: any; } - type NumberFormatPartType = keyof NumberFormatPartTypeRegistry; + type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry; interface NumberFormatPart { - type: NumberFormatPartType; + type: NumberFormatPartTypes; value: string; } diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 16babc96a7615..805ea220da0ba 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -120,7 +120,7 @@ declare namespace Intl { value: string; } | { - type: Exclude; + type: Exclude; value: string; unit: RelativeTimeFormatUnitSingular; }; diff --git a/tests/baselines/reference/intlNumberFormatES2020.js b/tests/baselines/reference/intlNumberFormatES2020.js index d5ed09b0ff2bf..0182294b853bb 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.js +++ b/tests/baselines/reference/intlNumberFormatES2020.js @@ -22,8 +22,8 @@ const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); -// New additions to NumberFormatPartType -const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; //// [intlNumberFormatES2020.js] @@ -42,5 +42,5 @@ const { unit, unitDisplay } = new Intl.NumberFormat('en-NZ', { style: 'unit', un const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', compactDisplay: 'long' }).resolvedOptions(); // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); -// New additions to NumberFormatPartType +// New additions to NumberFormatPartTypes const types = ['compact', 'unit', 'unknown']; diff --git a/tests/baselines/reference/intlNumberFormatES2020.symbols b/tests/baselines/reference/intlNumberFormatES2020.symbols index df4d5f0dc3d7e..06079622297ec 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.symbols +++ b/tests/baselines/reference/intlNumberFormatES2020.symbols @@ -69,9 +69,9 @@ new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >signDisplay : Symbol(signDisplay, Decl(intlNumberFormatES2020.ts, 19, 32)) -// New additions to NumberFormatPartType -const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; >types : Symbol(types, Decl(intlNumberFormatES2020.ts, 22, 5)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) ->NumberFormatPartType : Symbol(Intl.NumberFormatPartType, Decl(lib.es2018.intl.d.ts, --, --)) +>NumberFormatPartTypes : Symbol(Intl.NumberFormatPartTypes, Decl(lib.es2018.intl.d.ts, --, --)) diff --git a/tests/baselines/reference/intlNumberFormatES2020.types b/tests/baselines/reference/intlNumberFormatES2020.types index 74532f98cd3a5..6f47e4c14548d 100644 --- a/tests/baselines/reference/intlNumberFormatES2020.types +++ b/tests/baselines/reference/intlNumberFormatES2020.types @@ -103,8 +103,8 @@ new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); >signDisplay : "always" >'always' : "always" -// New additions to NumberFormatPartType -const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; >types : (keyof Intl.NumberFormatPartTypeRegistry)[] >Intl : any >[ 'compact', 'unit', 'unknown' ] : ("compact" | "unit" | "unknown")[] diff --git a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts index 85fe9e96cbf31..ee616da700167 100644 --- a/tests/cases/conformance/es2020/intlNumberFormatES2020.ts +++ b/tests/cases/conformance/es2020/intlNumberFormatES2020.ts @@ -22,5 +22,5 @@ const { compactDisplay } = new Intl.NumberFormat('en-NZ', { notation: 'compact', // Sign display new Intl.NumberFormat('en-NZ', { signDisplay: 'always' }); -// New additions to NumberFormatPartType -const types: Intl.NumberFormatPartType[] = [ 'compact', 'unit', 'unknown' ]; +// New additions to NumberFormatPartTypes +const types: Intl.NumberFormatPartTypes[] = [ 'compact', 'unit', 'unknown' ]; From 40cdb05fbba594e04b7812e225ef386a96ff593f Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 19:32:18 +0000 Subject: [PATCH 18/21] Move NumberFormat#formatRange tests from ES2021 to ES2023 --- ...TimeFormatAndNumberFormatES2021.errors.txt | 20 ------- .../DateTimeFormatAndNumberFormatES2021.js | 18 ------- ...ateTimeFormatAndNumberFormatES2021.symbols | 43 --------------- .../DateTimeFormatAndNumberFormatES2021.types | 53 ------------------- .../intlDateTimeFormatRangeES2021.js | 10 ++++ .../intlDateTimeFormatRangeES2021.symbols | 20 +++++++ .../intlDateTimeFormatRangeES2021.types | 29 ++++++++++ .../reference/intlNumberFormatES2023.js | 11 ++++ .../reference/intlNumberFormatES2023.symbols | 29 ++++++++++ .../reference/intlNumberFormatES2023.types | 53 +++++++++++++++++++ .../DateTimeFormatAndNumberFormatES2021.ts | 8 --- .../es2021/intlDateTimeFormatRangeES2021.ts | 4 ++ .../es2023/intlNumberFormatES2023.ts | 6 +++ 13 files changed, 162 insertions(+), 142 deletions(-) delete mode 100644 tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt delete mode 100644 tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js delete mode 100644 tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols delete mode 100644 tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types create mode 100644 tests/baselines/reference/intlDateTimeFormatRangeES2021.js create mode 100644 tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols create mode 100644 tests/baselines/reference/intlDateTimeFormatRangeES2021.types delete mode 100644 tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts create mode 100644 tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt deleted file mode 100644 index ad96fbe2ee110..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -DateTimeFormatAndNumberFormatES2021.ts(1,29): error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. -DateTimeFormatAndNumberFormatES2021.ts(4,25): error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. -DateTimeFormatAndNumberFormatES2021.ts(5,25): error TS2551: Property 'formatRangeToParts' does not exist on type 'NumberFormat'. Did you mean 'formatToParts'? - - -==== DateTimeFormatAndNumberFormatES2021.ts (3 errors) ==== - Intl.NumberFormat.prototype.formatRange - ~~~~~~~~~~~ -!!! error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. - Intl.DateTimeFormat.prototype.formatRange - - new Intl.NumberFormat().formatRange - ~~~~~~~~~~~ -!!! error TS2339: Property 'formatRange' does not exist on type 'NumberFormat'. - new Intl.NumberFormat().formatRangeToParts - ~~~~~~~~~~~~~~~~~~ -!!! error TS2551: Property 'formatRangeToParts' does not exist on type 'NumberFormat'. Did you mean 'formatToParts'? -!!! related TS2728 lib.es2018.intl.d.ts:--:--: 'formatToParts' is declared here. - new Intl.DateTimeFormat().formatRange - new Intl.DateTimeFormat().formatRangeToParts \ No newline at end of file diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js deleted file mode 100644 index 8bd25380b8b8d..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -//// [DateTimeFormatAndNumberFormatES2021.ts] -Intl.NumberFormat.prototype.formatRange -Intl.DateTimeFormat.prototype.formatRange - -new Intl.NumberFormat().formatRange -new Intl.NumberFormat().formatRangeToParts -new Intl.DateTimeFormat().formatRange -new Intl.DateTimeFormat().formatRangeToParts - -//// [DateTimeFormatAndNumberFormatES2021.js] -Intl.NumberFormat.prototype.formatRange; -Intl.DateTimeFormat.prototype.formatRange; -new Intl.NumberFormat().formatRange; -new Intl.NumberFormat().formatRangeToParts; -new Intl.DateTimeFormat().formatRange; -new Intl.DateTimeFormat().formatRangeToParts; diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols deleted file mode 100644 index 82aede47ba9b7..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols +++ /dev/null @@ -1,43 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -=== DateTimeFormatAndNumberFormatES2021.ts === -Intl.NumberFormat.prototype.formatRange ->Intl.NumberFormat.prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) - -Intl.DateTimeFormat.prototype.formatRange ->Intl.DateTimeFormat.prototype.formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat.prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) - -new Intl.NumberFormat().formatRange ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -new Intl.NumberFormat().formatRangeToParts ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - -new Intl.DateTimeFormat().formatRange ->new Intl.DateTimeFormat().formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) - -new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) ->DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) - diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types deleted file mode 100644 index e499924e25857..0000000000000 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types +++ /dev/null @@ -1,53 +0,0 @@ -//// [tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts] //// - -=== DateTimeFormatAndNumberFormatES2021.ts === -Intl.NumberFormat.prototype.formatRange ->Intl.NumberFormat.prototype.formatRange : any ->Intl.NumberFormat.prototype : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->prototype : Intl.NumberFormat ->formatRange : any - -Intl.DateTimeFormat.prototype.formatRange ->Intl.DateTimeFormat.prototype.formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string ->Intl.DateTimeFormat.prototype : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->prototype : Intl.DateTimeFormat ->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string - -new Intl.NumberFormat().formatRange ->new Intl.NumberFormat().formatRange : any ->new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->formatRange : any - -new Intl.NumberFormat().formatRangeToParts ->new Intl.NumberFormat().formatRangeToParts : any ->new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->formatRangeToParts : any - -new Intl.DateTimeFormat().formatRange ->new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string ->new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string - -new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] ->new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : Intl.DateTimeFormatConstructor ->Intl : typeof Intl ->DateTimeFormat : Intl.DateTimeFormatConstructor ->formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] - diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.js b/tests/baselines/reference/intlDateTimeFormatRangeES2021.js new file mode 100644 index 0000000000000..c42c04293fed2 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.js @@ -0,0 +1,10 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +//// [intlDateTimeFormatRangeES2021.ts] +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); + + +//// [intlDateTimeFormatRangeES2021.js] +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +var part = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000)[0]; diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols b/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols new file mode 100644 index 0000000000000..f8d30cfa466a8 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.symbols @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +=== intlDateTimeFormatRangeES2021.ts === +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +>new Intl.DateTimeFormat().formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --)) + +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); +>part : Symbol(part, Decl(intlDateTimeFormatRangeES2021.ts, 1, 7)) +>new Intl.DateTimeFormat().formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.DateTimeFormat.formatRangeToParts, Decl(lib.es2021.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlDateTimeFormatRangeES2021.types b/tests/baselines/reference/intlDateTimeFormatRangeES2021.types new file mode 100644 index 0000000000000..2365599a7b392 --- /dev/null +++ b/tests/baselines/reference/intlDateTimeFormatRangeES2021.types @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts] //// + +=== intlDateTimeFormatRangeES2021.ts === +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +>new Intl.DateTimeFormat().formatRange(new Date(0), new Date()) : string +>new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string +>new Date(0) : Date +>Date : DateConstructor +>0 : 0 +>new Date() : Date +>Date : DateConstructor + +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); +>part : Intl.DateTimeRangeFormatPart +>new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000) : Intl.DateTimeRangeFormatPart[] +>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] +>new Intl.DateTimeFormat() : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] +>1000 : 1000 +>1000000000 : 1000000000 + diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js index b0ee92d0ac453..f9ab2faef8b59 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.js +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -17,6 +17,12 @@ const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' new Intl.NumberFormat('en-GB', { useGrouping: true }); new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; //// [intlNumberFormatES2023.js] @@ -33,3 +39,8 @@ const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' new Intl.NumberFormat('en-GB', { useGrouping: true }); new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index a49f739cd8442..ecc1738f1d714 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -58,3 +58,32 @@ new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >useGrouping : Symbol(useGrouping, Decl(intlNumberFormatES2023.ts, 15, 32)) +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +>new Intl.NumberFormat('en-GB').formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +>new Intl.NumberFormat('en-GB').formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRange : Symbol(Intl.NumberFormat.formatRange, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index f68a31c9098fa..8e75f8967b133 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -87,3 +87,56 @@ new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); >useGrouping : "always" >'always' : "always" +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +>new Intl.NumberFormat('en-GB').formatRange(10, 100) : string +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint, end: number | bigint) => string +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRange : (start: number | bigint, end: number | bigint) => string +>10 : 10 +>100 : 100 + +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +>new Intl.NumberFormat('en-GB').formatRange(10n, 1000n) : string +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint, end: number | bigint) => string +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRange : (start: number | bigint, end: number | bigint) => string +>10n : 10n +>1000n : 1000n + +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0] : Intl.NumberRangeFormatPart +>new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000) : Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>10 : 10 +>1000 : 1000 +>0 : 0 + +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; +>new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0] : Intl.NumberRangeFormatPart +>new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n) : Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] +>10n : 10n +>1000n : 1000n +>0 : 0 + diff --git a/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts b/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts deleted file mode 100644 index 0ad9eca72e850..0000000000000 --- a/tests/cases/compiler/DateTimeFormatAndNumberFormatES2021.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @lib: es2021 -Intl.NumberFormat.prototype.formatRange -Intl.DateTimeFormat.prototype.formatRange - -new Intl.NumberFormat().formatRange -new Intl.NumberFormat().formatRangeToParts -new Intl.DateTimeFormat().formatRange -new Intl.DateTimeFormat().formatRangeToParts \ No newline at end of file diff --git a/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts b/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts new file mode 100644 index 0000000000000..2d318dfccba6f --- /dev/null +++ b/tests/cases/conformance/es2021/intlDateTimeFormatRangeES2021.ts @@ -0,0 +1,4 @@ +// @lib: es2021 + +new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); +const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000); diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index 693b1292e7438..a84b985e41cfa 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -18,3 +18,9 @@ const { signDisplay } = new Intl.NumberFormat('en-GB', { signDisplay: 'negative' new Intl.NumberFormat('en-GB', { useGrouping: true }); new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); + +// formatRange +new Intl.NumberFormat('en-GB').formatRange(10, 100); +new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); +new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; +new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; From a6261f91884dd8b1060a65f844d4357f3e74655b Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 31 Dec 2023 19:54:49 +0000 Subject: [PATCH 19/21] Remove test formatToPartsBigInt (duplicate of tests included in bigintWithLib) --- .../reference/formatToPartsBigInt.js | 15 ---------- .../reference/formatToPartsBigInt.symbols | 21 ------------- .../reference/formatToPartsBigInt.types | 30 ------------------- tests/cases/compiler/formatToPartsBigInt.ts | 7 ----- 4 files changed, 73 deletions(-) delete mode 100644 tests/baselines/reference/formatToPartsBigInt.js delete mode 100644 tests/baselines/reference/formatToPartsBigInt.symbols delete mode 100644 tests/baselines/reference/formatToPartsBigInt.types delete mode 100644 tests/cases/compiler/formatToPartsBigInt.ts diff --git a/tests/baselines/reference/formatToPartsBigInt.js b/tests/baselines/reference/formatToPartsBigInt.js deleted file mode 100644 index 132193616508d..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -//// [formatToPartsBigInt.ts] -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); - - -//// [formatToPartsBigInt.js] -// Intl.NumberFormat.formatToParts should support bigInt -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); diff --git a/tests/baselines/reference/formatToPartsBigInt.symbols b/tests/baselines/reference/formatToPartsBigInt.symbols deleted file mode 100644 index 0472ffa18ee3d..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.symbols +++ /dev/null @@ -1,21 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -=== formatToPartsBigInt.ts === -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); ->new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) - -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); ->new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) ->NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) ->BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) - diff --git a/tests/baselines/reference/formatToPartsBigInt.types b/tests/baselines/reference/formatToPartsBigInt.types deleted file mode 100644 index 3b42619f102e0..0000000000000 --- a/tests/baselines/reference/formatToPartsBigInt.types +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/compiler/formatToPartsBigInt.ts] //// - -=== formatToPartsBigInt.ts === -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); ->new Intl.NumberFormat("fr").formatToParts(3000n) : Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->"fr" : "fr" ->formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->3000n : 3000n - -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); ->new Intl.NumberFormat("fr").formatToParts(BigInt(123)) : Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : Intl.NumberFormatConstructor ->Intl : typeof Intl ->NumberFormat : Intl.NumberFormatConstructor ->"fr" : "fr" ->formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] ->BigInt(123) : bigint ->BigInt : BigIntConstructor ->123 : 123 - diff --git a/tests/cases/compiler/formatToPartsBigInt.ts b/tests/cases/compiler/formatToPartsBigInt.ts deleted file mode 100644 index 7d54429792974..0000000000000 --- a/tests/cases/compiler/formatToPartsBigInt.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @target: es2020 - -// Intl.NumberFormat.formatToParts should support bigInt - -// Test Intl methods with new parameter type -new Intl.NumberFormat("fr").formatToParts(3000n); -new Intl.NumberFormat("fr").formatToParts(BigInt(123)); From 37c5d527b960bfff38a8bc6a09bbee9c30ffaa1f Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Thu, 1 Feb 2024 23:49:52 +0000 Subject: [PATCH 20/21] Type string registry interfaces as {key: never} --- src/lib/es2018.intl.d.ts | 24 ++++++++++++------------ src/lib/es2019.intl.d.ts | 2 +- src/lib/es2020.intl.d.ts | 24 ++++++++++++------------ src/lib/es2023.intl.d.ts | 8 ++++---- src/lib/es5.d.ts | 12 ++++++------ 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index 1b465e3126979..9bfa24d277b0b 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -38,18 +38,18 @@ declare namespace Intl { const PluralRules: PluralRulesConstructor; interface NumberFormatPartTypeRegistry { - literal: any; - nan: any; - infinity: any; - percent: any; - integer: any; - group: any; - decimal: any; - fraction: any; - plusSign: any; - minusSign: any; - percentSign: any; - currency: any; + literal: never; + nan: never; + infinity: never; + percent: never; + integer: never; + group: never; + decimal: never; + fraction: never; + plusSign: never; + minusSign: never; + percentSign: never; + currency: never; } type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry; diff --git a/src/lib/es2019.intl.d.ts b/src/lib/es2019.intl.d.ts index c7b62bcf8bded..bbd0afba9dc57 100644 --- a/src/lib/es2019.intl.d.ts +++ b/src/lib/es2019.intl.d.ts @@ -1,5 +1,5 @@ declare namespace Intl { interface DateTimeFormatPartTypesRegistry { - unknown: any; + unknown: never; } } diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 805ea220da0ba..58cb28614af82 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -224,18 +224,18 @@ declare namespace Intl { }; interface NumberFormatOptionsStyleRegistry { - unit: any; + unit: never; } interface NumberFormatOptionsCurrencyDisplayRegistry { - narrowSymbol: any; + narrowSymbol: never; } interface NumberFormatOptionsSignDisplayRegistry { - auto: any; - never: any; - always: any; - exceptZero: any; + auto: never; + never: never; + always: never; + exceptZero: never; } type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry; @@ -260,12 +260,12 @@ declare namespace Intl { } interface NumberFormatPartTypeRegistry { - compact: any; - exponentInteger: any; - exponentMinusSign: any; - exponentSeparator: any; - unit: any; - unknown: any; + compact: never; + exponentInteger: never; + exponentMinusSign: never; + exponentSeparator: never; + unit: never; + unknown: never; } interface DateTimeFormatOptions { diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 882d9bc71ccd5..b3de1fdd1020c 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,12 +1,12 @@ declare namespace Intl { interface NumberFormatOptionsUseGroupingRegistry { - min2: any; - auto: any; - always: any; + min2: never; + auto: never; + always: never; } interface NumberFormatOptionsSignDisplayRegistry { - negative: any; + negative: never; } interface NumberFormatOptions { diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index e59c0472bf1a8..6c5356b2f1dd8 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4410,17 +4410,17 @@ declare namespace Intl { var Collator: CollatorConstructor; interface NumberFormatOptionsStyleRegistry { - decimal: any; - percent: any; - currency: any; + decimal: never; + percent: never; + currency: never; } type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry; interface NumberFormatOptionsCurrencyDisplayRegistry { - code: any; - symbol: any; - name: any; + code: never; + symbol: never; + name: never; } type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry; From ff58e758d9df09872d34b680102c8b23f7abc6d0 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Fri, 2 Feb 2024 00:15:04 +0000 Subject: [PATCH 21/21] ResolvedNumberFormatOptions: {minimum,maximum}FractionDigits to optional --- src/lib/es5.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 6c5356b2f1dd8..6e2ade82a1bbe 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4450,8 +4450,8 @@ declare namespace Intl { currency?: string; currencyDisplay?: NumberFormatOptionsCurrencyDisplay; minimumIntegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; useGrouping: ResolvedNumberFormatOptionsUseGrouping;