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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_array.dart

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: Updated to tup of tree. 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/lib/js_array.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index a4f069d5170c50aab32eac8b2a25e43aaca00470..b61d76caa9563c6b8c2775dd7ac0f5657891bc19 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -137,8 +137,9 @@ class JSArray<E> implements List<E> {
bool every(bool f(E element)) => Collections.every(this, f);
- void sort([Comparator<E> compare = Comparable.compare]) {
+ void sort([int compare(E a, E b)]) {
checkMutable(this, 'sort');
+ if (!?compare) compare = Comparable.compare;
floitsch 2012/12/05 17:13:02 compare == null
coreSort(this, compare);
}
@@ -173,7 +174,7 @@ class JSArray<E> implements List<E> {
}
int get length => JS('int', r'#.length', this);
-
+
void set length(int newLength) {
if (newLength is !int) throw new ArgumentError(newLength);
if (newLength < 0) throw new RangeError.value(newLength);

Powered by Google App Engine
This is Rietveld 408576698