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
[ES6] Bug: block eliminated that protects constant globals #1666
Comments
I wouldn't concentrate on
As there's no such thing as block scope in ES5 I can't fault the code uglify produces in this case. Its transform looks correct for ES5. Node 6 is applying ES6 block scoping rules to this code:
Notice that Node 4 does what's expected for ES5 which does not respect block scope:
As does Node 0.12.x:
|
This error supports the analysis above:
This code is not valid ES5. |
So do you think I should tag this as |
Yeah, it seems to be a |
#2023 will retain the block, but then |
It looks like current Uglify-es doesn't remove the block anymore:
Should this be closed? |
Bug report or feature request?
Bug: by fuzzer
uglify-js
version (uglifyjs -V
)uglify-js 2.8.15 (git master)
(Changed desc) In nodejs it's okay to do
var undefined
in global space, but not for function names. It's fine to do that in a block, still in global space, for some reason. Probably only affectsundefined
,NaN
, andInfinity
...The text was updated successfully, but these errors were encountered: