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

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

Issue 12401002: Make List.from and Iterable.toList default to not growable. (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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 Iterable expand(Iterable f(Node element)) { 158 Iterable expand(Iterable f(Node element)) {
159 return IterableMixinWorkaround.expand(this, f); 159 return IterableMixinWorkaround.expand(this, f);
160 } 160 }
161 161
162 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f); 162 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
163 163
164 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f); 164 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
165 165
166 List<Node> toList({ bool growable: false }) => 166 List<Node> toList({ bool growable: true }) =>
167 new List<Node>.from(this, growable: growable); 167 new List<Node>.from(this, growable: growable);
168 Set<Node> toSet() => new Set<Node>.from(this); 168 Set<Node> toSet() => new Set<Node>.from(this);
169 169
170 bool get isEmpty => this.length == 0; 170 bool get isEmpty => this.length == 0;
171 171
172 // From List<Node>: 172 // From List<Node>:
173 173
174 Iterable<Node> take(int n) { 174 Iterable<Node> take(int n) {
175 return IterableMixinWorkaround.takeList(this, n); 175 return IterableMixinWorkaround.takeList(this, n);
176 } 176 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 final Node parent = this.parentNode; 286 final Node parent = this.parentNode;
287 parent.$dom_replaceChild(otherNode, this); 287 parent.$dom_replaceChild(otherNode, this);
288 } catch (e) { 288 } catch (e) {
289 289
290 }; 290 };
291 return this; 291 return this;
292 } 292 }
293 293
294 $!MEMBERS 294 $!MEMBERS
295 } 295 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | tools/dom/templates/immutable_list_mixin.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698