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

Unified Diff: lib/compiler/implementation/lib/interceptors.dart

Issue 11144016: Make argument of List.sort optional with default Comparable.compare. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/core/list.dart » ('j') | tests/corelib/list_sort_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/interceptors.dart
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart
index ffbd1d9d76b99e85cf27a00f26399fdf6debc4cf..ea48aa8b5bbcfdb838d714a04d3aa766c768870b 100644
--- a/lib/compiler/implementation/lib/interceptors.dart
+++ b/lib/compiler/implementation/lib/interceptors.dart
@@ -358,9 +358,14 @@ every(receiver, f) {
}
}
-sort(receiver, compare) {
- if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare));
+sort$0(receiver) {
+ if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort());
+ checkMutable(receiver, 'sort');
+ DualPivotQuicksort.sort(receiver, Comparable.compare);
+}
+sort$1(receiver, compare) {
ngeoffray 2012/10/15 14:17:12 Why can't you have just one function with an optio
Lasse Reichstein Nielsen 2012/10/17 07:37:28 I don't think it works with how we handle receiver
+ if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare));
checkMutable(receiver, 'sort');
DualPivotQuicksort.sort(receiver, compare);
}
« no previous file with comments | « no previous file | lib/core/list.dart » ('j') | tests/corelib/list_sort_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698