diff --git a/lib/scope.js b/lib/scope.js index 605cf3bb..deeb8092 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -546,10 +546,7 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options){ var mangle_with_block_scope = (!options.ie8 && node instanceof AST_SymbolCatch) || node instanceof AST_SymbolBlockDeclaration; - if (options.reserved.indexOf(node.name) >= 0) { - mangle_with_block_scope = false; - } - if (mangle_with_block_scope) { + if (mangle_with_block_scope && options.reserved.indexOf(node.name) < 0) { to_mangle.push(node.definition()); return; } diff --git a/test/compress/harmony.js b/test/compress/harmony.js index b5971466..6accd8b5 100644 --- a/test/compress/harmony.js +++ b/test/compress/harmony.js @@ -819,6 +819,10 @@ class_name_can_be_preserved_with_reserved: { } } expect: { - function x(){class Foo{}Foo.bar;class s{}s.foo} + function x(){ + class Foo{} + Foo.bar; + class s{}s.foo + } } } \ No newline at end of file