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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
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 6b75c1324416915a1c09353e648e2bc68bada7ea..c3e5c9b8c8d8fed2131ffde0d5b4198c14fd40cf 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -214,6 +214,15 @@ class _ChildrenElementList implements List {
return Lists.lastIndexOf(this, element, start);
}
+ void insertAt(int index, Element element) {
+ if (index < 0 || index > length) throw RangeError(index);
+ if (index == length) {
+ _element.$dom_appendChild(element);
+ } else {
+ throw new UnimplementedError("insertAt on ElementLists");
sra1 2013/03/08 18:56:53 insertBefore the current element at that slot?
floitsch 2013/03/08 23:17:30 Pete told me to keep it unimplemented: "insertBefo
+ }
+ }
+
void clear() {
// It is unclear if we want to keep non element nodes?
_element.text = '';

Powered by Google App Engine
This is Rietveld 408576698