Point es2020 in esnext.d.ts (#32776)

This commit is contained in:
Kagami Sascha Rosylight 2019-08-16 02:06:46 +09:00 committed by Ryan Cavanaugh
parent 2dd10bdfa1
commit f304b81fa5
6 changed files with 57 additions and 2 deletions

2
src/lib/esnext.d.ts vendored
View File

@ -1,3 +1,3 @@
/// <reference lib="es2019" />
/// <reference lib="es2020" />
/// <reference lib="esnext.bigint" />
/// <reference lib="esnext.intl" />

View File

@ -53,7 +53,7 @@ typedArray[bigNum] = 0xAA; // should error
typedArray[String(bigNum)] = 0xAA;
>typedArray : Symbol(typedArray, Decl(a.ts, 17, 5))
>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)
>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)
>bigNum : Symbol(bigNum, Decl(a.ts, 16, 5))
typedArray["1"] = 0xBB;

View File

@ -0,0 +1,10 @@
//// [regexMatchAll-esnext.ts]
const matches = /\w/g[Symbol.matchAll]("matchAll");
const array = [...matches];
const { index, input } = array[0];
//// [regexMatchAll-esnext.js]
const matches = /\w/g[Symbol.matchAll]("matchAll");
const array = [...matches];
const { index, input } = array[0];

View File

@ -0,0 +1,16 @@
=== tests/cases/compiler/regexMatchAll-esnext.ts ===
const matches = /\w/g[Symbol.matchAll]("matchAll");
>matches : Symbol(matches, Decl(regexMatchAll-esnext.ts, 0, 5))
>Symbol.matchAll : Symbol(SymbolConstructor.matchAll, Decl(lib.es2020.symbol.wellknown.d.ts, --, --))
>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, --, --))
>matchAll : Symbol(SymbolConstructor.matchAll, Decl(lib.es2020.symbol.wellknown.d.ts, --, --))
const array = [...matches];
>array : Symbol(array, Decl(regexMatchAll-esnext.ts, 1, 5))
>matches : Symbol(matches, Decl(regexMatchAll-esnext.ts, 0, 5))
const { index, input } = array[0];
>index : Symbol(index, Decl(regexMatchAll-esnext.ts, 2, 7))
>input : Symbol(input, Decl(regexMatchAll-esnext.ts, 2, 14))
>array : Symbol(array, Decl(regexMatchAll-esnext.ts, 1, 5))

View File

@ -0,0 +1,24 @@
=== tests/cases/compiler/regexMatchAll-esnext.ts ===
const matches = /\w/g[Symbol.matchAll]("matchAll");
>matches : IterableIterator<RegExpMatchArray>
>/\w/g[Symbol.matchAll]("matchAll") : IterableIterator<RegExpMatchArray>
>/\w/g[Symbol.matchAll] : (str: string) => IterableIterator<RegExpMatchArray>
>/\w/g : RegExp
>Symbol.matchAll : symbol
>Symbol : SymbolConstructor
>matchAll : symbol
>"matchAll" : "matchAll"
const array = [...matches];
>array : RegExpMatchArray[]
>[...matches] : RegExpMatchArray[]
>...matches : RegExpMatchArray
>matches : IterableIterator<RegExpMatchArray>
const { index, input } = array[0];
>index : number
>input : string
>array[0] : RegExpMatchArray
>array : RegExpMatchArray[]
>0 : 0

View File

@ -0,0 +1,5 @@
// @target: esnext
const matches = /\w/g[Symbol.matchAll]("matchAll");
const array = [...matches];
const { index, input } = array[0];