aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 4279dc7c..8d41ab82 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1048,7 +1048,7 @@ merge(Compressor.prototype, {
});
def(AST_Unary, function(tw, descend) {
var node = this;
- if (!unary_arithmetic[node.operator]) return;
+ if (!UNARY_POSTFIX[node.operator]) return;
var exp = node.expression;
if (!(exp instanceof AST_SymbolRef)) {
mark_assignment_to_arguments(exp);
@@ -1978,7 +1978,7 @@ merge(Compressor.prototype, {
extract_candidates(expr.expression);
expr.body.forEach(extract_candidates);
} else if (expr instanceof AST_Unary) {
- if (unary_arithmetic[expr.operator]) {
+ if (UNARY_POSTFIX[expr.operator]) {
candidates.push(hit_stack.slice());
} else {
extract_candidates(expr.expression);
@@ -3473,8 +3473,6 @@ merge(Compressor.prototype, {
});
var lazy_op = makePredicate("&& ||");
- var unary_arithmetic = makePredicate("++ --");
- var unary_side_effects = makePredicate("delete ++ --");
function is_lhs(node, parent) {
if (parent instanceof AST_Assign) return parent.left === node && node;
@@ -3725,7 +3723,7 @@ merge(Compressor.prototype, {
});
var scan_modified = new TreeWalker(function(node) {
if (node instanceof AST_Assign) modified(node.left);
- if (node instanceof AST_Unary && unary_arithmetic[node.operator]) modified(node.expression);
+ if (node instanceof AST_Unary && UNARY_POSTFIX[node.operator]) modified(node.expression);
});
function modified(node) {
if (node instanceof AST_PropAccess) {
@@ -4964,7 +4962,7 @@ merge(Compressor.prototype, {
return true;
}
if (node instanceof AST_Unary) {
- if (!unary_arithmetic[node.operator]) return;
+ if (!UNARY_POSTFIX[node.operator]) return;
var sym = node.expression;
if (!(sym instanceof AST_SymbolRef)) return;
mark(sym, true, true);
@@ -9885,7 +9883,7 @@ merge(Compressor.prototype, {
&& is_arguments(def = expr.definition())
&& prop instanceof AST_Number
&& (fn = def.scope) === find_lambda()
- && !(assigned && fn.uses_arguments === "d")) {
+ && fn.uses_arguments < (assigned ? 2 : 3)) {
var index = prop.value;
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
if (!def.deleted) def.deleted = [];