Skip to content

Commit f304b81

Browse files
saschanazRyanCavanaugh
authored andcommitted
Point es2020 in esnext.d.ts (microsoft#32776)
1 parent 2dd10bd commit f304b81

File tree

6 files changed

+57
-2
lines changed

6 files changed

+57
-2
lines changed

src/lib/esnext.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/// <reference lib="es2019" />
1+
/// <reference lib="es2020" />
22
/// <reference lib="esnext.bigint" />
33
/// <reference lib="esnext.intl" />

tests/baselines/reference/bigintIndex.symbols

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedArray[bigNum] = 0xAA; // should error
5353

5454
typedArray[String(bigNum)] = 0xAA;
5555
>typedArray : Symbol(typedArray, Decl(a.ts, 17, 5))
56-
>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 3 more)
56+
>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 4 more)
5757
>bigNum : Symbol(bigNum, Decl(a.ts, 16, 5))
5858

5959
typedArray["1"] = 0xBB;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//// [regexMatchAll-esnext.ts]
2+
const matches = /\w/g[Symbol.matchAll]("matchAll");
3+
const array = [...matches];
4+
const { index, input } = array[0];
5+
6+
7+
//// [regexMatchAll-esnext.js]
8+
const matches = /\w/g[Symbol.matchAll]("matchAll");
9+
const array = [...matches];
10+
const { index, input } = array[0];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=== tests/cases/compiler/regexMatchAll-esnext.ts ===
2+
const matches = /\w/g[Symbol.matchAll]("matchAll");
3+
>matches : Symbol(matches, Decl(regexMatchAll-esnext.ts, 0, 5))
4+
>Symbol.matchAll : Symbol(SymbolConstructor.matchAll, Decl(lib.es2020.symbol.wellknown.d.ts, --, --))
5+
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
6+
>matchAll : Symbol(SymbolConstructor.matchAll, Decl(lib.es2020.symbol.wellknown.d.ts, --, --))
7+
8+
const array = [...matches];
9+
>array : Symbol(array, Decl(regexMatchAll-esnext.ts, 1, 5))
10+
>matches : Symbol(matches, Decl(regexMatchAll-esnext.ts, 0, 5))
11+
12+
const { index, input } = array[0];
13+
>index : Symbol(index, Decl(regexMatchAll-esnext.ts, 2, 7))
14+
>input : Symbol(input, Decl(regexMatchAll-esnext.ts, 2, 14))
15+
>array : Symbol(array, Decl(regexMatchAll-esnext.ts, 1, 5))
16+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
=== tests/cases/compiler/regexMatchAll-esnext.ts ===
2+
const matches = /\w/g[Symbol.matchAll]("matchAll");
3+
>matches : IterableIterator<RegExpMatchArray>
4+
>/\w/g[Symbol.matchAll]("matchAll") : IterableIterator<RegExpMatchArray>
5+
>/\w/g[Symbol.matchAll] : (str: string) => IterableIterator<RegExpMatchArray>
6+
>/\w/g : RegExp
7+
>Symbol.matchAll : symbol
8+
>Symbol : SymbolConstructor
9+
>matchAll : symbol
10+
>"matchAll" : "matchAll"
11+
12+
const array = [...matches];
13+
>array : RegExpMatchArray[]
14+
>[...matches] : RegExpMatchArray[]
15+
>...matches : RegExpMatchArray
16+
>matches : IterableIterator<RegExpMatchArray>
17+
18+
const { index, input } = array[0];
19+
>index : number
20+
>input : string
21+
>array[0] : RegExpMatchArray
22+
>array : RegExpMatchArray[]
23+
>0 : 0
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @target: esnext
2+
3+
const matches = /\w/g[Symbol.matchAll]("matchAll");
4+
const array = [...matches];
5+
const { index, input } = array[0];

0 commit comments

Comments
 (0)