diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 0c04a27b1c3..4c3c558916f 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4284,6 +4284,7 @@ declare namespace Intl { style?: string; currency?: string; currencyDisplay?: string; + currencySign?: string; useGrouping?: boolean; minimumIntegerDigits?: number; minimumFractionDigits?: number; diff --git a/tests/baselines/reference/numberFormatCurrencySign.js b/tests/baselines/reference/numberFormatCurrencySign.js new file mode 100644 index 00000000000..9f2482e2bff --- /dev/null +++ b/tests/baselines/reference/numberFormatCurrencySign.js @@ -0,0 +1,6 @@ +//// [numberFormatCurrencySign.ts] +const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999); + + +//// [numberFormatCurrencySign.js] +var 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 new file mode 100644 index 00000000000..3252448682c --- /dev/null +++ b/tests/baselines/reference/numberFormatCurrencySign.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/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, --, --)) +>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, --, --)) +>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, --, --)) + diff --git a/tests/baselines/reference/numberFormatCurrencySign.types b/tests/baselines/reference/numberFormatCurrencySign.types new file mode 100644 index 00000000000..343951cb8e9 --- /dev/null +++ b/tests/baselines/reference/numberFormatCurrencySign.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/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 +>new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : 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[]; } +>'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 +>999999 : 999999 + diff --git a/tests/cases/compiler/numberFormatCurrencySign.ts b/tests/cases/compiler/numberFormatCurrencySign.ts new file mode 100644 index 00000000000..ee70de4a9b7 --- /dev/null +++ b/tests/cases/compiler/numberFormatCurrencySign.ts @@ -0,0 +1 @@ +const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999);