Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index ca1c65065085d084378cde64d4a7d76550af67da..24c60ece90226acc377365514820761cf81242d4 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1205,6 +1205,11 @@ bool String::MakeExternal(v8::String::ExternalAsciiStringResource* resource) { |
if (FLAG_enable_slow_asserts) { |
// Assert that the resource and the string are equivalent. |
ASSERT(static_cast<size_t>(this->length()) == resource->length()); |
+ if (this->IsTwoByteRepresentation()) { |
+ ScopedVector<uint16_t> smart_chars(this->length()); |
+ String::WriteToFlat(this, smart_chars.start(), 0, this->length()); |
+ ASSERT(String::IsOneByte(smart_chars.start(), this->length())); |
+ } |
Yang
2013/06/06 12:57:36
Is this really necessary? We compare the new resou
dcarney
2013/06/06 13:11:03
the comparison below only compares lower bytes of
|
ScopedVector<char> smart_chars(this->length()); |
String::WriteToFlat(this, smart_chars.start(), 0, this->length()); |
ASSERT(memcmp(smart_chars.start(), |