From 6eb1f1cb21fff901571565f9e30dc2ed69ca66a4 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 11 Dec 2025 13:09:42 -0800 Subject: [PATCH 1/2] Revert "ES2020: fix String.prototype.matchAll type and description (#62873)" This reverts commit bbb5322c96e5d98fbdd50ac16ef7967e1560c92a. --- src/lib/es2020.string.d.ts | 6 +++--- tests/baselines/reference/stringMatchAll.types | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index 58ae8fe75ccee..fd8ce55f1405d 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -4,11 +4,11 @@ interface String { /** - * Matches a string with a regular expression or string, and returns an iterable of matches + * Matches a string with a regular expression, and returns an iterable of matches * containing the results of that search. - * @param regexp A regular expression or string literal with which to search the string + * @param regexp A variable name or string literal containing the regular expression pattern and flags. */ - matchAll(regexp: RegExp | string): RegExpStringIterator; + matchAll(regexp: RegExp): RegExpStringIterator; /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ toLocaleLowerCase(locales?: Intl.LocalesArgument): string; diff --git a/tests/baselines/reference/stringMatchAll.types b/tests/baselines/reference/stringMatchAll.types index 9321c24b18458..0de59f913a9a2 100644 --- a/tests/baselines/reference/stringMatchAll.types +++ b/tests/baselines/reference/stringMatchAll.types @@ -6,12 +6,12 @@ const matches = "matchAll".matchAll(/\w/g); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"matchAll".matchAll(/\w/g) : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->"matchAll".matchAll : (regexp: RegExp | string) => RegExpStringIterator -> : ^ ^^ ^^^^^ +>"matchAll".matchAll : (regexp: RegExp) => RegExpStringIterator +> : ^ ^^ ^^^^^ >"matchAll" : "matchAll" > : ^^^^^^^^^^ ->matchAll : (regexp: RegExp | string) => RegExpStringIterator -> : ^ ^^ ^^^^^ +>matchAll : (regexp: RegExp) => RegExpStringIterator +> : ^ ^^ ^^^^^ >/\w/g : RegExp > : ^^^^^^ From 88b2c84d11ec9529a999de8f4b664dc3e02a4f68 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 11 Dec 2025 13:59:19 -0800 Subject: [PATCH 2/2] Apply suggestion from @jakebailey --- src/lib/es2020.string.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index fd8ce55f1405d..a19435e6ab996 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -6,7 +6,7 @@ interface String { /** * Matches a string with a regular expression, and returns an iterable of matches * containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. + * @param regexp A regular expression */ matchAll(regexp: RegExp): RegExpStringIterator;