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

Unified Diff: tools/dom/templates/html/impl/impl_Node.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_Node.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index b113a5aaf7b3e905e603e5b4647199ddf2dc8e88..d1764d0fc16db79748bc6829b4d1cd01fb7bafea 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -83,6 +83,15 @@ $endif
}
}
+ void insert(int index, Node node) {
+ if (index < 0 || index > length) throw RangeError(index);
+ if (index == length) {
+ _this.$dom_appendChild(node);
+ } else {
+ throw new UnimplementedError("insert on NodeLists");
Lasse Reichstein Nielsen 2013/03/07 09:57:53 And _this.$dom_insertBefore(node, _this.$dom_chil
floitsch 2013/03/07 12:53:53 There is no 'dom_insertBefore' in Dart.
blois 2013/03/08 02:32:40 It's just insertBefore, on node.
+ }
+ }
+
Node removeLast() {
final result = last;
if (result != null) {

Powered by Google App Engine
This is Rietveld 408576698