| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.serialization.json; | 5 library dart2js.serialization.json; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 |
| 8 import 'keys.dart'; | 9 import 'keys.dart'; |
| 9 import 'serialization.dart'; | 10 import 'serialization.dart'; |
| 10 import 'values.dart'; | 11 import 'values.dart'; |
| 11 | 12 |
| 12 /// Serialization encoder for JSON. | 13 /// Serialization encoder for JSON. |
| 13 class JsonSerializationEncoder implements SerializationEncoder { | 14 class JsonSerializationEncoder implements SerializationEncoder { |
| 14 const JsonSerializationEncoder(); | 15 const JsonSerializationEncoder(); |
| 15 | 16 |
| 16 String encode(ObjectValue objectValue) { | 17 String encode(ObjectValue objectValue) { |
| 17 return new JsonEncoder.withIndent(' ') | 18 return new JsonEncoder.withIndent(' ') |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 @override | 205 @override |
| 205 void visitType(TypeValue value, String indentation) { | 206 void visitType(TypeValue value, String indentation) { |
| 206 buffer.write('Type(${value.id}):${value.type}'); | 207 buffer.write('Type(${value.id}):${value.type}'); |
| 207 } | 208 } |
| 208 | 209 |
| 209 @override | 210 @override |
| 210 void visitUri(UriValue value, String indentation) { | 211 void visitUri(UriValue value, String indentation) { |
| 211 buffer.write('Uri(${value.value})'); | 212 buffer.write('Uri(${value.value})'); |
| 212 } | 213 } |
| 213 } | 214 } |
| OLD | NEW |