| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** | 5 /** |
| 6 * Wrappers that prevent List, Set, or Map objects from being modified. | 6 * Wrappers that prevent List, Set, or Map objects from being modified. |
| 7 * | 7 * |
| 8 * The [Set] and [Map] wrappers allow reading from the wrapped collection, | 8 * The [Set] and [Map] wrappers allow reading from the wrapped collection, |
| 9 * but prohibit writing. | 9 * but prohibit writing. |
| 10 * | 10 * |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 /** | 77 /** |
| 78 * Throws an [UnsupportedError]; | 78 * Throws an [UnsupportedError]; |
| 79 * operations that change the length of the list are disallowed. | 79 * operations that change the length of the list are disallowed. |
| 80 */ | 80 */ |
| 81 void set length(int newLength) => _throw(); | 81 void set length(int newLength) => _throw(); |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * Throws an [UnsupportedError]; | 84 * Throws an [UnsupportedError]; |
| 85 * operations that change the length of the list are disallowed. | 85 * operations that change the length of the list are disallowed. |
| 86 */ | 86 */ |
| 87 void add(E value) => _throw(); | 87 bool add(E value) { |
| 88 _throw(); |
| 89 } |
| 88 | 90 |
| 89 /** | 91 /** |
| 90 * Throws an [UnsupportedError]; | 92 * Throws an [UnsupportedError]; |
| 91 * operations that change the length of the list are disallowed. | 93 * operations that change the length of the list are disallowed. |
| 92 */ | 94 */ |
| 93 void addAll(Iterable<E> iterable) => _throw(); | 95 void addAll(Iterable<E> iterable) => _throw(); |
| 94 | 96 |
| 95 /** | 97 /** |
| 96 * Throws an [UnsupportedError]; | 98 * Throws an [UnsupportedError]; |
| 97 * operations that change the length of the list are disallowed. | 99 * operations that change the length of the list are disallowed. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 Set<E> union(Set<E> other) => _source.union(other); | 180 Set<E> union(Set<E> other) => _source.union(other); |
| 179 | 181 |
| 180 Set<E> difference(Set<E> other) => _source.difference(other); | 182 Set<E> difference(Set<E> other) => _source.difference(other); |
| 181 | 183 |
| 182 E lookup(Object object) => _source.lookup(object); | 184 E lookup(Object object) => _source.lookup(object); |
| 183 | 185 |
| 184 /** | 186 /** |
| 185 * Throws an [UnsupportedError]; | 187 * Throws an [UnsupportedError]; |
| 186 * operations that change the set are disallowed. | 188 * operations that change the set are disallowed. |
| 187 */ | 189 */ |
| 188 bool add(E value) => _throw(); | 190 bool add(E value) { |
| 191 _throw(); |
| 192 } |
| 189 | 193 |
| 190 /** | 194 /** |
| 191 * Throws an [UnsupportedError]; | 195 * Throws an [UnsupportedError]; |
| 192 * operations that change the set are disallowed. | 196 * operations that change the set are disallowed. |
| 193 */ | 197 */ |
| 194 void addAll(Iterable<E> elements) => _throw(); | 198 void addAll(Iterable<E> elements) => _throw(); |
| 195 | 199 |
| 196 /** | 200 /** |
| 197 * Throws an [UnsupportedError]; | 201 * Throws an [UnsupportedError]; |
| 198 * operations that change the set are disallowed. | 202 * operations that change the set are disallowed. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 Iterable<E> take(int n) => _source.take(n); | 355 Iterable<E> take(int n) => _source.take(n); |
| 352 | 356 |
| 353 Iterable<E> takeWhile(bool test(E value)) => _source.takeWhile(test); | 357 Iterable<E> takeWhile(bool test(E value)) => _source.takeWhile(test); |
| 354 | 358 |
| 355 List<E> toList({ bool growable: true }) => _source.toList(growable: growable); | 359 List<E> toList({ bool growable: true }) => _source.toList(growable: growable); |
| 356 | 360 |
| 357 Set<E> toSet() => _source.toSet(); | 361 Set<E> toSet() => _source.toSet(); |
| 358 | 362 |
| 359 Iterable<E> where(bool test(E element)) => _source.where(test); | 363 Iterable<E> where(bool test(E element)) => _source.where(test); |
| 360 } | 364 } |
| OLD | NEW |