OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 /** | 7 /** |
8 * Lazy implementation of the child nodes of an element that does not request | 8 * Lazy implementation of the child nodes of an element that does not request |
9 * the actual child nodes of an element until strictly necessary greatly | 9 * the actual child nodes of an element until strictly necessary greatly |
10 * improving performance for the typical cases where it is not required. | 10 * improving performance for the typical cases where it is not required. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 Node singleMatching(bool test(Node value)) { | 192 Node singleMatching(bool test(Node value)) { |
193 return IterableMixinWorkaround.singleMatching(this, test); | 193 return IterableMixinWorkaround.singleMatching(this, test); |
194 } | 194 } |
195 | 195 |
196 Node elementAt(int index) { | 196 Node elementAt(int index) { |
197 return this[index]; | 197 return this[index]; |
198 } | 198 } |
199 | 199 |
200 List<Node> get reversed { | 200 Iterable<Node> get reversed { |
201 return IterableMixinWorkaround.reversedList(this); | 201 return IterableMixinWorkaround.reversedList(this); |
202 } | 202 } |
203 | 203 |
204 // TODO(jacobr): this could be implemented for child node lists. | 204 // TODO(jacobr): this could be implemented for child node lists. |
205 // The exception we throw here is misleading. | 205 // The exception we throw here is misleading. |
206 void sort([int compare(Node a, Node b)]) { | 206 void sort([int compare(Node a, Node b)]) { |
207 throw new UnsupportedError("Cannot sort immutable List."); | 207 throw new UnsupportedError("Cannot sort immutable List."); |
208 } | 208 } |
209 | 209 |
210 int indexOf(Node element, [int start = 0]) => | 210 int indexOf(Node element, [int start = 0]) => |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 final Node parent = this.parentNode; | 280 final Node parent = this.parentNode; |
281 parent.$dom_replaceChild(otherNode, this); | 281 parent.$dom_replaceChild(otherNode, this); |
282 } catch (e) { | 282 } catch (e) { |
283 | 283 |
284 }; | 284 }; |
285 return this; | 285 return this; |
286 } | 286 } |
287 | 287 |
288 $!MEMBERS | 288 $!MEMBERS |
289 } | 289 } |
OLD | NEW |