aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index fe3d34b6..ca23c40e 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -628,7 +628,10 @@ merge(Compressor.prototype, {
case "typeof": return typeof ev(e);
case "void": return void ev(e);
case "~": return ~ev(e);
- case "-": return -ev(e);
+ case "-":
+ e = ev(e);
+ if (e === 0) throw def;
+ return -e;
case "+": return +ev(e);
}
throw def;