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:
@@ -642,6 +642,10 @@ function OutputStream(options) {
|
||||
return p instanceof AST_PropAccess && p.expression === this;
|
||||
});
|
||||
|
||||
PARENS(AST_ClassExpression, function(output){
|
||||
return output.parent() instanceof AST_SimpleStatement;
|
||||
});
|
||||
|
||||
// same goes for an object literal, because otherwise it would be
|
||||
// interpreted as a block of code.
|
||||
PARENS(AST_Object, function(output){
|
||||
|
||||
Reference in New Issue
Block a user