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

Unified Diff: src/parser.h

Issue 561913002: Class syntax parsing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add early error checks for static prototype and get/set constructor Created 6 years, 3 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/objects.h ('k') | src/parser.cc » ('j') | src/preparser.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index a34425250f78856a889b730abc68ac3308f0297a..55b481db7bdd2e5fe64dd72dd51148885b553119 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -363,6 +363,7 @@ class ParserTraits {
typedef v8::internal::Expression* Expression;
typedef Yield* YieldExpression;
typedef v8::internal::FunctionLiteral* FunctionLiteral;
+ typedef v8::internal::ClassLiteral* ClassLiteral;
typedef v8::internal::Literal* Literal;
typedef ObjectLiteral::Property* ObjectLiteralProperty;
typedef ZoneList<v8::internal::Expression*>* ExpressionList;
@@ -401,6 +402,10 @@ class ParserTraits {
static bool IsIdentifier(Expression* expression);
+ bool IsPrototype(const AstRawString* identifier) const;
+
+ bool IsConstructor(const AstRawString* identifier) const;
+
static const AstRawString* AsIdentifier(Expression* expression) {
DCHECK(IsIdentifier(expression));
return expression->AsVariableProxy()->raw_name();
@@ -518,6 +523,7 @@ class ParserTraits {
return NULL;
}
static ObjectLiteralProperty* EmptyObjectLiteralProperty() { return NULL; }
+ static ClassLiteral* EmptyClassLiteral() { return NULL; }
// Used in error return values.
static ZoneList<Expression*>* NullExpressionList() {
@@ -695,6 +701,8 @@ class Parser : public ParserBase<ParserTraits> {
Statement* ParseStatement(ZoneList<const AstRawString*>* labels, bool* ok);
Statement* ParseFunctionDeclaration(ZoneList<const AstRawString*>* names,
bool* ok);
+ Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names,
+ bool* ok);
Statement* ParseNativeDeclaration(bool* ok);
Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok);
Block* ParseVariableStatement(VariableDeclarationContext var_context,
« no previous file with comments | « src/objects.h ('k') | src/parser.cc » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698