Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: String.prototype.matchAll iterators won't return null #3423

Merged

Conversation

susisu
Copy link
Contributor

@susisu susisu commented Sep 9, 2024

Closes #3421

spec.html Outdated
@@ -34894,7 +34894,7 @@ <h1>String.prototype.match ( _regexp_ )</h1>

<emu-clause id="sec-string.prototype.matchall">
<h1>String.prototype.matchAll ( _regexp_ )</h1>
<p>This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator. Each iteration result's value is an Array containing the results of the match, or *null* if the String did not match.</p>
<p>This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator. Each iteration result's value is an Array containing the results of the match.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but I would probably say a bit more.

Suggested change
<p>This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator. Each iteration result's value is an Array containing the results of the match.</p>
<p>This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator that yields match results. Each match result is an Array containing the matched portion of the String as the first element, followed by the portions matched by any capturing groups. If the regular expression never matches, the returned iterator does not yield any match results.</p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also <dfn> a term for these match result arrays constructed and returned by RegExpBuiltinExec. /cc @tc39/ecma262-editors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the editor call today, @syg agreed that we should probably <dfn> this thing. We could do it as part of this PR or as a follow-up, doesn't matter to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review!

I'm totally not sure how to add a definition for the term, so I'd prefer not to address that in this PR.

@michaelficarra michaelficarra added editor call to be discussed in the next editor call and removed editor call to be discussed in the next editor call labels Sep 17, 2024
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Oct 2, 2024
@michaelficarra michaelficarra force-pushed the tweak-string-prototype-matchall-description branch from ea3f999 to b688e11 Compare October 2, 2024 22:14
@ljharb ljharb force-pushed the tweak-string-prototype-matchall-description branch from b688e11 to 76814cb Compare October 4, 2024 08:12
@ljharb

This comment was marked as resolved.

@susisu

This comment was marked as resolved.

@ljharb ljharb merged commit 76814cb into tc39:main Oct 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editorial: String.prototype.matchAll iterators won't return null
5 participants