| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 throw new RangeError.range(index, 0, length); | 76 throw new RangeError.range(index, 0, length); |
| 77 } | 77 } |
| 78 if (index == length) { | 78 if (index == length) { |
| 79 _this.append(node); | 79 _this.append(node); |
| 80 } else { | 80 } else { |
| 81 _this.insertBefore(node, this[index]); | 81 _this.insertBefore(node, this[index]); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 void insertAll(int index, Iterable<Node> iterable) { | 85 void insertAll(int index, Iterable<Node> iterable) { |
| 86 var item = this[index]; | 86 if (index == length) { |
| 87 _this.insertAllBefore(iterable, item); | 87 addAll(iterable); |
| 88 } else { |
| 89 var item = this[index]; |
| 90 _this.insertAllBefore(iterable, item); |
| 91 } |
| 88 } | 92 } |
| 89 | 93 |
| 90 void setAll(int index, Iterable<Node> iterable) { | 94 void setAll(int index, Iterable<Node> iterable) { |
| 91 throw new UnsupportedError("Cannot setAll on Node list"); | 95 throw new UnsupportedError("Cannot setAll on Node list"); |
| 92 } | 96 } |
| 93 | 97 |
| 94 Node removeLast() { | 98 Node removeLast() { |
| 95 final result = last; | 99 final result = last; |
| 96 if (result != null) { | 100 if (result != null) { |
| 97 _this._removeChild(result); | 101 _this._removeChild(result); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 _removeChild(firstChild); | 268 _removeChild(firstChild); |
| 265 } | 269 } |
| 266 } | 270 } |
| 267 | 271 |
| 268 /** | 272 /** |
| 269 * Print out a String representation of this Node. | 273 * Print out a String representation of this Node. |
| 270 */ | 274 */ |
| 271 String toString() => nodeValue == null ? super.toString() : nodeValue; | 275 String toString() => nodeValue == null ? super.toString() : nodeValue; |
| 272 $!MEMBERS | 276 $!MEMBERS |
| 273 } | 277 } |
| OLD | NEW |