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

Unified Diff: src/parsing/parser.h

Issue 2302643002: Split the AST representation of class properties from object properties (Closed)
Patch Set: remove spurious classliteralproperty typedef 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
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 38695495545aa9d69e4d6dee9adb7b42fd748472..1624014ecaf64080784c7330829a3d4c0a11e031 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -149,6 +149,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;
@@ -707,6 +708,11 @@ class Parser : public ParserBase<Parser> {
return property->value();
}
+ V8_INLINE static Expression* GetPropertyValue(
adamk 2016/09/01 21:18:23 Can't you just take a LiteralProperty* instead?
bakkot 2016/09/01 23:24:31 Whoops. Done.
+ ClassLiteral::Property* property) {
+ return property->value();
+ }
+
// Functions for encapsulating the differences between parsing and preparsing;
// operations interleaved with the recursive descent.
V8_INLINE static void PushLiteralName(FuncNameInferrer* fni,
@@ -837,6 +843,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; }
@@ -912,6 +921,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());
}
@@ -992,6 +1005,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);

Powered by Google App Engine
This is Rietveld 408576698