From 1076fe1e6c9d9a0d44117eb4833722cb1cb96110 Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Sat, 23 Sep 2017 15:34:45 +0200 Subject: [PATCH] beautify correction --- lib/scope.js | 5 +---- test/compress/harmony.js | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) 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