Uh oh!
There was an error while loading. Please reload this page.
Correct regular expression flags scanning for non-BMP characters - #58612
Conversation
TypeScript Bot (typescript-bot)
commented
May 22, 2024
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
0725a3aCompareUh oh!
There was an error while loading. Please reload this page.
Ron Buckton (rbuckton)
commented
May 31, 2024
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 |
Ron Buckton (rbuckton)
left a comment
There was a problem hiding this comment.
Switching from "Approve" to "Request Changes" until the test issues are resolved.
fc3dd58 to
723b1d6CompareIMO 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 |
Ron Buckton (rbuckton)
commented
May 31, 2024
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.