aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/compress.js b/lib/compress.js
index a2a28ab9..09e78d46 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -5964,7 +5964,7 @@ merge(Compressor.prototype, {
if (old_def) old_def.forEach(function(node) {
node.name = name_def.name;
node.thedef = name_def;
- node.reference({});
+ node.reference();
});
body.push(defun);
} else {
@@ -6798,7 +6798,7 @@ merge(Compressor.prototype, {
scope: self,
thedef: decl.definition()
});
- sym.reference({});
+ sym.reference();
assignments.push(make_node(AST_Assign, node, {
operator: "=",
left: sym,
@@ -6845,7 +6845,7 @@ merge(Compressor.prototype, {
scope: node.expression.scope,
thedef: def
});
- sym.reference({});
+ sym.reference();
return sym;
}
if (node instanceof AST_Unary) {
@@ -8469,12 +8469,12 @@ merge(Compressor.prototype, {
node = maintain_this_binding(compressor, parent, current, node);
if (replacing || best_of_expression(node, self) === node) {
refs.forEach(function(ref) {
- var def = ref.definition();
- def.references.push(ref);
+ ref.scope = exp === fn ? fn.parent_scope : exp.scope;
+ ref.reference();
if (replacing) {
- def.replaced++;
+ ref.definition().replaced++;
} else {
- def.single_use = false;
+ ref.definition().single_use = false;
}
});
return node;
@@ -10853,7 +10853,7 @@ merge(Compressor.prototype, {
}, fn.argnames) === argname) {
def.reassigned = false;
var sym = make_node(AST_SymbolRef, self, argname);
- sym.reference({});
+ sym.reference();
delete argname.__unused;
return sym;
}