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

Unified Diff: src/objects-printer.cc

Issue 2008893002: [printing] show symbols when using %DebugPrint (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 551beb2e6239ba0d1cab4c61dce12272335f89e9..eff7d0a8d747f4c5e7d7afba86bdd39dead1bb07 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -380,7 +380,6 @@ void JSObject::PrintElements(std::ostream& os) { // NOLINT
case DICTIONARY_ELEMENTS:
case SLOW_STRING_WRAPPER_ELEMENTS:
- os << "\n - elements: ";
elements()->Print(os);
break;
case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
@@ -424,10 +423,14 @@ static void JSObjectPrintHeader(std::ostream& os, JSObject* obj,
static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT
bool print_elements = true) {
- os << "\n {";
+ os << "\n - properties = {";
obj->PrintProperties(os);
- if (print_elements) obj->PrintElements(os);
os << "\n }\n";
+ if (print_elements && obj->elements()->length() > 0) {
+ os << " - elements = {";
+ obj->PrintElements(os);
+ os << "\n }\n";
+ }
}
@@ -716,8 +719,6 @@ void String::StringPrint(std::ostream& os) { // NOLINT
void Name::NamePrint(std::ostream& os) { // NOLINT
if (IsString()) {
String::cast(this)->StringPrint(os);
- } else if (IsSymbol()) {
- Symbol::cast(this)->name()->Print(os);
} else {
os << Brief(this);
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698