preserve constant modification under strict mode (#2717)
This commit is contained in:
@@ -3279,7 +3279,12 @@ merge(Compressor.prototype, {
|
||||
});
|
||||
def(AST_Assign, function(compressor){
|
||||
var left = this.left;
|
||||
if (left.has_side_effects(compressor)) return this;
|
||||
if (left.has_side_effects(compressor)
|
||||
|| compressor.has_directive("use strict")
|
||||
&& left instanceof AST_PropAccess
|
||||
&& left.expression.is_constant()) {
|
||||
return this;
|
||||
}
|
||||
this.write_only = true;
|
||||
while (left instanceof AST_PropAccess) {
|
||||
left = left.expression;
|
||||
|
||||
Reference in New Issue
Block a user