Index: src/objects-printer.cc |
diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
index fa03447a3b9563ee8e24503ed667275a5193b26a..cc66e93c42f228169f23db1291aa63822dd39140 100644 |
--- a/src/objects-printer.cc |
+++ b/src/objects-printer.cc |
@@ -560,6 +560,17 @@ void String::StringPrint(FILE* out) { |
} |
+char* String::ToAsciiArray() { |
+ static char* buffer = NULL; |
Sven Panne
2011/07/29 09:31:46
Drive-by commment: This looks scary... The real pr
|
+ if (buffer != NULL) |
Rico
2011/07/29 09:18:07
{ } around if body unless moved to same line
|
+ free(buffer); |
+ buffer = new char[length()+1]; |
+ WriteToFlat(this, buffer, 0, length()); |
+ buffer[length()] = 0; |
+ return buffer; |
+} |
+ |
+ |
void JSProxy::JSProxyPrint(FILE* out) { |
HeapObject::PrintHeader(out, "JSProxy"); |
PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); |