Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index 6fa7f53071f14286dd0442f61c74c644607e57ad..a2fc8997a4a07be151afd82ac4c6de0016c762e7 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -141,8 +141,8 @@ bool Expression::IsValidReferenceExpressionOrThis() const { |
bool Expression::IsAnonymousFunctionDefinition() const { |
return (IsFunctionLiteral() && |
AsFunctionLiteral()->IsAnonymousFunctionDefinition()) || |
- (IsClassLiteral() && |
- AsClassLiteral()->IsAnonymousFunctionDefinition()); |
+ (IsDoExpression() && |
+ AsDoExpression()->IsAnonymousFunctionDefinition()); |
} |
void Expression::MarkTail() { |
@@ -155,6 +155,12 @@ void Expression::MarkTail() { |
} |
} |
+bool DoExpression::IsAnonymousFunctionDefinition() const { |
+ // This is specifically to allow DoExpressions to represent ClassLiterals. |
+ return represented_function_ != nullptr && |
+ represented_function_->raw_name()->length() == 0; |
+} |
+ |
bool Statement::IsJump() const { |
switch (node_type()) { |
#define JUMP_NODE_LIST(V) \ |