@@ -730,15 +730,9 @@ 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){
|
||||
return first_in_statement(output);
|
||||
});
|
||||
PARENS([ AST_ClassExpression, AST_Object ], first_in_statement);
|
||||
|
||||
PARENS(AST_Unary, function(output){
|
||||
var p = output.parent();
|
||||
|
||||
@@ -1197,3 +1197,18 @@ class_method_using_arguments: {
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_2676: {
|
||||
options = {
|
||||
reduce_vars: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
class A {}
|
||||
A.a = 42;
|
||||
}
|
||||
expect: {
|
||||
(class {}).a = 42;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user