-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't convert RegExp:Unicode property escapes #2215
Comments
As far as I know there're some other new regex flags added recently. I wonder how could we polyfill/convert them correctly to lower environments. At least is there a reference implementation? |
TypeScript's lowering transform doesn't change the RegExp literal either, even when targeting ES5 (link). See also microsoft/TypeScript#36132 and microsoft/TypeScript#32214. I'm guessing the most straightforward thing for esbuild to do here would be to convert regular expressions into |
Babel seems to support converting RegExp. |
Not always. It looks like Babel just converts |
Babel can't implement sticky behavior without implementing a full matcher, so it's left to runtime. However, it's possible to support unicode, unicode properties escapes, unicode sets, named capture groups, and dotall through |
Thanks very much for the context about what Babel does handle. However, despite that I decided to fix this by converting unsupported regular expression literals to |
There is a new feature in es2018, RegExp: Unicode property escapes; I tried converting it to es2015 but nothing changed in the code.
for example:
output:
this is my configuration:
version: 0.14.38
The text was updated successfully, but these errors were encountered: