| 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; | 5 library dart2js.serialization; |
| 6 | 6 |
| 7 import '../common/backend_api.dart'; | 7 import '../common/backend_api.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| 11 import '../universe/world_impact.dart'; | 11 import '../universe/world_impact.dart'; |
| 12 | 12 |
| 13 import 'constant_serialization.dart'; | 13 import 'constant_serialization.dart'; |
| 14 import 'element_serialization.dart'; | 14 import 'element_serialization.dart'; |
| 15 import 'impact_serialization.dart'; | 15 import 'impact_serialization.dart'; |
| 16 import 'json_serializer.dart'; | 16 import 'json_serializer.dart'; |
| 17 import 'keys.dart'; | 17 import 'keys.dart'; |
| 18 import 'type_serialization.dart'; | 18 import 'type_serialization.dart'; |
| 19 import 'values.dart'; | 19 import 'values.dart'; |
| 20 | 20 |
| 21 export 'task.dart' show LibraryDeserializer; |
| 22 |
| 21 /// An object that supports the encoding an [ObjectValue] for serialization. | 23 /// An object that supports the encoding an [ObjectValue] for serialization. |
| 22 /// | 24 /// |
| 23 /// The [ObjectEncoder] ensures that nominality and circularities of | 25 /// The [ObjectEncoder] ensures that nominality and circularities of |
| 24 /// non-primitive values like [Element], [DartType] and [ConstantExpression] are | 26 /// non-primitive values like [Element], [DartType] and [ConstantExpression] are |
| 25 /// handled. | 27 /// handled. |
| 26 class ObjectEncoder extends AbstractEncoder<Key> { | 28 class ObjectEncoder extends AbstractEncoder<Key> { |
| 27 /// Creates an [ObjectEncoder] in the scope of [serializer] that uses [map] | 29 /// Creates an [ObjectEncoder] in the scope of [serializer] that uses [map] |
| 28 /// as its internal storage. | 30 /// as its internal storage. |
| 29 ObjectEncoder(Serializer serializer, Map<dynamic, Value> map) | 31 ObjectEncoder(Serializer serializer, Map<dynamic, Value> map) |
| 30 : super(serializer, map); | 32 : super(serializer, map); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 911 |
| 910 /// Returns the value used to store [key] as a property in the encoding an | 912 /// Returns the value used to store [key] as a property in the encoding an |
| 911 /// [ObjectValue]. | 913 /// [ObjectValue]. |
| 912 /// | 914 /// |
| 913 /// Different encodings have different restrictions and capabilities as how | 915 /// Different encodings have different restrictions and capabilities as how |
| 914 /// to store a [Key] value. For instance: A JSON encoding needs to convert | 916 /// to store a [Key] value. For instance: A JSON encoding needs to convert |
| 915 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can | 917 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can |
| 916 /// choose to store a [Key] as an [int] or as the [Key] itself. | 918 /// choose to store a [Key] as an [int] or as the [Key] itself. |
| 917 getObjectPropertyValue(Key key); | 919 getObjectPropertyValue(Key key); |
| 918 } | 920 } |
| OLD | NEW |