Commit 657cd224 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix Windows build.

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
parent 748f8bf7
...@@ -571,11 +571,15 @@ void BasicJsonStringifier::SerializeStringUnchecked_(const SrcChar* src, ...@@ -571,11 +571,15 @@ void BasicJsonStringifier::SerializeStringUnchecked_(const SrcChar* src,
dest += current_index_; dest += current_index_;
DestChar* dest_start = dest; 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++) = '"'; *(dest++) = '"';
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
SrcChar c = src[i]; SrcChar c = src[i];
if (DoNotEscape(c)) { if (DoNotEscape(c)) {
*(dest++) = c; *(dest++) = static_cast<DestChar>(c);
} else { } else {
const char* chars = &JsonEscapeTable[c * kJsonEscapeTableEntrySize]; const char* chars = &JsonEscapeTable[c * kJsonEscapeTableEntrySize];
while (*chars != '\0') *(dest++) = *(chars++); while (*chars != '\0') *(dest++) = *(chars++);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment