Index: src/ast/prettyprinter.cc |
diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc |
index a411b7066af3cfdb3b9e471506ab13ad7ea246f0..944cfaa92902e04153825e7ea45b758db2a14098 100644 |
--- a/src/ast/prettyprinter.cc |
+++ b/src/ast/prettyprinter.cc |
@@ -897,32 +897,22 @@ void AstPrinter::VisitClassLiteral(ClassLiteral* node) { |
if (node->extends() != nullptr) { |
PrintIndentedVisit("EXTENDS", node->extends()); |
} |
- PrintProperties(node->properties()); |
+ PrintClassProperties(node->properties()); |
} |
- |
-void AstPrinter::PrintProperties( |
- ZoneList<ObjectLiteral::Property*>* properties) { |
+void AstPrinter::PrintClassProperties( |
+ ZoneList<ClassLiteral::Property*>* properties) { |
for (int i = 0; i < properties->length(); i++) { |
- ObjectLiteral::Property* property = properties->at(i); |
+ ClassLiteral::Property* property = properties->at(i); |
const char* prop_kind = nullptr; |
switch (property->kind()) { |
- case ObjectLiteral::Property::CONSTANT: |
- prop_kind = "CONSTANT"; |
- break; |
- case ObjectLiteral::Property::COMPUTED: |
- prop_kind = "COMPUTED"; |
- break; |
- case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
- prop_kind = "MATERIALIZED_LITERAL"; |
- break; |
- case ObjectLiteral::Property::PROTOTYPE: |
- prop_kind = "PROTOTYPE"; |
+ case ClassLiteral::Property::METHOD: |
+ prop_kind = "METHOD"; |
break; |
- case ObjectLiteral::Property::GETTER: |
+ case ClassLiteral::Property::GETTER: |
prop_kind = "GETTER"; |
break; |
- case ObjectLiteral::Property::SETTER: |
+ case ClassLiteral::Property::SETTER: |
prop_kind = "SETTER"; |
break; |
} |
@@ -986,7 +976,40 @@ void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) { |
EmbeddedVector<char, 128> buf; |
SNPrintF(buf, "literal_index = %d\n", node->literal_index()); |
PrintIndented(buf.start()); |
- PrintProperties(node->properties()); |
+ PrintObjectProperties(node->properties()); |
+} |
+ |
+void AstPrinter::PrintObjectProperties( |
+ ZoneList<ObjectLiteral::Property*>* properties) { |
+ for (int i = 0; i < properties->length(); i++) { |
+ ObjectLiteral::Property* property = properties->at(i); |
+ const char* prop_kind = nullptr; |
+ switch (property->kind()) { |
+ case ObjectLiteral::Property::CONSTANT: |
+ prop_kind = "CONSTANT"; |
+ break; |
+ case ObjectLiteral::Property::COMPUTED: |
+ prop_kind = "COMPUTED"; |
+ break; |
+ case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
+ prop_kind = "MATERIALIZED_LITERAL"; |
+ break; |
+ case ObjectLiteral::Property::PROTOTYPE: |
+ prop_kind = "PROTOTYPE"; |
+ break; |
+ case ObjectLiteral::Property::GETTER: |
+ prop_kind = "GETTER"; |
+ break; |
+ case ObjectLiteral::Property::SETTER: |
+ prop_kind = "SETTER"; |
+ break; |
+ } |
+ EmbeddedVector<char, 128> buf; |
+ SNPrintF(buf, "PROPERTY - %s", prop_kind); |
+ IndentedScope prop(this, buf.start()); |
+ PrintIndentedVisit("KEY", properties->at(i)->key()); |
+ PrintIndentedVisit("VALUE", properties->at(i)->value()); |
+ } |
} |