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

Unified Diff: src/objects.cc

Issue 12459026: ES6 symbols: implement name property (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing scavenge visitor Created 7 years, 9 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 5fb973894d01865bf5e7a7d3dd428316e9eb43ae..cedba4cf03ae74da1a00fd8e067bd1ebcc745dc0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1460,9 +1460,15 @@ void HeapObject::HeapObjectShortPrint(StringStream* accumulator) {
accumulator->Add("<Odd Oddball>");
break;
}
- case SYMBOL_TYPE:
- accumulator->Add("<Symbol: %d>", Symbol::cast(this)->Hash());
+ case SYMBOL_TYPE: {
+ Symbol* symbol = Symbol::cast(this);
+ accumulator->Add("<Symbol: %d", symbol->Hash());
+ if (!symbol->name()->IsUndefined()) {
+ String::cast(symbol->name())->StringShortPrint(accumulator);
Michael Starzinger 2013/03/22 12:03:25 I think there is a white-space missing between the
rossberg 2013/03/22 13:02:42 That actually was intentional, but I added a space
+ }
+ accumulator->Add(">");
break;
+ }
case HEAP_NUMBER_TYPE:
accumulator->Add("<Number: ");
HeapNumber::cast(this)->HeapNumberPrint(accumulator);
@@ -1572,6 +1578,8 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v);
break;
case SYMBOL_TYPE:
+ Symbol::BodyDescriptor::IterateBody(this, v);
+ break;
case HEAP_NUMBER_TYPE:
case FILLER_TYPE:
case BYTE_ARRAY_TYPE:

Powered by Google App Engine
This is Rietveld 408576698