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

Side by Side Diff: sdk/lib/html/templates/immutable_list_mixin.darttemplate

Issue 11269004: Change List.sort to not have a default parameter value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reverted used of ?compare Created 8 years 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
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> iterator() { 6 Iterator<$E> 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 $endif 59 $endif
60 60
61 $if DEFINE_CLEAR 61 $if DEFINE_CLEAR
62 void clear() { 62 void clear() {
63 throw new UnsupportedError("Cannot clear immutable List."); 63 throw new UnsupportedError("Cannot clear immutable List.");
64 } 64 }
65 $else 65 $else
66 // contains() defined by IDL. 66 // contains() defined by IDL.
67 $endif 67 $endif
68 68
69 void sort([Comparator compare = Comparable.compare]) { 69 void sort([int compare($E a, $E b)]) {
70 throw new UnsupportedError("Cannot sort immutable List."); 70 throw new UnsupportedError("Cannot sort immutable List.");
71 } 71 }
72 72
73 int indexOf($E element, [int start = 0]) => 73 int indexOf($E element, [int start = 0]) =>
74 Lists.indexOf(this, element, start, this.length); 74 Lists.indexOf(this, element, start, this.length);
75 75
76 int lastIndexOf($E element, [int start]) { 76 int lastIndexOf($E element, [int start]) {
77 if (start == null) start = length - 1; 77 if (start == null) start = length - 1;
78 return Lists.lastIndexOf(this, element, start); 78 return Lists.lastIndexOf(this, element, start);
79 } 79 }
(...skipping 19 matching lines...) Expand all
99 } 99 }
100 100
101 void insertRange(int start, int rangeLength, [$E initialValue]) { 101 void insertRange(int start, int rangeLength, [$E initialValue]) {
102 throw new UnsupportedError("Cannot insertRange on immutable List."); 102 throw new UnsupportedError("Cannot insertRange on immutable List.");
103 } 103 }
104 104
105 List<$E> getRange(int start, int rangeLength) => 105 List<$E> getRange(int start, int rangeLength) =>
106 Lists.getRange(this, start, rangeLength, <$E>[]); 106 Lists.getRange(this, start, rangeLength, <$E>[]);
107 107
108 // -- end List<$E> mixins. 108 // -- end List<$E> mixins.
OLDNEW
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_Node.darttemplate ('k') | sdk/lib/svg/dart2js/svg_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698