fix corner case in evaluate (#3540)

fixes #3539
This commit is contained in:
Alex Lam S.L
2019-10-28 19:56:42 +08:00
committed by GitHub
parent 24e8b47977
commit f38e31bd1e
2 changed files with 17 additions and 0 deletions

View File

@@ -2901,6 +2901,7 @@ merge(Compressor.prototype, {
}
if (isNaN(result)) return compressor.find_parent(AST_With) ? this : result;
if (compressor.option("unsafe_math")
&& result
&& typeof result == "number"
&& (this.operator == "+" || this.operator == "-")) {
var digits = Math.max(0, decimals(left), decimals(right));