aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-28 19:56:42 +0800
committerGitHub <noreply@github.com>2019-10-28 19:56:42 +0800
commitf38e31bd1ee117fc8adb0d13982b5ec16e761f52 (patch)
treefc1b28e3d86cc912b0287c5007579f4a774e5726 /lib
parent24e8b479775d9d264c5f8ae33bcfef204a3ff969 (diff)
downloadtracifyjs-f38e31bd1ee117fc8adb0d13982b5ec16e761f52.tar.gz
tracifyjs-f38e31bd1ee117fc8adb0d13982b5ec16e761f52.zip
fix corner case in `evaluate` (#3540)
fixes #3539
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 442df59d..7c5558bd 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -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));