| Index: runtime/vm/json_stream.cc
|
| diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
|
| index 762124d1c26f04caebca29650c765a6645192107..b77b01f3d4e67a57bdb32bfb34a18cc07167750e 100644
|
| --- a/runtime/vm/json_stream.cc
|
| +++ b/runtime/vm/json_stream.cc
|
| @@ -217,6 +217,14 @@ void JSONStream::PrintValue(const char* s) {
|
| }
|
|
|
|
|
| +void JSONStream::PrintValue(const char* s, intptr_t len) {
|
| + PrintCommaIfNeeded();
|
| + buffer_.AddChar('"');
|
| + AddEscapedUTF8String(s, len);
|
| + buffer_.AddChar('"');
|
| +}
|
| +
|
| +
|
| void JSONStream::PrintValueNoEscape(const char* s) {
|
| PrintCommaIfNeeded();
|
| buffer_.Printf("%s", s);
|
| @@ -302,6 +310,12 @@ void JSONStream::PrintProperty(const char* name, const char* s) {
|
| }
|
|
|
|
|
| +void JSONStream::PrintProperty(const char* name, const char* s, intptr_t len) {
|
| + PrintPropertyName(name);
|
| + PrintValue(s, len);
|
| +}
|
| +
|
| +
|
| void JSONStream::PrintPropertyNoEscape(const char* name, const char* s) {
|
| PrintPropertyName(name);
|
| PrintValueNoEscape(s);
|
| @@ -412,6 +426,14 @@ void JSONStream::AddEscapedUTF8String(const char* s) {
|
| return;
|
| }
|
| intptr_t len = strlen(s);
|
| + AddEscapedUTF8String(s, len);
|
| +}
|
| +
|
| +
|
| +void JSONStream::AddEscapedUTF8String(const char* s, intptr_t len) {
|
| + if (s == NULL) {
|
| + return;
|
| + }
|
| const uint8_t* s8 = reinterpret_cast<const uint8_t*>(s);
|
| intptr_t i = 0;
|
| for (; i < len; ) {
|
|
|