avoid evaluate of compound assignment after dead_code transform (#2861)

fixes #2860
This commit is contained in:
Alex Lam S.L
2018-02-01 16:18:29 +08:00
committed by GitHub
parent 102f994b9d
commit aa664dea0a
3 changed files with 79 additions and 0 deletions

View File

@@ -5358,6 +5358,7 @@ merge(Compressor.prototype, {
if (in_try(level, parent instanceof AST_Throw)) break;
if (is_reachable(def.scope, [ def ])) break;
if (self.operator == "=") return self.right;
def.fixed = false;
return make_node(AST_Binary, self, {
operator: self.operator.slice(0, -1),
left: self.left,