fix unsafe evaluation of AST_Sub (#2389)

This commit is contained in:
Alex Lam S.L
2017-10-22 13:14:15 +08:00
committed by GitHub
parent 4ae1fb3ed8
commit 516eaef50c
2 changed files with 21 additions and 1 deletions

View File

@@ -4468,6 +4468,7 @@ merge(Compressor.prototype, {
});
}
}
if (is_lhs(self, compressor.parent())) return self;
var ev = self.evaluate(compressor);
if (ev !== self) {
ev = make_node_from_constant(ev, self).optimize(compressor);