Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: tools/dom/templates/html/impl/impl_Node.darttemplate

Issue 12407005: Adding tests for Element & Node lists insert method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 } 85 }
86 86
87 void insert(int index, Node node) { 87 void insert(int index, Node node) {
88 if (index < 0 || index > length) { 88 if (index < 0 || index > length) {
89 throw new RangeError.range(index, 0, length); 89 throw new RangeError.range(index, 0, length);
90 } 90 }
91 if (index == length) { 91 if (index == length) {
92 _this.append(node); 92 _this.append(node);
93 } else { 93 } else {
94 this_.insertBefore(node, this[index]); 94 _this.insertBefore(node, this[index]);
95 } 95 }
96 } 96 }
97 97
98 Node removeLast() { 98 Node removeLast() {
99 final result = last; 99 final result = last;
100 if (result != null) { 100 if (result != null) {
101 _this.$dom_removeChild(result); 101 _this.$dom_removeChild(result);
102 } 102 }
103 return result; 103 return result;
104 } 104 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 } else { 326 } else {
327 for (var node in newNodes) { 327 for (var node in newNodes) {
328 this.insertBefore(node, refChild); 328 this.insertBefore(node, refChild);
329 } 329 }
330 } 330 }
331 } 331 }
332 332
333 $!MEMBERS 333 $!MEMBERS
334 } 334 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698