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

Unified Diff: third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart

Issue 24740003: Add List.shuffle(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adddress comments Created 7 years, 3 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 | « tests/corelib/shuffle_test.dart ('k') | tools/dom/src/ImmutableListMixin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart
diff --git a/third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart b/third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart
index 6562aac7812682f690522dad397e79a65d4560f3..617377489183f60b909992e6c39d1dd2c785faf8 100644
--- a/third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart
+++ b/third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart
@@ -52,6 +52,10 @@ class JsArrayToListAdapter<E> extends TypedProxy /*with ListMixin<E>*/ implement
final sortedList = _asList()..sort(compare);
setRange(0, sortedList.length, sortedList);
}
+ @override void shuffle() {
+ final shuffledList = _asList()..shuffle();
+ setRange(0, shuffledList.length, shuffledLength);
+ }
@override void insert(int index, E element) {
$unsafe.splice(index, 0, _toJs(element));
}
« no previous file with comments | « tests/corelib/shuffle_test.dart ('k') | tools/dom/src/ImmutableListMixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698