fix corner case in evaluate (#3888)

fixes #3887
This commit is contained in:
Alex Lam S.L
2020-05-12 10:58:37 +01:00
committed by GitHub
parent ee7647dc67
commit eb7fa25270
2 changed files with 24 additions and 1 deletions

View File

@@ -3368,7 +3368,7 @@ merge(Compressor.prototype, {
});
def(AST_UnaryPostfix, function(compressor, ignore_side_effects, cached, depth) {
var e = this.expression;
if (!(e instanceof AST_SymbolRef)) return this;
if (!e.fixed) return this;
var refs = e.definition().references;
if (!ignore_side_effects && refs[refs.length - 1] !== e) return this;
var v = e._eval(compressor, ignore_side_effects, cached, depth + 1);