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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 final Node lastNode; | 194 final Node lastNode; |
195 | 195 |
196 /** The model used to instantiate the template. */ | 196 /** The model used to instantiate the template. */ |
197 final model; | 197 final model; |
198 | 198 |
199 TemplateInstance(this.firstNode, this.lastNode, this.model); | 199 TemplateInstance(this.firstNode, this.lastNode, this.model); |
200 } | 200 } |
201 | 201 |
202 | 202 |
203 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 203 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 204 |
| 205 // Custom element created callback. |
| 206 Node._created() : super._created(); |
| 207 |
204 List<Node> get nodes { | 208 List<Node> get nodes { |
205 return new _ChildNodeListLazy(this); | 209 return new _ChildNodeListLazy(this); |
206 } | 210 } |
207 | 211 |
208 void set nodes(Iterable<Node> value) { | 212 void set nodes(Iterable<Node> value) { |
209 // Copy list first since we don't want liveness during iteration. | 213 // Copy list first since we don't want liveness during iteration. |
210 // TODO(jacobr): there is a better way to do this. | 214 // TODO(jacobr): there is a better way to do this. |
211 List copy = new List.from(value); | 215 List copy = new List.from(value); |
212 text = ''; | 216 text = ''; |
213 for (Node node in copy) { | 217 for (Node node in copy) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 Map<String, dynamic> get bindings => | 316 Map<String, dynamic> get bindings => |
313 TemplateElement.mdvPackage(this).bindings; | 317 TemplateElement.mdvPackage(this).bindings; |
314 | 318 |
315 /** Gets the template instance that instantiated this node, if any. */ | 319 /** Gets the template instance that instantiated this node, if any. */ |
316 @Experimental() | 320 @Experimental() |
317 TemplateInstance get templateInstance => | 321 TemplateInstance get templateInstance => |
318 TemplateElement.mdvPackage(this).templateInstance; | 322 TemplateElement.mdvPackage(this).templateInstance; |
319 | 323 |
320 $!MEMBERS | 324 $!MEMBERS |
321 } | 325 } |
OLD | NEW |