aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 2f49df76..66314766 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -543,11 +543,8 @@ AST_Toplevel.DEFMETHOD("expand_names", function(options) {
var redef = def.redefined();
var name = redef ? redef.rename || redef.name : next_name();
def.rename = name;
- def.orig.forEach(function(sym) {
- sym.name = name;
- });
- def.references.forEach(function(sym) {
- sym.name = name;
+ def.orig.concat(def.references).forEach(function(sym) {
+ if (sym.definition() === def) sym.name = name;
});
}
});