| 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.
|
|
|
|
|