aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 9a8e25cc..baa3e8bd 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -74,17 +74,12 @@ SymbolDef.prototype = {
var cache = options.cache && options.cache.props;
if (this.global && cache && cache.has(this.name)) {
this.mangled_name = cache.get(this.name);
- }
- else if (!this.mangled_name && !this.unmangleable(options)) {
- var s = this.scope;
- var sym = this.orig[0];
- if (options.ie8 && sym instanceof AST_SymbolLambda)
- s = s.parent_scope;
+ } else if (!this.mangled_name && !this.unmangleable(options)) {
var def;
if (def = this.redefined()) {
this.mangled_name = def.mangled_name || def.name;
} else {
- this.mangled_name = next_mangled_name(s, options, this);
+ this.mangled_name = next_mangled_name(this.scope, options, this);
}
if (this.global && cache) {
cache.set(this.name, this.mangled_name);
@@ -377,6 +372,9 @@ function next_mangled_name(scope, options, def) {
holes.push(scope.cname);
}
scope.names_in_use[name] = true;
+ if (options.ie8 && def.orig[0] instanceof AST_SymbolLambda) {
+ names_in_use(scope.parent_scope, options)[name] = true;
+ }
return name;
}