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

Unified Diff: src/ast/prettyprinter.cc

Issue 1647213002: Remove unnecessary ClassLiteral name member and simplify Function.name handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Slightly shorter Created 4 years, 11 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/ast/ast.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/prettyprinter.cc
diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
index 1f6b8c31debb8376d3aff273ab6c7d8e40b0fed7..d9d8a12a94a4ed861948fa0f9d98c66e9ae77c65 100644
--- a/src/ast/prettyprinter.cc
+++ b/src/ast/prettyprinter.cc
@@ -719,7 +719,7 @@ void PrettyPrinter::VisitFunctionLiteral(FunctionLiteral* node) {
void PrettyPrinter::VisitClassLiteral(ClassLiteral* node) {
Print("(class ");
- PrintLiteral(node->name(), false);
+ PrintLiteral(node->constructor()->name(), false);
if (node->extends()) {
Print(" extends ");
Visit(node->extends());
@@ -1429,9 +1429,7 @@ void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) {
void AstPrinter::VisitClassLiteral(ClassLiteral* node) {
IndentedScope indent(this, "CLASS LITERAL", node->position());
- if (node->raw_name() != nullptr) {
- PrintLiteralIndented("NAME", node->name(), false);
- }
+ PrintLiteralIndented("NAME", node->constructor()->name(), false);
if (node->extends() != nullptr) {
PrintIndentedVisit("EXTENDS", node->extends());
}
« no previous file with comments | « src/ast/ast.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698