aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/scope.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 466ab8d6..c74c494a 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -70,9 +70,7 @@ SymbolDef.prototype = {
} else if (!this.mangled_name && !this.unmangleable(options)) {
var def = this.redefined();
if (def) {
- var name = def.mangled_name || def.name;
- this.mangled_name = name;
- names_in_use(this.scope, options)[name] = true;
+ this.mangled_name = def.mangled_name || def.name;
} else {
this.mangled_name = next_mangled_name(this, options);
}
@@ -683,6 +681,7 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
redef = scope.def_variable(sym);
scope.to_mangle.push(redef);
} else if (redef.mangled_name) {
+ names_in_use(def.scope, options)[redef.mangled_name] = true;
return false;
}
redefined.push(def);