You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected result: both self.MyGlobal and self.MyGlobal2 to be treated consistently, both being renamed to a shorter property.
Observed result: only self.MyGlobal is mangled. For some reason self.MyGlobal2 is not mangled. Perhaps this is because the parser has not seen an assignment to the global property yet.
Impact: This breaks property mangling when using multiple files or a shared nameCache: it's possible MyGlobal2 was assigned to in a different script. For example if input1.js does self.MyGlobal2 = 2, then input2.js does console.log(self.MyGlobal2), the properties are not consistently mangled and the output is broken. Therefore to ensure property mangling works in these cases, UglifyJS must consistently mangle all global properties regardless of whether they are assigned to or only read from.
The text was updated successfully, but these errors were encountered:
Uglify version (
uglifyjs -V
) 3.19.3JavaScript input
The
uglifyjs
CLI command executed orminify()
options used.uglifyjs input.js --mangle-props --beautify --output output.js
JavaScript output or error produced.
Expected result: both self.MyGlobal and self.MyGlobal2 to be treated consistently, both being renamed to a shorter property.
Observed result: only self.MyGlobal is mangled. For some reason self.MyGlobal2 is not mangled. Perhaps this is because the parser has not seen an assignment to the global property yet.
Impact: This breaks property mangling when using multiple files or a shared nameCache: it's possible MyGlobal2 was assigned to in a different script. For example if input1.js does
self.MyGlobal2 = 2
, then input2.js doesconsole.log(self.MyGlobal2)
, the properties are not consistently mangled and the output is broken. Therefore to ensure property mangling works in these cases, UglifyJS must consistently mangle all global properties regardless of whether they are assigned to or only read from.The text was updated successfully, but these errors were encountered: