Chromium Code Reviews| Index: tools/dom/templates/html/impl/impl_Element.darttemplate |
| diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate |
| index 3e0080a1f7be6021899ee96906afeb79e430188e..0fa84f447eefe926207bc2841f5a331378d572c8 100644 |
| --- a/tools/dom/templates/html/impl/impl_Element.darttemplate |
| +++ b/tools/dom/templates/html/impl/impl_Element.darttemplate |
| @@ -15,8 +15,10 @@ class _ChildrenElementList implements List { |
| : _childElements = element.$dom_children, |
| _element = element; |
| - List<Element> toList() { |
| - final output = new List<Element>.fixedLength(_childElements.length); |
| + List<Element> toList({ bool growable: false }) { |
| + final output = growable |
| + ? (<Element>[]..length = _childElements.length) |
|
floitsch
2013/02/26 13:54:19
I would prefer an if with 2 lines for the length.
Lasse Reichstein Nielsen
2013/02/26 15:26:00
Done.
|
| + : new List<Element>(_childElements.length); |
| for (int i = 0, len = _childElements.length; i < len; i++) { |
| output[i] = _childElements[i]; |
| } |
| @@ -312,7 +314,8 @@ class _FrozenElementList implements List { |
| return false; |
| } |
| - List<Element> toList() => new List<Element>.from(this); |
| + List<Element> toList({ bool growable: false }) => |
| + new List<Element>.from(this, growable: growable); |
|
floitsch
2013/02/26 13:54:19
IterableMixinWorkaround.toListList(this, growable)
|
| Set<Element> toSet() => new Set<Element>.from(this); |
| Iterable<Element> take(int n) { |