From 2fe6cd8bb62469dd2102a99298c4deffbc1add0d Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Sat, 16 Nov 2024 17:19:24 +0800 Subject: [PATCH] Return iterable of RegExpExecArray from RegExp#[Symbol.matchAll] --- src/lib/es2020.symbol.wellknown.d.ts | 2 +- tests/baselines/reference/regexMatchAll-esnext.types | 8 ++++---- tests/baselines/reference/regexMatchAll.types | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/es2020.symbol.wellknown.d.ts b/src/lib/es2020.symbol.wellknown.d.ts index cdf0349f9b420..0f268da0a10f3 100644 --- a/src/lib/es2020.symbol.wellknown.d.ts +++ b/src/lib/es2020.symbol.wellknown.d.ts @@ -19,5 +19,5 @@ interface RegExp { * containing the results of that search. * @param string A string to search within. */ - [Symbol.matchAll](str: string): RegExpStringIterator; + [Symbol.matchAll](str: string): RegExpStringIterator; } diff --git a/tests/baselines/reference/regexMatchAll-esnext.types b/tests/baselines/reference/regexMatchAll-esnext.types index af8bf8d1466a9..dee7700133d9f 100644 --- a/tests/baselines/reference/regexMatchAll-esnext.types +++ b/tests/baselines/reference/regexMatchAll-esnext.types @@ -2,11 +2,11 @@ === regexMatchAll-esnext.ts === const matches = /\w/g[Symbol.matchAll]("matchAll"); ->matches : RegExpStringIterator +>matches : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator +>/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator +>/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator > : ^ ^^ ^^^^^ >/\w/g : RegExp > : ^^^^^^ @@ -26,7 +26,7 @@ const array = [...matches]; > : ^^^^^^^^^^^^^^^^^^ >...matches : RegExpMatchArray > : ^^^^^^^^^^^^^^^^ ->matches : RegExpStringIterator +>matches : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const { index, input } = array[0]; diff --git a/tests/baselines/reference/regexMatchAll.types b/tests/baselines/reference/regexMatchAll.types index 9b937a0577e25..3e22522c9845f 100644 --- a/tests/baselines/reference/regexMatchAll.types +++ b/tests/baselines/reference/regexMatchAll.types @@ -2,11 +2,11 @@ === regexMatchAll.ts === const matches = /\w/g[Symbol.matchAll]("matchAll"); ->matches : RegExpStringIterator +>matches : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator +>/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator +>/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator > : ^ ^^ ^^^^^ >/\w/g : RegExp > : ^^^^^^ @@ -26,7 +26,7 @@ const array = [...matches]; > : ^^^^^^^^^^^^^^^^^^ >...matches : RegExpMatchArray > : ^^^^^^^^^^^^^^^^ ->matches : RegExpStringIterator +>matches : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const { index, input } = array[0];