Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: src/ast/ast.cc

Issue 2176653003: Wrap ClassLiterals in DoExpressions instead of giving them BlockScopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ast/ast.cc
diff --git a/src/ast/ast.cc b/src/ast/ast.cc
index f22142207d7818094445705f90b56e3a33514c54..55872be29f9d80c1f196b6ea5167ba1776c16038 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) \

Powered by Google App Engine
This is Rietveld 408576698