-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unminified variable name used unexpectedly #866
Comments
Updating to |
Reduced testcase function baz() {
let foo = 42;
while (bar) {
}
return foo;
} Actual "use strict";function baz(){for(;bar;);return foo} Expected "use strict";function baz(){for(;bar;);return 42} |
Got a similar issue with the while loop in a method. Source_findContainer () {
let view = this.view;
while (view) {
if (view.model && view.model.isSettingsContainer) {
break;
}
view = view.parent;
}
return view;
} Result_findContainer: function _findContainer() {
for (var a = this.view; a && !(a.model && a.model.isSettingsContainer); )
a = a.parent;
return view
} Expected_findContainer: function _findContainer() {
for (var a = this.view; a && !(a.model && a.model.isSettingsContainer); )
a = a.parent;
return a
} Environment
|
The issue appears to be fixed on the latest master. |
I can still reproduce the problem with my reduced testcase with latest master of babel and babel/minify, although the non-reduced testcases seem to be correct, now. |
This comment relates to previous issues with |
minify
unless you turnmangle
off replaces the original variable names with one-letter names. But under some curcumstances it forgets to use the minified variable name and uses the unmodified variable name instead which leads to aReferenceError
since it's not defined.To Reproduce
See configuration below. This does not occur in REPL.
Actual Output
This obviously produces a
ReferenceError: u8arr is not defined
.Expected Output
Here's an actual ouput produced long time ago by
"babel-cli": "6.18.0"
,"babel-preset-latest": "6.16.0"
and"babel-preset-babili": "0.0.9"
Configuration
To build, run
npm run build
.The text was updated successfully, but these errors were encountered: