fix class expression statements (#2051)

- class expression statements require parentheses
- allow unused class expression statements to be dropped

fixes #1782
closes #1784
This commit is contained in:
kzc
2017-06-03 14:45:26 -04:00
committed by Alex Lam S.L
parent 753932b302
commit 82fefc5d29
3 changed files with 50 additions and 0 deletions

View File

@@ -2610,6 +2610,7 @@ merge(Compressor.prototype, {
def(AST_Accessor, return_null);
def(AST_Function, return_null);
def(AST_Arrow, return_null);
def(AST_ClassExpression, return_null);
def(AST_Binary, function(compressor, first_in_statement){
var right = this.right.drop_side_effect_free(compressor);
if (!right) return this.left.drop_side_effect_free(compressor, first_in_statement);