extend hoist_props to AST_Arrow & AST_Class (#2527)

fixes #2503
This commit is contained in:
Alex Lam S.L
2017-11-28 22:54:44 +08:00
committed by GitHub
parent 62d2817d6c
commit 755e2a62c6
2 changed files with 32 additions and 10 deletions

View File

@@ -635,6 +635,8 @@ merge(Compressor.prototype, {
|| !immutable
&& parent instanceof AST_Call
&& parent.expression === node
&& !(value instanceof AST_Arrow)
&& !(value instanceof AST_Class)
&& (!(value instanceof AST_Function)
|| !(parent instanceof AST_New) && value.contains_this())) {
return true;