Bug 259536
| Summary: | Positive look-behind RegExp doesn't match in JSC but does match in V8 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jarred Sumner <jarred> |
| Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | mark.lam, msaboff, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://github.com/oven-sh/bun/issues/3809 | ||
Jarred Sumner
Reproduction:
```
const print = globalThis.print ?? console.log;
const re =
/(?<=^v?|\sv?)(?:(?:0|[1-9]\d{0,9}?)\.){2}(?:0|[1-9]\d{0,9})(?:-(?:--+)?(?:0|[1-9]\d*|\d*[a-z]+\d*)){0,100}(?=$| |\+|\.)(?:(?<=-\S+)(?:\.(?:--?|[\da-z-]*[a-z-]\d*|0|[1-9]\d*)){1,100}?)?(?!\.)(?:\+(?:[\da-z]\.?-?){1,100}?(?!\w))?(?!\+)/;
const res = re.exec("v1.0.1448");
print(res);
```
`res` is null in jsc shell
In Node, `res` is:
```
[ '1.0.1448', index: 1, input: 'v1.0.1448', groups: undefined ]
```
This is running on a build of JSC from July 23rd
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/112952197>
Michael Saboff
Pull request: https://github.com/WebKit/WebKit/pull/16694
EWS
Committed 266912@main (caa31552bab4): <https://commits.webkit.org/266912@main>
Reviewed commits have been landed. Closing PR #16694 and removing active labels.