Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/esnext.intl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ declare namespace Intl {
}

interface NumberFormat {
formatToParts(number?: number): NumberFormatPart[];
formatToParts(number?: number | bigint): NumberFormatPart[];
}
}
13 changes: 13 additions & 0 deletions tests/baselines/reference/formatToPartsBigInt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [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));
19 changes: 19 additions & 0 deletions tests/baselines/reference/formatToPartsBigInt.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=== tests/cases/compiler/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.esnext.intl.d.ts, --, --))
>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --))
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 1 more)
>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --))
>formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.esnext.intl.d.ts, --, --))

new Intl.NumberFormat("fr").formatToParts(BigInt(123));
>new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.esnext.intl.d.ts, --, --))
>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --))
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 1 more)
>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --))
>formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.esnext.intl.d.ts, --, --))
>BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --))

28 changes: 28 additions & 0 deletions tests/baselines/reference/formatToPartsBigInt.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
=== tests/cases/compiler/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 : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
>Intl : typeof Intl
>NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
>"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 : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
>Intl : typeof Intl
>NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; }
>"fr" : "fr"
>formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[]
>BigInt(123) : bigint
>BigInt : BigIntConstructor
>123 : 123

7 changes: 7 additions & 0 deletions tests/cases/compiler/formatToPartsBigInt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @target: esnext

// 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));