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

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

Issue 13934019: Revert "With the collections deriving from ListBase, we no longer need to implement a number of boi… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54f234768cffc3f88c3c3d0df17dea8ca8fac651..af1644763a7f2b71f4ede4194513b671918cbfbe 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -83,12 +83,11 @@ $endif
}
void insertAll(int index, Iterable<Node> iterable) {
- var item = this[index];
- _this.insertAllBefore(iterable, item);
+ throw new UnimplementedError();
}
void setAll(int index, Iterable<Node> iterable) {
- throw new UnsupportedError("Cannot setAll on Node list");
+ throw new UnimplementedError();
}
Node removeLast() {
@@ -146,22 +145,53 @@ $endif
Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
+ List<Node> toList({ bool growable: true }) =>
+ new List<Node>.from(this, growable: growable);
+ Set<Node> toSet() => new Set<Node>.from(this);
+
+ bool get isEmpty => this.length == 0;
+
// From List<Node>:
// TODO(jacobr): this could be implemented for child node lists.
// The exception we throw here is misleading.
- void sort([Comparator<Node> compare]) {
- throw new UnsupportedError("Cannot sort Node list");
+ void sort([int compare(Node a, Node b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
}
// FIXME: implement these.
void setRange(int start, int end, Iterable<Node> iterable,
[int skipCount = 0]) {
- throw new UnsupportedError("Cannot setRange on Node list");
+ throw new UnsupportedError(
+ "Cannot setRange on immutable List.");
+ }
+ void removeRange(int start, int end) {
+ throw new UnsupportedError(
+ "Cannot removeRange on immutable List.");
+ }
+
+ Iterable<Node> getRange(int start, int end) {
+ throw new UnimplementedError("NodeList.getRange");
+ }
+
+ void replaceRange(int start, int end, Iterable<Node> iterable) {
+ throw new UnimplementedError("NodeList.replaceRange");
+ }
+
+ void fillRange(int start, int end, [Node fillValue]) {
+ throw new UnimplementedError("NodeList.fillRange");
+ }
+
+ List<Node> sublist(int start, [int end]) {
+ if (end == null) end == length;
+ return Lists.getRange(this, start, end, <Node>[]);
}
- void fillRange(int start, int end, [Node fill]) {
- throw new UnsupportedError("Cannot fillRange on Node list");
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
}
// -- end List<Node> mixins.
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698