Chromium Code Reviews| Index: pkg/serialization/lib/src/basic_rule.dart |
| diff --git a/pkg/serialization/lib/src/basic_rule.dart b/pkg/serialization/lib/src/basic_rule.dart |
| index 19a8bcab3c63f059edae35a827df76855c1c1d04..a4c7fd8f08563c66444bdab424a7faa7a50c77bf 100644 |
| --- a/pkg/serialization/lib/src/basic_rule.dart |
| +++ b/pkg/serialization/lib/src/basic_rule.dart |
| @@ -130,12 +130,16 @@ class BasicRule extends SerializationRule { |
| useMaps = false; |
| } |
| - /** Create either a list or a map to hold the object's state, depending |
| + /** |
| + * Create either a list or a map to hold the object's state, depending |
| * on the [useMaps] variable. If using a Map, we wrap it in order to keep |
| * the protocol compatible. See [configureForLists]/[configureForMaps]. |
| + * |
| + * The list need to be growable for SimpleJson format to work. |
|
floitsch
2013/02/26 13:54:19
If a list is returned, it is growable.
|
| */ |
| createStateHolder() => |
| - useMaps ? new _MapWrapper(fields.contents) : new List(fields.length); |
| + useMaps ? new _MapWrapper(fields.contents) |
|
floitsch
2013/02/26 13:54:19
I would prefer an 'if', and the length-assignment
|
| + : (new List()..length = fields.length); |
| /** |
| * Wrap the state if it's passed in as a map, and if the keys are references, |