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

Unified Diff: src/prettyprinter.cc

Issue 300103005: Split StringLiteral from Literal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: number literals Created 6 years, 7 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') | src/typing.cc » ('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 233d7c2fabeeb21567e4124cb0ef19a34b9c6f2e..1ff7356cafcb1863f7b910d4ebf9428231c79eec 100644
--- a/src/prettyprinter.cc
+++ b/src/prettyprinter.cc
@@ -309,6 +309,16 @@ void PrettyPrinter::VisitLiteral(Literal* node) {
}
+void PrettyPrinter::VisitStringLiteral(StringLiteral* node) {
+ VisitLiteral(node);
+}
+
+
+void PrettyPrinter::VisitNumberLiteral(NumberLiteral* node) {
+ VisitLiteral(node);
+}
+
+
void PrettyPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
Print(" RegExp(");
PrintLiteral(node->pattern(), false);
@@ -368,8 +378,8 @@ void PrettyPrinter::VisitThrow(Throw* node) {
void PrettyPrinter::VisitProperty(Property* node) {
Expression* key = node->key();
- Literal* literal = key->AsLiteral();
- if (literal != NULL && literal->value()->IsInternalizedString()) {
+ StringLiteral* literal = key->AsStringLiteral();
+ if (literal != NULL) {
Print("(");
Visit(node->obj());
Print(").");
@@ -978,6 +988,16 @@ void AstPrinter::VisitLiteral(Literal* node) {
}
+void AstPrinter::VisitStringLiteral(StringLiteral* node) {
+ VisitLiteral(node);
+}
+
+
+void AstPrinter::VisitNumberLiteral(NumberLiteral* node) {
+ VisitLiteral(node);
+}
+
+
void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
IndentedScope indent(this, "REGEXP LITERAL");
PrintLiteralIndented("PATTERN", node->pattern(), false);
@@ -1076,8 +1096,8 @@ void AstPrinter::VisitThrow(Throw* node) {
void AstPrinter::VisitProperty(Property* node) {
IndentedScope indent(this, "PROPERTY");
Visit(node->obj());
- Literal* literal = node->key()->AsLiteral();
- if (literal != NULL && literal->value()->IsInternalizedString()) {
+ StringLiteral* literal = node->key()->AsStringLiteral();
+ if (literal != NULL) {
PrintLiteralIndented("NAME", literal->value(), false);
} else {
PrintIndentedVisit("KEY", node->key());
« no previous file with comments | « src/preparser.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698