fix corner case in side_effects (#3514)

fixes #3512
This commit is contained in:
Alex Lam S.L
2019-10-23 01:04:00 +08:00
committed by GitHub
parent 02308a7b56
commit a53ab99378
2 changed files with 31 additions and 1 deletions

View File

@@ -4196,7 +4196,7 @@ merge(Compressor.prototype, {
var left = this.left;
if (left instanceof AST_PropAccess) {
var expr = left.expression;
if (expr instanceof AST_Assign && !expr.may_throw_on_access(compressor)) {
if (expr instanceof AST_Assign && expr.operator == "=" && !expr.may_throw_on_access(compressor)) {
expr.write_only = "p";
}
if (compressor.has_directive("use strict") && expr.is_constant()) return this;