| 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 #include "vm/object.h" | 6 #include "vm/object.h" |
| 7 #include "vm/json_stream.h" | 7 #include "vm/json_stream.h" |
| 8 | 8 |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 | 67 |
| 68 void JSONStream::PrintValueBool(bool b) { | 68 void JSONStream::PrintValueBool(bool b) { |
| 69 PrintCommaIfNeeded(); | 69 PrintCommaIfNeeded(); |
| 70 buffer_->Printf("%s", b ? "true" : "false"); | 70 buffer_->Printf("%s", b ? "true" : "false"); |
| 71 } | 71 } |
| 72 | 72 |
| 73 | 73 |
| 74 void JSONStream::PrintValue(intptr_t i) { | 74 void JSONStream::PrintValue(intptr_t i) { |
| 75 PrintCommaIfNeeded(); | 75 PrintCommaIfNeeded(); |
| 76 buffer_->Printf("%"Pd"", i); | 76 buffer_->Printf("%" Pd "", i); |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 void JSONStream::PrintValue(double d) { | 80 void JSONStream::PrintValue(double d) { |
| 81 PrintCommaIfNeeded(); | 81 PrintCommaIfNeeded(); |
| 82 buffer_->Printf("%f", d); | 82 buffer_->Printf("%f", d); |
| 83 } | 83 } |
| 84 | 84 |
| 85 | 85 |
| 86 void JSONStream::PrintValue(const char* s) { | 86 void JSONStream::PrintValue(const char* s) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 intptr_t length = buffer_->length(); | 201 intptr_t length = buffer_->length(); |
| 202 if (length == 0) { | 202 if (length == 0) { |
| 203 return false; | 203 return false; |
| 204 } | 204 } |
| 205 char ch = buffer[length-1]; | 205 char ch = buffer[length-1]; |
| 206 return ch != '[' && ch != '{' && ch != ':' && ch != ','; | 206 return ch != '[' && ch != '{' && ch != ':' && ch != ','; |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace dart | 209 } // namespace dart |
| 210 | 210 |
| OLD | NEW |