| Index: src/ast/prettyprinter.cc
|
| diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
|
| index 3f624be864878428e16e6d30314e2091848b7bd0..9cc841601d9f9fed9824dc3d4d983e84b2bb8533 100644
|
| --- a/src/ast/prettyprinter.cc
|
| +++ b/src/ast/prettyprinter.cc
|
| @@ -1203,6 +1203,14 @@ const char* AstPrinter::PrintProgram(FunctionLiteral* program) {
|
| }
|
|
|
|
|
| +void AstPrinter::PrintOut(Isolate* isolate, AstNode* node) {
|
| + AstPrinter printer(isolate);
|
| + printer.Init();
|
| + printer.Visit(node);
|
| + PrintF("%s", printer.Output());
|
| +}
|
| +
|
| +
|
| void AstPrinter::PrintDeclarations(ZoneList<Declaration*>* declarations) {
|
| if (declarations->length() > 0) {
|
| IndentedScope indent(this, "DECLS");
|
| @@ -1390,6 +1398,10 @@ void AstPrinter::VisitForOfStatement(ForOfStatement* node) {
|
| PrintIndentedVisit("FOR", node->each());
|
| PrintIndentedVisit("OF", node->iterable());
|
| PrintIndentedVisit("BODY", node->body());
|
| + PrintIndentedVisit("INIT", node->assign_iterator());
|
| + PrintIndentedVisit("NEXT", node->next_result());
|
| + PrintIndentedVisit("EACH", node->assign_each());
|
| + PrintIndentedVisit("DONE", node->result_done());
|
| }
|
|
|
|
|
| @@ -1542,31 +1554,36 @@ void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
|
|
|
|
|
| void AstPrinter::VisitVariableProxy(VariableProxy* node) {
|
| - Variable* var = node->var();
|
| EmbeddedVector<char, 128> buf;
|
| int pos =
|
| FormatSlotNode(&buf, node, "VAR PROXY", node->VariableFeedbackSlot());
|
|
|
| - switch (var->location()) {
|
| - case VariableLocation::UNALLOCATED:
|
| - break;
|
| - case VariableLocation::PARAMETER:
|
| - SNPrintF(buf + pos, " parameter[%d]", var->index());
|
| - break;
|
| - case VariableLocation::LOCAL:
|
| - SNPrintF(buf + pos, " local[%d]", var->index());
|
| - break;
|
| - case VariableLocation::CONTEXT:
|
| - SNPrintF(buf + pos, " context[%d]", var->index());
|
| - break;
|
| - case VariableLocation::GLOBAL:
|
| - SNPrintF(buf + pos, " global[%d]", var->index());
|
| - break;
|
| - case VariableLocation::LOOKUP:
|
| - SNPrintF(buf + pos, " lookup");
|
| - break;
|
| + if (!node->is_resolved()) {
|
| + SNPrintF(buf + pos, " unresolved");
|
| + PrintLiteralWithModeIndented(buf.start(), nullptr, node->name());
|
| + } else {
|
| + Variable* var = node->var();
|
| + switch (var->location()) {
|
| + case VariableLocation::UNALLOCATED:
|
| + break;
|
| + case VariableLocation::PARAMETER:
|
| + SNPrintF(buf + pos, " parameter[%d]", var->index());
|
| + break;
|
| + case VariableLocation::LOCAL:
|
| + SNPrintF(buf + pos, " local[%d]", var->index());
|
| + break;
|
| + case VariableLocation::CONTEXT:
|
| + SNPrintF(buf + pos, " context[%d]", var->index());
|
| + break;
|
| + case VariableLocation::GLOBAL:
|
| + SNPrintF(buf + pos, " global[%d]", var->index());
|
| + break;
|
| + case VariableLocation::LOOKUP:
|
| + SNPrintF(buf + pos, " lookup");
|
| + break;
|
| + }
|
| + PrintLiteralWithModeIndented(buf.start(), var, node->name());
|
| }
|
| - PrintLiteralWithModeIndented(buf.start(), var, node->name());
|
| }
|
|
|
|
|
|
|