Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: runtime/vm/json_stream.cc

Issue 18472009: JSONStream Print Dart Objects (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/json_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/json_stream.cc
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 1749cff98c68412a0e161ab3f72f7674ff6dc3a6..df60bc52992e42f6acfe551d15959bbb36ab9b2d 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/assert.h"
+#include "vm/object.h"
#include "vm/json_stream.h"
@@ -83,6 +84,12 @@ void JSONStream::PrintValue(const char* s) {
}
+void JSONStream::PrintValue(const Object& o, bool ref) {
+ PrintCommaIfNeeded();
+ o.PrintToJSONStream(this, ref);
+}
+
+
void JSONStream::PrintPropertyBool(const char* name, bool b) {
PrintPropertyName(name);
PrintValueBool(b);
@@ -107,6 +114,12 @@ void JSONStream::PrintProperty(const char* name, const char* s) {
}
+void JSONStream::PrintProperty(const char* name, const Object& o, bool ref) {
+ PrintPropertyName(name);
+ PrintValue(o, ref);
+}
+
+
void JSONStream::PrintPropertyName(const char* name) {
ASSERT(name != NULL);
PrintCommaIfNeeded();
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/json_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698