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

Side by Side Diff: pkg/third_party/html5lib/lib/src/list_proxy.dart

Issue 331833003: Revert "Add "last" setter to List." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/third_party/html5lib/lib/dom.dart ('k') | pkg/third_party/html5lib/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // TODO(jmesserly): remove this once we have a subclassable growable list 1 // TODO(jmesserly): remove this once we have a subclassable growable list
2 // in our libraries. 2 // in our libraries.
3 3
4 /// A [List] proxy that you can subclass. 4 /// A [List] proxy that you can subclass.
5 library list_proxy; 5 library list_proxy;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show Random; 8 import 'dart:math' show Random;
9 9
10 // TOOD(jmesserly): this needs to be removed, but fixing NodeList is tricky. 10 // TOOD(jmesserly): this needs to be removed, but fixing NodeList is tricky.
(...skipping 29 matching lines...) Expand all
40 40
41 // From Iterable 41 // From Iterable
42 Iterator<E> get iterator => _list.iterator; 42 Iterator<E> get iterator => _list.iterator;
43 43
44 // From List 44 // From List
45 E operator [](int index) => _list[index]; 45 E operator [](int index) => _list[index];
46 operator []=(int index, E value) { _list[index] = value; } 46 operator []=(int index, E value) { _list[index] = value; }
47 set length(int value) { _list.length = value; } 47 set length(int value) { _list.length = value; }
48 void add(E value) { _list.add(value); } 48 void add(E value) { _list.add(value); }
49 49
50 void set last(E value) { _list.last = value; }
51 void addLast(E value) { add(value); } 50 void addLast(E value) { add(value); }
52 void addAll(Iterable<E> collection) { _list.addAll(collection); } 51 void addAll(Iterable<E> collection) { _list.addAll(collection); }
53 void sort([int compare(E a, E b)]) { _list.sort(compare); } 52 void sort([int compare(E a, E b)]) { _list.sort(compare); }
54 void shuffle([Random random]) { _list.shuffle(random); } 53 void shuffle([Random random]) { _list.shuffle(random); }
55 54
56 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); 55 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
57 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); 56 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start);
58 void clear() { _list.clear(); } 57 void clear() { _list.clear(); }
59 58
60 E removeAt(int index) => _list.removeAt(index); 59 E removeAt(int index) => _list.removeAt(index);
(...skipping 19 matching lines...) Expand all
80 Map<int, E> asMap() => _list.asMap(); 79 Map<int, E> asMap() => _list.asMap();
81 80
82 void replaceRange(int start, int end, Iterable<E> newContents) => 81 void replaceRange(int start, int end, Iterable<E> newContents) =>
83 _list.replaceRange(start, end, newContents); 82 _list.replaceRange(start, end, newContents);
84 83
85 void setAll(int index, Iterable<E> iterable) => _list.setAll(index, iterable); 84 void setAll(int index, Iterable<E> iterable) => _list.setAll(index, iterable);
86 85
87 void fillRange(int start, int end, [E fillValue]) 86 void fillRange(int start, int end, [E fillValue])
88 => _list.fillRange(start, end, fillValue); 87 => _list.fillRange(start, end, fillValue);
89 } 88 }
OLDNEW
« no previous file with comments | « pkg/third_party/html5lib/lib/dom.dart ('k') | pkg/third_party/html5lib/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698