Chromium Code Reviews| Index: sdk/lib/core/list.dart |
| diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart |
| index b7978ff4852c361b8e69d9d89a0ce5288f1ecc4b..0b62f2ad23c3cac275a409e76193d3a27517c154 100644 |
| --- a/sdk/lib/core/list.dart |
| +++ b/sdk/lib/core/list.dart |
| @@ -33,6 +33,18 @@ part of dart.core; |
| * unmodifiableList.length = 0; // throws. |
| * unmodifiableList.add(499); // throws |
| * unmodifiableList[0] = 87; // throws. |
| + * |
| + * Lists are [Iterable]. |
| + * List iteration iterates over values in index order. |
| + * Changing the values will not affect iteration, |
| + * but changing the valid indices - |
| + * that is, changing the list's length - |
| + * between iteration steps |
| + * will cause a [ConcurrentModificationError]. |
| + * This means that only growable lists can throw [ConcurrentModificationError]. |
| + * If the length changes temporarily |
| + * and is restored before continuing the iteration, |
| + * the iterator will not detect it. |
|
hausner
2013/04/25 23:07:17
Right. So why add the check?
|
| */ |
| abstract class List<E> implements Iterable<E> { |
| /** |