-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
[Bug]: @babel/traverse v7.17.10 broken this
scope with dead code elimination plugin
#1028
Comments
Hey @qtiki! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
this
scope with dead code elimination pluginthis
scope with dead code elimination plugin
this
scope with dead code elimination pluginthis
scope with dead code elimination plugin
Thanks for the report. This issue should be fixed in the minify plugin. minify/packages/babel-plugin-minify-dead-code-elimination/src/index.js Lines 357 to 359 in 1ad7838
Before v7.17.10 Babel does not report |
Note that Unfortunately this project appears to be unmaintained (the last commit was in August of 2020), so looking into other minifiers might also not be a bad idea. |
This is quite bad. We have a build pipeline that relies on |
💻
How are you using Babel?
@babel/cli
Input code
Reproduced in Babel REPL.
Configuration file name
No response
Configuration
No response
Current and expected behavior
Enabling
babel-plugin-minify-dead-code-elimination
plugin destroysthis
scope for arrow functions inside classes.The
var _this = this
workaround should not be eliminated as it is absolutely necessary for thethis
scope to work in locally defined arrow functions.Environment
Possible solution
No response
Additional context
I narrowed the problem down locally to
@babel/traverse
v7.17.10. By reverting that package to v7.17.9 this problem does not occur.The text was updated successfully, but these errors were encountered: