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

Unified Diff: src/parser.cc

Issue 866533003: Use FunctionLiteral for class constructor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « src/ast.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 6d1570b82fb238f39d053668d666f9f933a937ca..ec9832111aa9306ccf124ebc62237cd091fbcf1a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4008,7 +4008,7 @@ ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name,
}
ZoneList<ObjectLiteral::Property*>* properties = NewPropertyList(4, zone());
- Expression* constructor = NULL;
+ FunctionLiteral* constructor = NULL;
bool has_seen_constructor = false;
Expect(Token::LBRACE, CHECK_OK);
@@ -4024,7 +4024,8 @@ ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name,
&has_seen_constructor, CHECK_OK);
if (has_seen_constructor && constructor == NULL) {
- constructor = GetPropertyValue(property);
+ constructor = GetPropertyValue(property)->AsFunctionLiteral();
+ DCHECK_NOT_NULL(constructor);
} else {
properties->Add(property, zone());
}
« no previous file with comments | « src/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698