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

Unified Diff: src/objects.cc

Issue 48923002: Provide private symbols through internal APIs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make privates a non-value; comments Created 7 years, 2 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f7c89175da75c2fb7916015a34adf9954b565eef..85ae8fe54e87075ef8cf34b9b8749a8bde9caec9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1669,10 +1669,14 @@ void HeapObject::HeapObjectShortPrint(StringStream* accumulator) {
}
case SYMBOL_TYPE: {
Symbol* symbol = Symbol::cast(this);
- accumulator->Add("<Symbol: %d", symbol->Hash());
- if (!symbol->name()->IsUndefined()) {
+ accumulator->Add("<");
+ accumulator->Add(symbol->IsPrivate() ? "Private" : "Symbol");
+ accumulator->Add(": %d", symbol->Hash());
+ Object* name =
+ symbol->IsPrivate() ? Private::cast(symbol)->name() : symbol->name();
+ if (!name->IsUndefined()) {
accumulator->Add(" ");
- String::cast(symbol->name())->StringShortPrint(accumulator);
+ String::cast(name)->StringShortPrint(accumulator);
}
accumulator->Add(">");
break;

Powered by Google App Engine
This is Rietveld 408576698