-
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
(class{f(a=1/2){}}.b=2)
is syntax error on Safari <= 16.2
#3072
Comments
(class{f(a=1/2){}}.b=2)
is syntax error on Safari
(class{f(a=1/2){}}.b=2)
is syntax error on Safari(class{f(a=1/2){}}.b=2)
is syntax error on Safari <= 16.2
For now, it's ok to leave this issue to "won't fix" since Safari 16.3+ (iOS 16.3+, which is iPhone 8+ since 2017) already fixed that and this is not a general JavaScript feature. Others may change their build options to disable Feel free to close this issue. |
Thank you for the report. I looked into this and there are a bunch of these. Some examples (I'm testing Safari 12.1 since that's the only old version I have access to):
It looks like Terser with The specific workaround from UglifyJS is here: mishoo/UglifyJS#2056. So the (overly conservative) rule is something like "wrap a function or class expression if the parent is a property access." I can do that in esbuild. And it looks like I can ignore other cases where this happens because they aren't handled by other minifiers in the ecosystem either. |
see it live
The text was updated successfully, but these errors were encountered: