You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
Likely a regression from #10430, but the contents of u regexps are getting transformed to being non-u without updating a regexp's flags. The problem becomes a more serious bug when the s flag is also present, as the transformed . no longer matches newlines.
Note how the regexp, which didn't even have to be transformed from being a unicode regexp (and didn't remove the u flag after doing it), specifically skips over both \x0A and \x0D, the \n and \r characters, which are supposed to be matched because the regexp has the s flag.
Possible Solution
Need some way to tell regexpu to not do the unicode downleveling; or if unicode transformation is "inevitable" the dotAll flag needs to be respected.
The text was updated successfully, but these errors were encountered:
Bug Report
Current Behavior
Likely a regression from #10430, but the contents of
u
regexps are getting transformed to being non-u
without updating a regexp's flags. The problem becomes a more serious bug when thes
flag is also present, as the transformed.
no longer matches newlines.Input Code
Expected behavior/code
A clear and concise description of what you expected to happen (or code).
Output with
@7.4.5
(ignoring helpers, just the regexp):/<(\d)+>.*?<\/\1>/su
Output with
@7.6.3
:/<([0-9])+>(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?<\/\1>/su
Note how the regexp, which didn't even have to be transformed from being a unicode regexp (and didn't remove the
u
flag after doing it), specifically skips over both\x0A
and\x0D
, the\n
and\r
characters, which are supposed to be matched because the regexp has thes
flag.Babel Configuration (.babelrc, package.json, cli command)
Environment
babel-jest
Possible Solution
Need some way to tell
regexpu
to not do the unicode downleveling; or if unicode transformation is "inevitable" thedotAll
flag needs to be respected.The text was updated successfully, but these errors were encountered: