Bug 272274 - RegExp.prototype[Symbol.matchAll] doesn't respect `v` flag
Summary: RegExp.prototype[Symbol.matchAll] doesn't respect `v` flag
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-04-06 00:04 PDT by Sosuke Suzuki
Modified: 2024-04-06 07:16 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sosuke Suzuki 2024-04-06 00:04:16 PDT
poc:

```js
function doMatchAll(regex) {
    const text = '𠮷a𠮷';
    const matches = [...RegExp.prototype[Symbol.matchAll].call(regex, text)];
    print(matches.map(match => match.index));
}

doMatchAll(/(?:)/g);
// expected: 0,1,2,3,4,5
// actual  : 0,1,2,3,4,5

doMatchAll(/(?:)/gu); // 0,2,3,5
// expected: 0,2,3,5
// actual  : 0,2,3,5

doMatchAll(/(?:)/gv); // 0,1,2,3,4,5
// expected: 0,2,3,5
// actual  : 0,1,2,3,4,5
```
Comment 1 Sosuke Suzuki 2024-04-06 00:10:11 PDT
Pull request: https://github.com/WebKit/WebKit/pull/26933
Comment 2 EWS 2024-04-06 07:15:42 PDT
Committed 277160@main (4b84428a9535): <https://commits.webkit.org/277160@main>

Reviewed commits have been landed. Closing PR #26933 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2024-04-06 07:16:14 PDT
<rdar://problem/126017731>