aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compress.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/compress.js b/lib/compress.js
index fec4b951..31747c92 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1062,9 +1062,11 @@ merge(Compressor.prototype, {
if (is_lhs(node, parent)) {
if (value_def) replaced++;
return node;
+ } else {
+ replaced++;
+ if (value_def && candidate instanceof AST_VarDef) return node;
}
CHANGED = abort = true;
- replaced++;
compressor.info("Collapsing {name} [{file}:{line},{col}]", {
name: node.print_to_string(),
file: node.start.file,
@@ -1075,10 +1077,6 @@ merge(Compressor.prototype, {
return make_node(AST_UnaryPrefix, candidate, candidate);
}
if (candidate instanceof AST_VarDef) {
- if (value_def) {
- abort = false;
- return node;
- }
var def = candidate.name.definition();
if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) {
def.replaced++;