From 9e301d40cf922e224d0fa2fdf49c748fcedfefa0 Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Sat, 23 Sep 2017 13:04:48 +0200 Subject: [PATCH] issue 2316 --- lib/scope.js | 5 +---- test/compress/harmony.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/scope.js b/lib/scope.js index 48f4f3cb..605cf3bb 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -61,7 +61,7 @@ SymbolDef.next_id = 1; SymbolDef.prototype = { unmangleable: function(options) { if (!options) options = {}; - + return (this.global && !options.toplevel) || this.export || this.undeclared @@ -71,9 +71,6 @@ SymbolDef.prototype = { || this.orig[0] instanceof AST_SymbolDefun)) || this.orig[0] instanceof AST_SymbolMethod || (options.keep_classnames - && (this.orig[0] instanceof AST_SymbolClass - || this.orig[0] instanceof AST_SymbolDefClass)) - || (options.reserved && options.reserved.indexOf(this.name) >= 0 && (this.orig[0] instanceof AST_SymbolClass || this.orig[0] instanceof AST_SymbolDefClass)); }, diff --git a/test/compress/harmony.js b/test/compress/harmony.js index 87cadebf..b5971466 100644 --- a/test/compress/harmony.js +++ b/test/compress/harmony.js @@ -819,6 +819,6 @@ class_name_can_be_preserved_with_reserved: { } } expect: { - function x(){class Foo{}Foo.bar;class o{}o.foo} + function x(){class Foo{}Foo.bar;class s{}s.foo} } } \ No newline at end of file