Index: src/objects.cc |
=================================================================== |
--- src/objects.cc (revision 3090) |
+++ src/objects.cc (working copy) |
@@ -754,7 +754,8 @@ |
if (FLAG_enable_slow_asserts) { |
// Assert that the resource and the string are equivalent. |
ASSERT(static_cast<size_t>(this->length()) == resource->length()); |
- SmartPointer<uc16> smart_chars = this->ToWideCString(); |
+ SmartPointer<uc16> smart_chars(NewArray<uc16>(this->length())); |
+ String::WriteToFlat(this, *smart_chars, 0, this->length()); |
ASSERT(memcmp(*smart_chars, |
resource->data(), |
resource->length() * sizeof(**smart_chars)) == 0); |
@@ -797,7 +798,8 @@ |
if (FLAG_enable_slow_asserts) { |
// Assert that the resource and the string are equivalent. |
ASSERT(static_cast<size_t>(this->length()) == resource->length()); |
- SmartPointer<char> smart_chars = this->ToCString(); |
+ SmartPointer<char> smart_chars(NewArray<char>(this->length())); |
+ String::WriteToFlat(this, *smart_chars, 0, this->length()); |
ASSERT(memcmp(*smart_chars, |
resource->data(), |
resource->length()*sizeof(**smart_chars)) == 0); |