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

Unified Diff: src/prettyprinter.cc

Issue 1212473002: [destructuring] Re-index materialized literals in arrow function parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CR feedback Created 5 years, 6 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/preparser.h ('k') | test/mjsunit/harmony/destructuring-parameters-literalcount.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
index 198ca9dfec8539f31cdf7feb2a9e65bacd65f438..03ef4deca8e7761c423886fb299561c3a95509d6 100644
--- a/src/prettyprinter.cc
+++ b/src/prettyprinter.cc
@@ -719,6 +719,7 @@ void PrettyPrinter::PrintObjectLiteralProperty(
void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) {
Print("[ ");
+ Print(" literal_index = %d", node->literal_index());
for (int i = 0; i < node->values()->length(); i++) {
if (i != 0) Print(",");
Visit(node->values()->at(i));
@@ -1397,6 +1398,9 @@ void AstPrinter::VisitLiteral(Literal* node) {
void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
IndentedScope indent(this, "REGEXP LITERAL");
+ EmbeddedVector<char, 128> buf;
+ SNPrintF(buf, "literal_index = %d\n", node->literal_index());
+ PrintIndented(buf.start());
PrintLiteralIndented("PATTERN", node->pattern(), false);
PrintLiteralIndented("FLAGS", node->flags(), false);
}
@@ -1404,12 +1408,19 @@ void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) {
IndentedScope indent(this, "OBJ LITERAL");
+ EmbeddedVector<char, 128> buf;
+ SNPrintF(buf, "literal_index = %d\n", node->literal_index());
+ PrintIndented(buf.start());
PrintProperties(node->properties());
}
void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
IndentedScope indent(this, "ARRAY LITERAL");
+
+ EmbeddedVector<char, 128> buf;
+ SNPrintF(buf, "literal_index = %d\n", node->literal_index());
+ PrintIndented(buf.start());
if (node->values()->length() > 0) {
IndentedScope indent(this, "VALUES");
for (int i = 0; i < node->values()->length(); i++) {
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/destructuring-parameters-literalcount.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698