-
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
Invalid output when using global assignments #5927
Labels
Comments
The problem appears to be with the
produces the following working output: globalThis.Unused = {}, globalThis.Namespace = {}, globalThis.Namespace.Foo = {
bar: !1
}; |
Thanks for the detailed report − investigating. |
Patch released in |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uglify version (
uglifyjs -V
) 3.19.2JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.uglifyjs input.js --compress --beautify --output output.js
JavaScript output or error produced.
Note in the output code there is an error as self.Namespace is not declared. For some reason the creation of Namespace has been moved to after it is used, so UglifyJS has transformed this from working code in to broken code.
If you comment out the line
globalThis.Unused = {};
then it works correctly - so it looks like UglifyJS encountering the first global ends up in a state which then causes it to process the second global incorrectly.The text was updated successfully, but these errors were encountered: