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

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: Rename insertAt to insert.~ Created 7 years, 9 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 35e8e2ffc9c4241e892495858b71b43fe1e7887d..999134d93c43f1e710febc81a6533e16710c8bd3 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 insert(int index, Element element) {
+ if (index < 0 || index > length) throw RangeError(index);
+ if (index == length) {
+ _element.$dom_appendChild(element);
+ } else {
+ throw new UnimplementedError("insert on ElementLists");
Lasse Reichstein Nielsen 2013/03/07 09:57:53 Can you use: _element.$dom_insertBefore(element,
floitsch 2013/03/07 12:53:53 No. doesn't exist in Dart yet. That's why I added
blois 2013/03/08 02:32:40 I would leave this as unsupported for now. I can i
+ }
+ }
+
void clear() {
// It is unclear if we want to keep non element nodes?
_element.text = '';

Powered by Google App Engine
This is Rietveld 408576698