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

Unified Diff: src/parsing/parser.h

Issue 2302643002: Split the AST representation of class properties from object properties (Closed)
Patch Set: rebase Created 4 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/parsing/parameter-initializer-rewriter.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index d9f16cb555ee396ebf515b4dd83870eaec184099..aa7d1caf8495cf96e26c30cded36799922a62f14 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -150,6 +150,7 @@ struct ParserTypes<Parser> {
typedef v8::internal::Expression* Expression;
typedef v8::internal::FunctionLiteral* FunctionLiteral;
typedef ObjectLiteral::Property* ObjectLiteralProperty;
+ typedef ClassLiteral::Property* ClassLiteralProperty;
typedef ZoneList<v8::internal::Expression*>* ExpressionList;
typedef ZoneList<ObjectLiteral::Property*>* PropertyList;
typedef ParserFormalParameters FormalParameters;
@@ -713,8 +714,7 @@ class Parser : public ParserBase<Parser> {
return arg == nullptr || literal->raw_value()->AsString() == arg;
}
- V8_INLINE static Expression* GetPropertyValue(
- ObjectLiteral::Property* property) {
+ V8_INLINE static Expression* GetPropertyValue(LiteralProperty* property) {
return property->value();
}
@@ -847,6 +847,9 @@ class Parser : public ParserBase<Parser> {
V8_INLINE static ObjectLiteralProperty* EmptyObjectLiteralProperty() {
return nullptr;
}
+ V8_INLINE static ClassLiteralProperty* EmptyClassLiteralProperty() {
+ return nullptr;
+ }
V8_INLINE static FunctionLiteral* EmptyFunctionLiteral() { return nullptr; }
V8_INLINE static Block* NullBlock() { return nullptr; }
@@ -932,6 +935,10 @@ class Parser : public ParserBase<Parser> {
int size) const {
return new (zone()) ZoneList<ObjectLiteral::Property*>(size, zone());
}
+ V8_INLINE ZoneList<ClassLiteral::Property*>* NewClassPropertyList(
+ int size) const {
+ return new (zone()) ZoneList<ClassLiteral::Property*>(size, zone());
+ }
V8_INLINE ZoneList<Statement*>* NewStatementList(int size) const {
return new (zone()) ZoneList<Statement*>(size, zone());
}
@@ -1012,6 +1019,8 @@ class Parser : public ParserBase<Parser> {
void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property,
const AstRawString* name);
+ void SetFunctionNameFromPropertyName(ClassLiteralProperty* property,
+ const AstRawString* name);
void SetFunctionNameFromIdentifierRef(Expression* value,
Expression* identifier);
« no previous file with comments | « src/parsing/parameter-initializer-rewriter.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698