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

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: 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_Node.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index 307cd0cea96e329577874641d1b269bf174c973d..9367f9fd8a8268dc547d0a3812d9e7e625fc11f1 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 insertAt(int index, Node node) {
+ if (index < 0 || index > length) throw RangeError(index);
+ if (index == length) {
+ _this.$dom_appendChild(node);
+ } else {
+ throw new UnimplementedError("insertAt on NodeLists");
+ }
+ }
+
Node removeLast() {
final result = last;
if (result != null) {

Powered by Google App Engine
This is Rietveld 408576698