handle modifications to this correctly (#3036)

fixes #3032
This commit is contained in:
Alex Lam S.L
2018-03-30 15:07:36 +09:00
committed by GitHub
parent 9f9db504d7
commit 06b9894c19
2 changed files with 25 additions and 0 deletions

View File

@@ -1052,6 +1052,7 @@ merge(Compressor.prototype, {
&& (side_effects || node.expression.may_throw_on_access(compressor))
|| node instanceof AST_SymbolRef
&& (symbol_in_lvalues(node) || side_effects && may_modify(node))
|| node instanceof AST_This && symbol_in_lvalues(node)
|| node instanceof AST_VarDef && node.value
&& (node.name.name in lvalues || side_effects && may_modify(node.name))
|| (sym = is_lhs(node.left, node))