| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 * single node. | 192 * single node. |
| 193 */ | 193 */ |
| 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 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 202 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 203 List<Node> get nodes { | 203 List<Node> get nodes { |
| 204 return new _ChildNodeListLazy(this); | 204 return new _ChildNodeListLazy(this); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void set nodes(Iterable<Node> value) { | 207 void set nodes(Iterable<Node> value) { |
| 208 // Copy list first since we don't want liveness during iteration. | 208 // Copy list first since we don't want liveness during iteration. |
| 209 // TODO(jacobr): there is a better way to do this. | 209 // TODO(jacobr): there is a better way to do this. |
| 210 List copy = new List.from(value); | 210 List copy = new List.from(value); |
| 211 text = ''; | 211 text = ''; |
| 212 for (Node node in copy) { | 212 for (Node node in copy) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 TemplateElement.mdvPackage(this).unbindAll(); | 292 TemplateElement.mdvPackage(this).unbindAll(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 /** Gets the template instance that instantiated this node, if any. */ | 295 /** Gets the template instance that instantiated this node, if any. */ |
| 296 @Experimental | 296 @Experimental |
| 297 TemplateInstance get templateInstance => | 297 TemplateInstance get templateInstance => |
| 298 TemplateElement.mdvPackage(this).templateInstance; | 298 TemplateElement.mdvPackage(this).templateInstance; |
| 299 | 299 |
| 300 $!MEMBERS | 300 $!MEMBERS |
| 301 } | 301 } |
| OLD | NEW |