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

Side by Side Diff: tools/dom/templates/immutable_list_mixin.darttemplate

Issue 12089023: Don't use ReversedListView from outside core and collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dart2js. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // -- start List<$E> mixins. 1 // -- start List<$E> mixins.
2 // $E is the element type. 2 // $E is the element type.
3 3
4 // From Iterable<$E>: 4 // From Iterable<$E>:
5 5
6 Iterator<$E> get iterator { 6 Iterator<$E> get iterator {
7 // Note: NodeLists are not fixed size. And most probably length shouldn't 7 // Note: NodeLists are not fixed size. And most probably length shouldn't
8 // be cached in both iterator _and_ forEach method. For now caching it 8 // be cached in both iterator _and_ forEach method. For now caching it
9 // for consistency. 9 // for consistency.
10 return new FixedSizeListIterator<$E>(this); 10 return new FixedSizeListIterator<$E>(this);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 $endif 93 $endif
94 94
95 $if DEFINE_CLEAR 95 $if DEFINE_CLEAR
96 void clear() { 96 void clear() {
97 throw new UnsupportedError("Cannot clear immutable List."); 97 throw new UnsupportedError("Cannot clear immutable List.");
98 } 98 }
99 $else 99 $else
100 // clear() defined by IDL. 100 // clear() defined by IDL.
101 $endif 101 $endif
102 102
103 List<$E> get reversed => 103 List<$E> get reversed {
104 new ReversedListView<$E>(this, 0, null); 104 return IterableMixinWorkaround.reversedList(this);
105 }
105 106
106 void sort([int compare($E a, $E b)]) { 107 void sort([int compare($E a, $E b)]) {
107 throw new UnsupportedError("Cannot sort immutable List."); 108 throw new UnsupportedError("Cannot sort immutable List.");
108 } 109 }
109 110
110 int indexOf($E element, [int start = 0]) => 111 int indexOf($E element, [int start = 0]) =>
111 Lists.indexOf(this, element, start, this.length); 112 Lists.indexOf(this, element, start, this.length);
112 113
113 int lastIndexOf($E element, [int start]) { 114 int lastIndexOf($E element, [int start]) {
114 if (start == null) start = length - 1; 115 if (start == null) start = length - 1;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 175 }
175 176
176 void insertRange(int start, int rangeLength, [$E initialValue]) { 177 void insertRange(int start, int rangeLength, [$E initialValue]) {
177 throw new UnsupportedError("Cannot insertRange on immutable List."); 178 throw new UnsupportedError("Cannot insertRange on immutable List.");
178 } 179 }
179 180
180 List<$E> getRange(int start, int rangeLength) => 181 List<$E> getRange(int start, int rangeLength) =>
181 Lists.getRange(this, start, rangeLength, <$E>[]); 182 Lists.getRange(this, start, rangeLength, <$E>[]);
182 183
183 // -- end List<$E> mixins. 184 // -- end List<$E> mixins.
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698