Skip to content

Commit bbb5322

Browse files
authored
ES2020: fix String.prototype.matchAll type and description (#62873)
1 parent 366da34 commit bbb5322

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lib/es2020.string.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
interface String {
66
/**
7-
* Matches a string with a regular expression, and returns an iterable of matches
7+
* Matches a string with a regular expression or string, and returns an iterable of matches
88
* containing the results of that search.
9-
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
9+
* @param regexp A regular expression or string literal with which to search the string
1010
*/
11-
matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
11+
matchAll(regexp: RegExp | string): RegExpStringIterator<RegExpExecArray>;
1212

1313
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
1414
toLocaleLowerCase(locales?: Intl.LocalesArgument): string;

tests/baselines/reference/stringMatchAll.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const matches = "matchAll".matchAll(/\w/g);
66
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77
>"matchAll".matchAll(/\w/g) : RegExpStringIterator<RegExpExecArray>
88
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9-
>"matchAll".matchAll : (regexp: RegExp) => RegExpStringIterator<RegExpExecArray>
10-
> : ^ ^^ ^^^^^
9+
>"matchAll".matchAll : (regexp: RegExp | string) => RegExpStringIterator<RegExpExecArray>
10+
> : ^ ^^ ^^^^^
1111
>"matchAll" : "matchAll"
1212
> : ^^^^^^^^^^
13-
>matchAll : (regexp: RegExp) => RegExpStringIterator<RegExpExecArray>
14-
> : ^ ^^ ^^^^^
13+
>matchAll : (regexp: RegExp | string) => RegExpStringIterator<RegExpExecArray>
14+
> : ^ ^^ ^^^^^
1515
>/\w/g : RegExp
1616
> : ^^^^^^
1717

0 commit comments

Comments
 (0)