| OLD | NEW |
| 1 // -- start List<$E> mixins. | 1 // -- start List<$E> mixins. |
| 2 // $E is the element type. | 2 // $E is the element type. |
| 3 | 3 |
| 4 // From Iterable<$E>: | 4 // From Iterable<$E>: |
| 5 | 5 |
| 6 Iterator<$E> get iterator { | 6 Iterator<$E> get iterator { |
| 7 // Note: NodeLists are not fixed size. And most probably length shouldn't | 7 // Note: NodeLists are not fixed size. And most probably length shouldn't |
| 8 // be cached in both iterator _and_ forEach method. For now caching it | 8 // be cached in both iterator _and_ forEach method. For now caching it |
| 9 // for consistency. | 9 // for consistency. |
| 10 return new FixedSizeListIterator<$E>(this); | 10 return new FixedSizeListIterator<$E>(this); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 void removeWhere(bool test($E element)) { | 171 void removeWhere(bool test($E element)) { |
| 172 throw new UnsupportedError("Cannot remove from immutable List."); | 172 throw new UnsupportedError("Cannot remove from immutable List."); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void retainWhere(bool test($E element)) { | 175 void retainWhere(bool test($E element)) { |
| 176 throw new UnsupportedError("Cannot remove from immutable List."); | 176 throw new UnsupportedError("Cannot remove from immutable List."); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void setRange(int start, int rangeLength, List<$E> from, [int startFrom]) { | 179 void setRange(int start, int end, List<$E> from, [int startFrom]) { |
| 180 throw new UnsupportedError("Cannot setRange on immutable List."); | 180 throw new UnsupportedError("Cannot setRange on immutable List."); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void removeRange(int start, int rangeLength) { | 183 void removeRange(int start, int rangeLength) { |
| 184 throw new UnsupportedError("Cannot removeRange on immutable List."); | 184 throw new UnsupportedError("Cannot removeRange on immutable List."); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void insertRange(int start, int rangeLength, [$E initialValue]) { | 187 void insertRange(int start, int rangeLength, [$E initialValue]) { |
| 188 throw new UnsupportedError("Cannot insertRange on immutable List."); | 188 throw new UnsupportedError("Cannot insertRange on immutable List."); |
| 189 } | 189 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 200 IterableMixinWorkaround.asMapList(this); | 200 IterableMixinWorkaround.asMapList(this); |
| 201 | 201 |
| 202 String toString() { | 202 String toString() { |
| 203 StringBuffer buffer = new StringBuffer('['); | 203 StringBuffer buffer = new StringBuffer('['); |
| 204 buffer.writeAll(this, ', '); | 204 buffer.writeAll(this, ', '); |
| 205 buffer.write(']'); | 205 buffer.write(']'); |
| 206 return buffer.toString(); | 206 return buffer.toString(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // -- end List<$E> mixins. | 209 // -- end List<$E> mixins. |
| OLD | NEW |