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

Unified Diff: src/ast/prettyprinter.cc

Issue 1309813007: [es6] implement destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add explicit placeholder RewritableExpression for rewriting Created 5 years 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/ast/prettyprinter.cc
diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
index 00b31168ea5c31c445fff69570f2982ae44a0972..cebe0de015254cb82b01725ca6852576a3a8e230 100644
--- a/src/ast/prettyprinter.cc
+++ b/src/ast/prettyprinter.cc
@@ -13,6 +13,15 @@
namespace v8 {
namespace internal {
+#define RETURN_IF_FIND_NODE(node) \
+ do { \
+ AstNode* tmp = node; \
+ if (tmp != nullptr) { \
+ Find(tmp); \
+ return; \
+ } \
+ } while (false)
+
CallPrinter::CallPrinter(Isolate* isolate) {
output_ = NULL;
size_ = 0;
@@ -397,6 +406,11 @@ void CallPrinter::VisitSuperCallReference(SuperCallReference* node) {
}
+void CallPrinter::VisitRewritableExpression(RewritableExpression* node) {
+ Find(node->expression());
+}
+
+
void CallPrinter::FindStatements(ZoneList<Statement*>* statements) {
if (statements == NULL) return;
for (int i = 0; i < statements->length(); i++) {
@@ -908,6 +922,11 @@ void PrettyPrinter::VisitSuperCallReference(SuperCallReference* node) {
}
+void PrettyPrinter::VisitRewritableExpression(RewritableExpression* node) {
+ Visit(node->expression());
+}
+
+
const char* PrettyPrinter::Print(AstNode* node) {
Init();
Visit(node);
@@ -1659,6 +1678,11 @@ void AstPrinter::VisitSuperCallReference(SuperCallReference* node) {
}
+void AstPrinter::VisitRewritableExpression(RewritableExpression* node) {
+ Visit(node->expression());
+}
+
+
#endif // DEBUG
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698