Accepted es2020Intl baseline.

This commit is contained in:
Daniel Rosenwasser 2022-05-11 00:07:29 +00:00 committed by GitHub
parent 3e24f14871
commit 7a3c31f9f9

View File

@ -53,22 +53,22 @@ tests/cases/conformance/es2020/es2020IntlAPIs.ts(50,29): error TS2345: Argument
new Intl.Locale(); // should error
~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 1-2 arguments, but got 0.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:311:14: An argument for 'tag' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:335:14: An argument for 'tag' was not provided.
new Intl.Locale(new Intl.Locale('en-US'));
new Intl.DisplayNames(); // TypeError: invalid_argument
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 2 arguments, but got 0.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:390:13: An argument for 'locales' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:414:13: An argument for 'locales' was not provided.
new Intl.DisplayNames('en'); // TypeError: invalid_argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2554: Expected 2 arguments, but got 1.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:390:39: An argument for 'options' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:414:39: An argument for 'options' was not provided.
new Intl.DisplayNames('en', {}); // TypeError: invalid_argument
~~
!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'DisplayNamesOptions'.
!!! error TS2345: Property 'type' is missing in type '{}' but required in type 'DisplayNamesOptions'.
!!! related TS2728 /.ts/lib.es2020.intl.d.ts:333:9: 'type' is declared here.
!!! related TS2728 /.ts/lib.es2020.intl.d.ts:357:9: 'type' is declared here.
console.log((new Intl.DisplayNames(undefined, {type: 'language'})).of('en-GB')); // "British English"
const localesArg = ["es-ES", new Intl.Locale("en-US")];