ES2020: fix String.prototype.matchAll type and description (#62873)

This commit is contained in:
Jordan Harband 2025-12-11 11:36:19 -08:00 committed by GitHub
parent 366da34ae6
commit bbb5322c96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -4,11 +4,11 @@
interface String {
/**
* Matches a string with a regular expression, and returns an iterable of matches
* Matches a string with a regular expression or string, 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 or string literal with which to search the string
*/
matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
matchAll(regexp: RegExp | string): RegExpStringIterator<RegExpExecArray>;
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
toLocaleLowerCase(locales?: Intl.LocalesArgument): string;

View File

@ -6,12 +6,12 @@ const matches = "matchAll".matchAll(/\w/g);
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"matchAll".matchAll(/\w/g) : RegExpStringIterator<RegExpExecArray>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"matchAll".matchAll : (regexp: RegExp) => RegExpStringIterator<RegExpExecArray>
> : ^ ^^ ^^^^^
>"matchAll".matchAll : (regexp: RegExp | string) => RegExpStringIterator<RegExpExecArray>
> : ^ ^^ ^^^^^
>"matchAll" : "matchAll"
> : ^^^^^^^^^^
>matchAll : (regexp: RegExp) => RegExpStringIterator<RegExpExecArray>
> : ^ ^^ ^^^^^
>matchAll : (regexp: RegExp | string) => RegExpStringIterator<RegExpExecArray>
> : ^ ^^ ^^^^^
>/\w/g : RegExp
> : ^^^^^^