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
1 change: 1 addition & 0 deletions src/lib/es2020.intl.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference lib="es2018.intl" />
declare namespace Intl {

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/es2020IntlAPIs.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:335:14: An argument for 'tag' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:336: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:414:13: An argument for 'locales' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:415: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:414:39: An argument for 'options' was not provided.
!!! related TS6210 /.ts/lib.es2020.intl.d.ts:415: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:357:9: 'type' is declared here.
!!! related TS2728 /.ts/lib.es2020.intl.d.ts:358: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")];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//// [esnext.bigintIncludesNumberFormatPartTypes.ts]
/// <reference lib="esnext.bigint" />
var t: Intl.NumberFormatPartTypes


//// [esnext.bigintIncludesNumberFormatPartTypes.js]
/// <reference lib="esnext.bigint" />
var t;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=== tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts ===
/// <reference lib="esnext.bigint" />
var t: Intl.NumberFormatPartTypes
>t : Symbol(t, Decl(esnext.bigintIncludesNumberFormatPartTypes.ts, 1, 3))
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --))
>NumberFormatPartTypes : Symbol(Intl.NumberFormatPartTypes, Decl(lib.es2018.intl.d.ts, --, --))

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=== tests/cases/compiler/esnext.bigintIncludesNumberFormatPartTypes.ts ===
/// <reference lib="esnext.bigint" />
var t: Intl.NumberFormatPartTypes
>t : Intl.NumberFormatPartTypes
>Intl : any

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @lib: es6
/// <reference lib="esnext.bigint" />
var t: Intl.NumberFormatPartTypes