[Bug]: invalid code optimization with @babel/transform 7.17.10 #14534
Labels
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
`class Test {
foo() {
}`
Configuration file name
No response
Configuration
No response
Current and expected behavior
Transpiled code used to be
checkWithUserForItemOrgAssociation(){var a=this,b=new Promise(function(b){a.userInputComplete=b,console.log("--------------"),document.getElementById("Dialog").open()});return b}
since @babel/transform 7.17.10 it is transpiled to
checkWithUserForItemOrgAssociation(){var a=new Promise(function(a){this.userInputComplete=a,console.log("--------------"),document.getElementById("Dialog").open()});return a}
which is obviously wrong.
Environment
node v16.13.0
npm 8.1.0
@babel/core 7.17.10
babel-preset-minify: 0.5.1
Possible solution
I had to use npm-shrinkwrap.json to enforce older @babel/transform sub dependency of @babel/core
Additional context
No response
The text was updated successfully, but these errors were encountered: