-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
ES6 regular expressions unicode mode: case insensitivity case folding inconsistency #7708
Comments
It seems here is the turning point: /(\.[\u00ffA-Z])+/i.test('a.c'); // true
/(\.[\u0100A-Z])+/i.test('a.c'); // false |
I'm not familiar enough with the ES6 regexp changes, but FWIW adding the new |
Well, that is weird. Node.js 6.3.0 /(a[\u0100A-Z])+/i.test('aa'); \\ false
/a([\u0100A-Z])+/i.test('aa'); \\ true
/(a[\u0100A-Z])+/i.test('aa'); \\ false
/(a[\u0100A-Z])/i.test('aa'); \\ true
/(a[\u0100A-Z])+/i.test('aa'); \\ false
/(a[\u00ffA-Z])+/i.test('aa'); \\ true
/(a[\u0100A-Z])+/i.test('aa'); \\ false
/(a[A-Z\u0100])+/i.test('aa'); \\ true
/(a[\u0100A-Z])+/i.test('aa'); \\ false
/(a[\u0100a-z])+/i.test('aa'); \\ true
/(a[\u0100A-Z])+/i.test('aa'); \\ false
/(a[\u0100A-Z])+/i.test('AA'); \\ true |
Someone reported the bug upstream: https://bugs.chromium.org/p/v8/issues/detail?id=5199 |
Issue has been fixed and ported back to V8 5.3 and 5.2. Please comment to the V8 issue if we need to merge this further back. |
Thank! The older V8 streams (5.1 and older) are no longer accepting merges upstream, so fixes would have to be floated for |
Yes, working on it. |
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{nodejs#37833} Fixes: nodejs#7708
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{nodejs#37833} Fixes: nodejs#7708
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{#37833} Fixes: #7708 PR-URL: #7834 Ref: #7833 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{#37833} Fixes: nodejs/node#7708 PR-URL: nodejs/node#7834 Ref: nodejs/node#7833 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{nodejs#37833} Fixes: nodejs#7708 PR-URL: nodejs#7833 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
why?
The text was updated successfully, but these errors were encountered: