Index: src/prettyprinter.cc |
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc |
index f3ec75adcffb5488bc2d91f7ae1549ebf6f8bb6e..d879da15d84a7bf549ef53c0b2df0374d255cdbd 100644 |
--- a/src/prettyprinter.cc |
+++ b/src/prettyprinter.cc |
@@ -61,10 +61,15 @@ void PrettyPrinter::VisitBlock(Block* node) { |
void PrettyPrinter::VisitVariableDeclaration(VariableDeclaration* node) { |
Print("var "); |
PrintLiteral(node->proxy()->name(), false); |
- if (node->fun() != NULL) { |
- Print(" = "); |
- PrintFunctionLiteral(node->fun()); |
- } |
+ Print(";"); |
+} |
+ |
+ |
+void PrettyPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { |
+ Print("function "); |
+ PrintLiteral(node->proxy()->name(), false); |
+ Print(" = "); |
+ PrintFunctionLiteral(node->fun()); |
Print(";"); |
} |
@@ -744,19 +749,18 @@ void AstPrinter::VisitBlock(Block* node) { |
void AstPrinter::VisitVariableDeclaration(VariableDeclaration* node) { |
- if (node->fun() == NULL) { |
- // var or const declarations |
- PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()), |
- node->proxy()->var(), |
- node->proxy()->name()); |
- } else { |
- // function declarations |
- PrintIndented("FUNCTION "); |
- PrintLiteral(node->proxy()->name(), true); |
- Print(" = function "); |
- PrintLiteral(node->fun()->name(), false); |
- Print("\n"); |
- } |
+ PrintLiteralWithModeIndented(Variable::Mode2String(node->mode()), |
+ node->proxy()->var(), |
+ node->proxy()->name()); |
+} |
+ |
+ |
+void AstPrinter::VisitFunctionDeclaration(FunctionDeclaration* node) { |
+ PrintIndented("FUNCTION "); |
+ PrintLiteral(node->proxy()->name(), true); |
+ Print(" = function "); |
+ PrintLiteral(node->fun()->name(), false); |
+ Print("\n"); |
} |