| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 | 6 |
| 7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 #include "vm/json_stream.h" | 9 #include "vm/json_stream.h" |
| 10 #include "vm/message.h" | 10 #include "vm/message.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 } | 303 } |
| 304 | 304 |
| 305 | 305 |
| 306 void JSONStream::CloseArray() { | 306 void JSONStream::CloseArray() { |
| 307 ASSERT(open_objects_ > 0); | 307 ASSERT(open_objects_ > 0); |
| 308 open_objects_--; | 308 open_objects_--; |
| 309 buffer_.AddChar(']'); | 309 buffer_.AddChar(']'); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 void JSONStream::PrintValueNull() { |
| 314 PrintCommaIfNeeded(); |
| 315 buffer_.Printf("null"); |
| 316 } |
| 317 |
| 313 void JSONStream::PrintValueBool(bool b) { | 318 void JSONStream::PrintValueBool(bool b) { |
| 314 PrintCommaIfNeeded(); | 319 PrintCommaIfNeeded(); |
| 315 buffer_.Printf("%s", b ? "true" : "false"); | 320 buffer_.Printf("%s", b ? "true" : "false"); |
| 316 } | 321 } |
| 317 | 322 |
| 318 | 323 |
| 319 void JSONStream::PrintValue(intptr_t i) { | 324 void JSONStream::PrintValue(intptr_t i) { |
| 320 EnsureIntegerIsRepresentableInJavaScript(static_cast<int64_t>(i)); | 325 EnsureIntegerIsRepresentableInJavaScript(static_cast<int64_t>(i)); |
| 321 PrintCommaIfNeeded(); | 326 PrintCommaIfNeeded(); |
| 322 buffer_.Printf("%" Pd "", i); | 327 buffer_.Printf("%" Pd "", i); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); | 836 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); |
| 832 va_end(args); | 837 va_end(args); |
| 833 ASSERT(len == len2); | 838 ASSERT(len == len2); |
| 834 stream_->buffer_.AddChar('"'); | 839 stream_->buffer_.AddChar('"'); |
| 835 stream_->AddEscapedUTF8String(p); | 840 stream_->AddEscapedUTF8String(p); |
| 836 stream_->buffer_.AddChar('"'); | 841 stream_->buffer_.AddChar('"'); |
| 837 free(p); | 842 free(p); |
| 838 } | 843 } |
| 839 | 844 |
| 840 } // namespace dart | 845 } // namespace dart |
| OLD | NEW |