Chromium Code Reviews| Index: client/dom/templates/html/impl/impl_Element.darttemplate |
| diff --git a/client/dom/templates/html/impl/impl_Element.darttemplate b/client/dom/templates/html/impl/impl_Element.darttemplate |
| index 96e670e55dfa4d112efd17580da57782bc971e67..57503ae205959782f811ce22310036c04e57aef2 100644 |
| --- a/client/dom/templates/html/impl/impl_Element.darttemplate |
| +++ b/client/dom/templates/html/impl/impl_Element.darttemplate |
| @@ -59,6 +59,14 @@ class _ChildrenElementList implements ElementList { |
| return false; |
| } |
| + Collection map(f(Element element)) { |
| + final out = []; |
| + for (Element el in this) { |
| + out.add(f(el)); |
| + } |
| + return out; |
| + } |
| + |
| bool isEmpty() { |
| return _element._firstElementChild == null; |
| } |
| @@ -156,7 +164,7 @@ class _FrozenElementList implements ElementList { |
| _FrozenElementList._wrap(this._nodeList); |
| Element get first() { |
| - return _nodeList.first; |
| + return _nodeList[0]; |
|
nweiz
2012/03/05 22:25:02
Why doesn't #first work?
Jacob
2012/03/05 23:31:49
because _nodeList is only guaranteed to be a List<
nweiz
2012/03/05 23:50:57
Ugh, I'd forgotten that List#first doesn't exist.
|
| } |
| void forEach(void f(Element element)) { |