fix corner case in evaluate & unsafe_math (#3756)

fixes #3755
This commit is contained in:
Alex Lam S.L
2020-03-30 12:13:14 +01:00
committed by GitHub
parent c69c026728
commit dc0cd088cf
2 changed files with 17 additions and 0 deletions

View File

@@ -3243,6 +3243,7 @@ merge(Compressor.prototype, {
}
if (isNaN(result)) return compressor.find_parent(AST_With) ? this : result;
if (compressor.option("unsafe_math")
&& !ignore_side_effects
&& result
&& typeof result == "number"
&& (this.operator == "+" || this.operator == "-")) {