Bug 272274
| Summary: | RegExp.prototype[Symbol.matchAll] doesn't respect `v` flag | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <sosuke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
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
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sosuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/26933
EWS
Committed 277160@main (4b84428a9535): <https://commits.webkit.org/277160@main>
Reviewed commits have been landed. Closing PR #26933 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/126017731>