Skip to content

Commit 431d3e8

Browse files
authored
fix(56513): Allow Intl locales to be readonly arrays (#56621)
1 parent efc9c06 commit 431d3e8

8 files changed

+179
-27
lines changed

src/lib/es2016.intl.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ declare namespace Intl {
99
* @param locale A list of String values for which to get the canonical locale names
1010
* @returns An array containing the canonical and validated locale names.
1111
*/
12-
function getCanonicalLocales(locale?: string | string[]): string[];
12+
function getCanonicalLocales(locale?: string | readonly string[]): string[];
1313
}

src/lib/es2018.intl.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ declare namespace Intl {
3030
}
3131

3232
interface PluralRulesConstructor {
33-
new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
34-
(locales?: string | string[], options?: PluralRulesOptions): PluralRules;
35-
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
33+
new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
34+
(locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
35+
supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
3636
}
3737

3838
const PluralRules: PluralRulesConstructor;

tests/baselines/reference/es2016IntlAPIs.types

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ console.log(Intl.getCanonicalLocales('EN-US'));
99
>console : Console
1010
>log : (...data: any[]) => void
1111
>Intl.getCanonicalLocales('EN-US') : string[]
12-
>Intl.getCanonicalLocales : (locale?: string | string[]) => string[]
12+
>Intl.getCanonicalLocales : (locale?: string | readonly string[]) => string[]
1313
>Intl : typeof Intl
14-
>getCanonicalLocales : (locale?: string | string[]) => string[]
14+
>getCanonicalLocales : (locale?: string | readonly string[]) => string[]
1515
>'EN-US' : "EN-US"
1616

1717
// Expected output: Array ["en-US"]
@@ -22,9 +22,9 @@ console.log(Intl.getCanonicalLocales(['EN-US', 'Fr']));
2222
>console : Console
2323
>log : (...data: any[]) => void
2424
>Intl.getCanonicalLocales(['EN-US', 'Fr']) : string[]
25-
>Intl.getCanonicalLocales : (locale?: string | string[]) => string[]
25+
>Intl.getCanonicalLocales : (locale?: string | readonly string[]) => string[]
2626
>Intl : typeof Intl
27-
>getCanonicalLocales : (locale?: string | string[]) => string[]
27+
>getCanonicalLocales : (locale?: string | readonly string[]) => string[]
2828
>['EN-US', 'Fr'] : string[]
2929
>'EN-US' : "EN-US"
3030
>'Fr' : "Fr"
@@ -34,9 +34,9 @@ console.log(Intl.getCanonicalLocales(['EN-US', 'Fr']));
3434
try {
3535
Intl.getCanonicalLocales('EN_US');
3636
>Intl.getCanonicalLocales('EN_US') : string[]
37-
>Intl.getCanonicalLocales : (locale?: string | string[]) => string[]
37+
>Intl.getCanonicalLocales : (locale?: string | readonly string[]) => string[]
3838
>Intl : typeof Intl
39-
>getCanonicalLocales : (locale?: string | string[]) => string[]
39+
>getCanonicalLocales : (locale?: string | readonly string[]) => string[]
4040
>'EN_US' : "EN_US"
4141

4242
} catch (err) {

tests/baselines/reference/es2018IntlAPIs.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', '));
2525
>Intl.PluralRules.supportedLocalesOf(locales, options).join(', ') : string
2626
>Intl.PluralRules.supportedLocalesOf(locales, options).join : (separator?: string) => string
2727
>Intl.PluralRules.supportedLocalesOf(locales, options) : string[]
28-
>Intl.PluralRules.supportedLocalesOf : (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[]
28+
>Intl.PluralRules.supportedLocalesOf : (locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[]
2929
>Intl.PluralRules : Intl.PluralRulesConstructor
3030
>Intl : typeof Intl
3131
>PluralRules : Intl.PluralRulesConstructor
32-
>supportedLocalesOf : (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[]
32+
>supportedLocalesOf : (locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[]
3333
>locales : string[]
3434
>options : { readonly localeMatcher: "lookup"; }
3535
>join : (separator?: string) => string

tests/baselines/reference/localesObjectArgument.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const num = 1000;
1010
const bigint = 123456789123456789n;
1111
const str = "";
1212

13+
const readonlyLocales: Readonly<string[]> = ['de-DE', 'ja-JP'];
14+
1315
now.toLocaleString(enUS);
1416
now.toLocaleDateString(enUS);
1517
now.toLocaleTimeString(enUS);
@@ -32,28 +34,36 @@ str.localeCompare(str, [deDE, jaJP]);
3234

3335
new Intl.PluralRules(enUS);
3436
new Intl.PluralRules([deDE, jaJP]);
37+
new Intl.PluralRules(readonlyLocales);
3538
Intl.PluralRules.supportedLocalesOf(enUS);
3639
Intl.PluralRules.supportedLocalesOf([deDE, jaJP]);
40+
Intl.PluralRules.supportedLocalesOf(readonlyLocales);
3741

3842
new Intl.RelativeTimeFormat(enUS);
3943
new Intl.RelativeTimeFormat([deDE, jaJP]);
44+
new Intl.RelativeTimeFormat(readonlyLocales);
4045
Intl.RelativeTimeFormat.supportedLocalesOf(enUS);
4146
Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]);
47+
Intl.RelativeTimeFormat.supportedLocalesOf(readonlyLocales);
4248

4349
new Intl.Collator(enUS);
4450
new Intl.Collator([deDE, jaJP]);
51+
new Intl.Collator(readonlyLocales);
4552
Intl.Collator.supportedLocalesOf(enUS);
4653
Intl.Collator.supportedLocalesOf([deDE, jaJP]);
4754

4855
new Intl.DateTimeFormat(enUS);
4956
new Intl.DateTimeFormat([deDE, jaJP]);
57+
new Intl.DateTimeFormat(readonlyLocales);
5058
Intl.DateTimeFormat.supportedLocalesOf(enUS);
5159
Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]);
60+
Intl.DateTimeFormat.supportedLocalesOf(readonlyLocales);
5261

5362
new Intl.NumberFormat(enUS);
5463
new Intl.NumberFormat([deDE, jaJP]);
64+
new Intl.NumberFormat(readonlyLocales);
5565
Intl.NumberFormat.supportedLocalesOf(enUS);
56-
Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]);
66+
Intl.NumberFormat.supportedLocalesOf(readonlyLocales);
5767

5868

5969
//// [localesObjectArgument.js]
@@ -64,6 +74,7 @@ const now = new Date();
6474
const num = 1000;
6575
const bigint = 123456789123456789n;
6676
const str = "";
77+
const readonlyLocales = ['de-DE', 'ja-JP'];
6778
now.toLocaleString(enUS);
6879
now.toLocaleDateString(enUS);
6980
now.toLocaleTimeString(enUS);
@@ -82,21 +93,29 @@ str.localeCompare(str, enUS);
8293
str.localeCompare(str, [deDE, jaJP]);
8394
new Intl.PluralRules(enUS);
8495
new Intl.PluralRules([deDE, jaJP]);
96+
new Intl.PluralRules(readonlyLocales);
8597
Intl.PluralRules.supportedLocalesOf(enUS);
8698
Intl.PluralRules.supportedLocalesOf([deDE, jaJP]);
99+
Intl.PluralRules.supportedLocalesOf(readonlyLocales);
87100
new Intl.RelativeTimeFormat(enUS);
88101
new Intl.RelativeTimeFormat([deDE, jaJP]);
102+
new Intl.RelativeTimeFormat(readonlyLocales);
89103
Intl.RelativeTimeFormat.supportedLocalesOf(enUS);
90104
Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]);
105+
Intl.RelativeTimeFormat.supportedLocalesOf(readonlyLocales);
91106
new Intl.Collator(enUS);
92107
new Intl.Collator([deDE, jaJP]);
108+
new Intl.Collator(readonlyLocales);
93109
Intl.Collator.supportedLocalesOf(enUS);
94110
Intl.Collator.supportedLocalesOf([deDE, jaJP]);
95111
new Intl.DateTimeFormat(enUS);
96112
new Intl.DateTimeFormat([deDE, jaJP]);
113+
new Intl.DateTimeFormat(readonlyLocales);
97114
Intl.DateTimeFormat.supportedLocalesOf(enUS);
98115
Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]);
116+
Intl.DateTimeFormat.supportedLocalesOf(readonlyLocales);
99117
new Intl.NumberFormat(enUS);
100118
new Intl.NumberFormat([deDE, jaJP]);
119+
new Intl.NumberFormat(readonlyLocales);
101120
Intl.NumberFormat.supportedLocalesOf(enUS);
102-
Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]);
121+
Intl.NumberFormat.supportedLocalesOf(readonlyLocales);

tests/baselines/reference/localesObjectArgument.symbols

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const bigint = 123456789123456789n;
3232
const str = "";
3333
>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5))
3434

35+
const readonlyLocales: Readonly<string[]> = ['de-DE', 'ja-JP'];
36+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
37+
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
38+
3539
now.toLocaleString(enUS);
3640
>now.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --))
3741
>now : Symbol(now, Decl(localesObjectArgument.ts, 4, 5))
@@ -151,6 +155,12 @@ new Intl.PluralRules([deDE, jaJP]);
151155
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
152156
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
153157

158+
new Intl.PluralRules(readonlyLocales);
159+
>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --))
160+
>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)
161+
>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --))
162+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
163+
154164
Intl.PluralRules.supportedLocalesOf(enUS);
155165
>Intl.PluralRules.supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
156166
>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --))
@@ -168,6 +178,14 @@ Intl.PluralRules.supportedLocalesOf([deDE, jaJP]);
168178
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
169179
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
170180

181+
Intl.PluralRules.supportedLocalesOf(readonlyLocales);
182+
>Intl.PluralRules.supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
183+
>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --))
184+
>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)
185+
>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --))
186+
>supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
187+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
188+
171189
new Intl.RelativeTimeFormat(enUS);
172190
>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
173191
>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)
@@ -181,6 +199,12 @@ new Intl.RelativeTimeFormat([deDE, jaJP]);
181199
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
182200
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
183201

202+
new Intl.RelativeTimeFormat(readonlyLocales);
203+
>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
204+
>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)
205+
>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
206+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
207+
184208
Intl.RelativeTimeFormat.supportedLocalesOf(enUS);
185209
>Intl.RelativeTimeFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --))
186210
>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
@@ -198,6 +222,14 @@ Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]);
198222
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
199223
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
200224

225+
Intl.RelativeTimeFormat.supportedLocalesOf(readonlyLocales);
226+
>Intl.RelativeTimeFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --))
227+
>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
228+
>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)
229+
>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
230+
>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --))
231+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
232+
201233
new Intl.Collator(enUS);
202234
>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
203235
>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)
@@ -211,6 +243,12 @@ new Intl.Collator([deDE, jaJP]);
211243
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
212244
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
213245

246+
new Intl.Collator(readonlyLocales);
247+
>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
248+
>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)
249+
>Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
250+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
251+
214252
Intl.Collator.supportedLocalesOf(enUS);
215253
>Intl.Collator.supportedLocalesOf : Symbol(Intl.CollatorConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
216254
>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
@@ -241,6 +279,12 @@ new Intl.DateTimeFormat([deDE, jaJP]);
241279
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
242280
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
243281

282+
new Intl.DateTimeFormat(readonlyLocales);
283+
>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --))
284+
>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)
285+
>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --))
286+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
287+
244288
Intl.DateTimeFormat.supportedLocalesOf(enUS);
245289
>Intl.DateTimeFormat.supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
246290
>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --))
@@ -258,6 +302,14 @@ Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]);
258302
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
259303
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
260304

305+
Intl.DateTimeFormat.supportedLocalesOf(readonlyLocales);
306+
>Intl.DateTimeFormat.supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
307+
>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --))
308+
>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)
309+
>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --))
310+
>supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
311+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
312+
261313
new Intl.NumberFormat(enUS);
262314
>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, --, --))
263315
>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)
@@ -271,6 +323,12 @@ new Intl.NumberFormat([deDE, jaJP]);
271323
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
272324
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
273325

326+
new Intl.NumberFormat(readonlyLocales);
327+
>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, --, --))
328+
>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)
329+
>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, --, --))
330+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
331+
274332
Intl.NumberFormat.supportedLocalesOf(enUS);
275333
>Intl.NumberFormat.supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
276334
>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, --, --))
@@ -279,12 +337,11 @@ Intl.NumberFormat.supportedLocalesOf(enUS);
279337
>supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
280338
>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5))
281339

282-
Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]);
340+
Intl.NumberFormat.supportedLocalesOf(readonlyLocales);
283341
>Intl.NumberFormat.supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
284342
>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, --, --))
285343
>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)
286344
>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, --, --))
287345
>supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
288-
>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5))
289-
>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5))
346+
>readonlyLocales : Symbol(readonlyLocales, Decl(localesObjectArgument.ts, 9, 5))
290347

0 commit comments

Comments
 (0)