-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
- `String.prototype.matchAll`: - use `RegExpCreate` when `Symbol.prototype.matchAll` is not found - fall back to regex coercion otherwise - `RegExp.prototype[Symbol.matchAll]`: - receiver is assumed to be a regex implicitly - remove `MatchAllIterator` abstract operation Thus, `IsRegExp` call no longer exists. Addresses #21. Addresses #34. Closes #37.
cc @peterwmwong |
cc @anba |
@ljharb Can you elaborate on how this is different from #37? It looks like you're still trying to support |
That desire was brought up in committee in January, and there were no objections to doing so. If you think it needs to be brought before the committee again, I can add it to the agenda (noting that the "status quo" is neither, because some methods do one thing and some do another - so I've chosen the more robust approach). |
There were no objections in January, but the abovementioned discussion took place after that.
Can you list the other methods that are robust against |
@mathiasbynens Sure!
vs the ones without a fallback in the case of a missing symbol method:
My argument includes that "match" is a special method - its presence means If you take away the methods from the above list that have dual purposes - namely, |
894ef0b
to
0228fc5
Compare
I'd like to merge this now - it seems as if doing so would leave only one outstanding item: what should happen when Are there any objections to me merging this, and continuing that discussion in a new issue if there's still a need to pursue it? |
I’d like to hear from @anba, @littledan, and @tschneidereit first. |
It looks like the proposed changes here and the ones in #37 for |
Mirroring my comment at #37 (comment) The fallback in 'replace' and 'split' is different, because it defaults to perform String instead of RegExp matching (i.e. |
I agree with @anba, but I also don't feel all too strongly about this, fwiw. I certainly wouldn't hold up anything over the remaining differences. However, bringing them to the next meeting does seem reasonable, so 👍 on that. |
…/proposal-string-matchall#38) - Removes IsRegExp check and special handling when false - Removes MatchAllIterator - Extracts previously inlined CreateRegExpStringIterator - Update comments to match spec text and numbering Bug: v8:6890 Change-Id: Ie81757a499acc77910f029835fb042e70d86d83d Reviewed-on: https://chromium-review.googlesource.com/c/1317830 Commit-Queue: Peter Wong <peter.wm.wong@gmail.com> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#57488}
String.prototype.matchAll
:RegExpCreate
whenSymbol.prototype.matchAll
is not foundRegExp.prototype[Symbol.matchAll]
:MatchAllIterator
abstract operationThus,
IsRegExp
call no longer exists.Addresses #21. Addresses #34. Closes #37.