aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-26 18:08:44 +0800
committerGitHub <noreply@github.com>2017-03-26 18:08:44 +0800
commite76fb354eb62d8e7b6968f1f77cfbb219814cea3 (patch)
tree8f1523df409bf635fd41ca9a4c2ecdf51e9dc327 /lib
parent3276740779077f2ee7b686c4aa7f1bd46fbc1c66 (diff)
downloadtracifyjs-e76fb354eb62d8e7b6968f1f77cfbb219814cea3.tar.gz
tracifyjs-e76fb354eb62d8e7b6968f1f77cfbb219814cea3.zip
fix `cascade` on `delete` operator (#1687)
Conditions including strict mode would make `delete` return `true` or `false`, and are too complex to be evaluated by the compressor. Suppress assignment folding into said operator. fixes #1685
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 8467f96c..a617adbe 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2542,7 +2542,6 @@ merge(Compressor.prototype, {
continue;
}
}
- var case_side_effects = branch instanceof AST_Case && branch.expression.has_side_effects(compressor);
if (aborts(branch)) {
var block = make_node(AST_BlockStatement, branch, branch).print_to_string();
if (!fallthrough && prev_block === block) body[body.length - 1].body = [];
@@ -2946,7 +2945,10 @@ merge(Compressor.prototype, {
field = "left";
}
} else if (cdr instanceof AST_Call
- || cdr instanceof AST_Unary && cdr.operator != "++" && cdr.operator != "--") {
+ || cdr instanceof AST_Unary
+ && cdr.operator != "delete"
+ && cdr.operator != "++"
+ && cdr.operator != "--") {
field = "expression";
} else break;
parent = cdr;