Merge 5b8417bd7d into e27dab7e7c
This commit is contained in:
commit
cefd17137d
10
lib/scope.js
10
lib/scope.js
|
|
@ -85,6 +85,16 @@ SymbolDef.prototype = {
|
||||||
var s = this.scope;
|
var s = this.scope;
|
||||||
if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)
|
if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)
|
||||||
s = s.parent_scope;
|
s = s.parent_scope;
|
||||||
|
|
||||||
|
// https://github.com/mishoo/UglifyJS2/issues/1095
|
||||||
|
// prevent mangle name conflict while using `let` or `const`
|
||||||
|
if (this.orig[0] instanceof AST_SymbolBlockDeclaration) {
|
||||||
|
var start = s.start;
|
||||||
|
if (start && start.type === 'keyword' && (start.value ==='default' || start.value === 'case')) {
|
||||||
|
s = s.parent_scope;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.mangled_name = s.next_mangled(options, this);
|
this.mangled_name = s.next_mangled(options, this);
|
||||||
if (this.global && cache) {
|
if (this.global && cache) {
|
||||||
cache.set(this.name, this.mangled_name);
|
cache.set(this.name, this.mangled_name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user