From 354e8501a799f20e702d9ea66fc381ad6c7665a0 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Fri, 1 Mar 2024 12:35:50 +0100 Subject: [PATCH 1/3] Accept decimal strings in Intl.NumberFormat --- src/lib/es2023.intl.d.ts | 6 ++-- .../reference/intlNumberFormatES2023.types | 32 +++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index b3de1fdd1020c..15da2a3961ffe 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -28,7 +28,9 @@ declare namespace Intl { } interface NumberFormat { - formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; + format(value: number | bigint | `${number}`): string; + formatToParts(value: number | bigint | `${number}`): NumberFormatPart[]; + formatRange(start: number | bigint | `${number}`, end: number | bigint | `${number}`): string; + formatRangeToParts(start: number | bigint | `${number}`, end: number | bigint | `${number}`): NumberRangeFormatPart[]; } } diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index 9cf6978515490..b93c8b6620551 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -158,8 +158,8 @@ new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); 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').formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -170,8 +170,8 @@ new Intl.NumberFormat('en-GB').formatRange(10, 100); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRange : (start: number | bigint, end: number | bigint) => string -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10 : 10 > : ^^ >100 : 100 @@ -180,8 +180,8 @@ new Intl.NumberFormat('en-GB').formatRange(10, 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').formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -192,8 +192,8 @@ new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRange : (start: number | bigint, end: number | bigint) => string -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10n : 10n > : ^^^ >1000n : 1000n @@ -204,8 +204,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >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').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -216,8 +216,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10 : 10 > : ^^ >1000 : 1000 @@ -230,8 +230,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >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').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -242,8 +242,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRangeToParts : (start: number | bigint, end: number | bigint) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10n : 10n > : ^^^ >1000n : 1000n From 9c727be737387eb4bced26396046504e5e1a4bb6 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sat, 2 Mar 2024 18:24:56 +0000 Subject: [PATCH 2/3] Updated conformance tests --- .../reference/intlNumberFormatES2023.js | 9 +++++ .../reference/intlNumberFormatES2023.symbols | 22 ++++++++++++ .../reference/intlNumberFormatES2023.types | 36 +++++++++++++++++++ .../es2023/intlNumberFormatES2023.ts | 5 +++ 4 files changed, 72 insertions(+) diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js index f9ab2faef8b59..01b841561f074 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.js +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -23,6 +23,11 @@ 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]; + +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); //// [intlNumberFormatES2023.js] @@ -44,3 +49,7 @@ 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]; +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index ecc1738f1d714..36d5d87ec18f2 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -87,3 +87,25 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; >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, --, --)) +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +>new Intl.NumberFormat('en-GB').format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.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, --, --), 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, --, --)) +>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +>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('123E-4', '567E8'); +>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 b93c8b6620551..8b9b085c12bd8 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -251,3 +251,39 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; >0 : 0 > : ^ +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +>new Intl.NumberFormat('en-GB').format('-12.3E-4') : string +>new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | `${number}`): string; } +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>'en-GB' : "en-GB" +>format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | `${number}`): string; } +>'-12.3E-4' : "-12.3E-4" + +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +>new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8') : string +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => 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 | `${number}`, end: number | bigint | `${number}`) => string +>'123.4' : "123.4" +>'567.8' : "567.8" + +new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); +>new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8') : Intl.NumberRangeFormatPart[] +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => 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 | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +>'123E-4' : "123E-4" +>'567E8' : "567E8" + diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index a84b985e41cfa..1f2ba680ba987 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -24,3 +24,8 @@ 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]; + +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); From bd132ead153e641d5528ab8d92bf59a08443a8e7 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Mon, 18 Mar 2024 13:17:35 -0700 Subject: [PATCH 3/3] Allow Infinity --- src/lib/es2023.intl.d.ts | 10 +- .../reference/intlNumberFormatES2023.js | 6 + .../reference/intlNumberFormatES2023.symbols | 21 +++ .../reference/intlNumberFormatES2023.types | 133 +++++++++++++++--- .../es2023/intlNumberFormatES2023.ts | 3 + 5 files changed, 147 insertions(+), 26 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 15da2a3961ffe..91d29c3d04e30 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -27,10 +27,12 @@ declare namespace Intl { source: "startRange" | "endRange" | "shared"; } + type StringNumericLiteral = `${number}` | "Infinity" | "-Infinity" | "+Infinity"; + interface NumberFormat { - format(value: number | bigint | `${number}`): string; - formatToParts(value: number | bigint | `${number}`): NumberFormatPart[]; - formatRange(start: number | bigint | `${number}`, end: number | bigint | `${number}`): string; - formatRangeToParts(start: number | bigint | `${number}`, end: number | bigint | `${number}`): NumberRangeFormatPart[]; + format(value: number | bigint | StringNumericLiteral): string; + formatToParts(value: number | bigint | StringNumericLiteral): NumberFormatPart[]; + formatRange(start: number | bigint | StringNumericLiteral, end: number | bigint | StringNumericLiteral): string; + formatRangeToParts(start: number | bigint | StringNumericLiteral, end: number | bigint | StringNumericLiteral): NumberRangeFormatPart[]; } } diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js index 01b841561f074..983fe0ff00305 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.js +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -28,6 +28,9 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; new Intl.NumberFormat('en-GB').format('-12.3E-4'); new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); +new Intl.NumberFormat('en-GB').format('Infinity'); +new Intl.NumberFormat('en-GB').format('-Infinity'); +new Intl.NumberFormat('en-GB').format('+Infinity'); //// [intlNumberFormatES2023.js] @@ -53,3 +56,6 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; new Intl.NumberFormat('en-GB').format('-12.3E-4'); new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); +new Intl.NumberFormat('en-GB').format('Infinity'); +new Intl.NumberFormat('en-GB').format('-Infinity'); +new Intl.NumberFormat('en-GB').format('+Infinity'); diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index 36d5d87ec18f2..ade51253237e2 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -109,3 +109,24 @@ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); >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').format('Infinity'); +>new Intl.NumberFormat('en-GB').format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.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, --, --), 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, --, --)) +>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').format('-Infinity'); +>new Intl.NumberFormat('en-GB').format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.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, --, --), 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, --, --)) +>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + +new Intl.NumberFormat('en-GB').format('+Infinity'); +>new Intl.NumberFormat('en-GB').format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.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, --, --), 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, --, --)) +>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index 8b9b085c12bd8..f2f8ce318db8c 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -158,8 +158,8 @@ new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); 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 | `${number}`, end: number | bigint | `${number}`) => string -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -170,8 +170,8 @@ new Intl.NumberFormat('en-GB').formatRange(10, 100); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10 : 10 > : ^^ >100 : 100 @@ -180,8 +180,8 @@ new Intl.NumberFormat('en-GB').formatRange(10, 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 | `${number}`, end: number | bigint | `${number}`) => string -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -192,8 +192,8 @@ new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10n : 10n > : ^^^ >1000n : 1000n @@ -204,8 +204,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000) : Intl.NumberRangeFormatPart[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -216,8 +216,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10 : 10 > : ^^ >1000 : 1000 @@ -230,8 +230,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n) : Intl.NumberRangeFormatPart[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat > : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor @@ -242,8 +242,8 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" > : ^^^^^^^ ->formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10n : 10n > : ^^^ >1000n : 1000n @@ -254,36 +254,125 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; // Arbitrary-precision string arguments new Intl.NumberFormat('en-GB').format('-12.3E-4'); >new Intl.NumberFormat('en-GB').format('-12.3E-4') : string ->new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | `${number}`): string; } +> : ^^^^^^ +>new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Intl.NumberFormat('en-GB') : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ >Intl.NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Intl : typeof Intl +> : ^^^^^^^^^^^ >NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'en-GB' : "en-GB" ->format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | `${number}`): string; } +> : ^^^^^^^ +>format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'-12.3E-4' : "-12.3E-4" +> : ^^^^^^^^^^ new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); >new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8') : string ->new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => string +> : ^^^^^^ +>new Intl.NumberFormat('en-GB').formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => 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 | `${number}`, end: number | bigint | `${number}`) => string +> : ^^^^^^^ +>formatRange : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'123.4' : "123.4" +> : ^^^^^^^ >'567.8' : "567.8" +> : ^^^^^^^ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); >new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8') : Intl.NumberRangeFormatPart[] ->new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB').formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => 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 | `${number}`, end: number | bigint | `${number}`) => Intl.NumberRangeFormatPart[] +> : ^^^^^^^ +>formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >'123E-4' : "123E-4" +> : ^^^^^^^^ >'567E8' : "567E8" +> : ^^^^^^^ + +new Intl.NumberFormat('en-GB').format('Infinity'); +>new Intl.NumberFormat('en-GB').format('Infinity') : string +> : ^^^^^^ +>new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ +>Intl.NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'en-GB' : "en-GB" +> : ^^^^^^^ +>format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'Infinity' : "Infinity" +> : ^^^^^^^^^^ + +new Intl.NumberFormat('en-GB').format('-Infinity'); +>new Intl.NumberFormat('en-GB').format('-Infinity') : string +> : ^^^^^^ +>new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ +>Intl.NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'en-GB' : "en-GB" +> : ^^^^^^^ +>format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'-Infinity' : "-Infinity" +> : ^^^^^^^^^^^ + +new Intl.NumberFormat('en-GB').format('+Infinity'); +>new Intl.NumberFormat('en-GB').format('+Infinity') : string +> : ^^^^^^ +>new Intl.NumberFormat('en-GB').format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat('en-GB') : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ +>Intl.NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'en-GB' : "en-GB" +> : ^^^^^^^ +>format : { (value: number): string; (value: number | bigint): string; (value: number | bigint | Intl.StringNumericLiteral): string; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'+Infinity' : "+Infinity" +> : ^^^^^^^^^^^ diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index 1f2ba680ba987..1255f41968994 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -29,3 +29,6 @@ new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; new Intl.NumberFormat('en-GB').format('-12.3E-4'); new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); +new Intl.NumberFormat('en-GB').format('Infinity'); +new Intl.NumberFormat('en-GB').format('-Infinity'); +new Intl.NumberFormat('en-GB').format('+Infinity');