R=mstarzinger@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/
11232058
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12799
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
dest += current_index_;
DestChar* dest_start = dest;
+ // Assert that uc16 character is not truncated down to 8 bit.
+ // The <uc16, char> version of this method must not be called.
+ ASSERT(sizeof(*dest) >= sizeof(*src));
+
*(dest++) = '"';
for (int i = 0; i < length; i++) {
SrcChar c = src[i];
if (DoNotEscape(c)) {
- *(dest++) = c;
+ *(dest++) = static_cast<DestChar>(c);
} else {
const char* chars = &JsonEscapeTable[c * kJsonEscapeTableEntrySize];
while (*chars != '\0') *(dest++) = *(chars++);