| Index: pkg/serialization/lib/src/reader_writer.dart
|
| diff --git a/pkg/serialization/lib/src/reader_writer.dart b/pkg/serialization/lib/src/reader_writer.dart
|
| index 297c7de2dabff8eecfdbc733353c24cb9e4d377c..b40196e87c4ab058ad8b40d9b9d4c742f036254e 100644
|
| --- a/pkg/serialization/lib/src/reader_writer.dart
|
| +++ b/pkg/serialization/lib/src/reader_writer.dart
|
| @@ -241,6 +241,9 @@ abstract class ReaderOrWriter {
|
| /** Return the list of serialization rules we are using.*/
|
| List<SerializationRule> get rules;
|
|
|
| + /** Return the internal collection of object state and [Reference] objects. */
|
| + List<List> get states;
|
| +
|
| /**
|
| * Return the object, or state, that ref points to, depending on which
|
| * we're generating.
|
| @@ -278,6 +281,9 @@ class Reader implements ReaderOrWriter {
|
| */
|
| List<List> _data;
|
|
|
| + /** Return the internal collection of object state and [Reference] objects. */
|
| + get states => _data;
|
| +
|
| /**
|
| * The resulting objects, indexed according to the same scheme as
|
| * _data, where each rule has a number, and rules keep track of the objects
|
| @@ -467,7 +473,7 @@ class Reader implements ReaderOrWriter {
|
| asReference(anObject, {Function ifReference: doNothing,
|
| Function ifNotReference : doNothing}) {
|
| if (anObject is Reference) return ifReference(anObject);
|
| - if (anObject is Map && anObject["__Ref"] == true) {
|
| + if (anObject is Map && anObject["__Ref"] != null) {
|
| var ref =
|
| new Reference(this, anObject["rule"], anObject["object"]);
|
| return ifReference(ref);
|
| @@ -585,8 +591,8 @@ class Reference {
|
| */
|
| // TODO(alanknight): This is a hack both in defining a toJson specific to a
|
| // particular representation, and the use of a bogus sentinel "__Ref"
|
| - Map<String, dynamic> toJson() => {
|
| - "__Ref" : true,
|
| + Map<String, int> toJson() => {
|
| + "__Ref" : 0,
|
| "rule" : ruleNumber,
|
| "object" : objectNumber
|
| };
|
|
|