-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Correct regular expression flags scanning for non-BMP characters #58612
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
(cherry picked from commit e67692a)
ade740e
to
0725a3a
Compare
Overall, this looks good. It looks like there are some failing tests that still need to be resolved. Also, since this isn't a bug fix, per se, I expect we will want to hold off from putting this in the 5.5 RC and will wait to merge after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching from "Approve" to "Request Changes" until the test issues are resolved.
fc3dd58
to
723b1d6
Compare
IMO it is a bug fix especially since I forgot to revert the change on line 2561 in #58289. And it’s important to align the scanner behavior to the spec. |
What change do you mean? If it's not related to code points then I could see taking a small fix for that. Properly handling non-BMP characters in flags doesn't come up in practice and delaying this specific functionality will only result in a slightly less informative error since none of the valid flag/modifier characters will ever be equivalent to the first byte of a multi-byte code point.
|
This line, which causes the |
Use `codePointChecked` instead of `charCodeChecked` in `reScanSlashToken`
Per the IsValidRegularExpressionLiteral static semantics in the ECMA262 specification, FlagText should be interpreted in code points, not code units.
Cherry picked from #58289@
e67692a
.