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

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

Issue 14071002: Added new version of reduce. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed more uses of max, and a few bugs. Created 7 years, 8 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
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 b53b0be9b675c84078e45f41970f65f229b78016..f796415410208fc215fd82c3b2500a644ee6c413 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -120,8 +120,8 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
return IterableMixinWorkaround.skipWhile(this, test);
}
- reduce(initialValue, combine(previousValue, E element)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ E reduce(E combine(E value, E element)) {
+ return IterableMixinWorkaround.reduce(this, combine);
}
fold(initialValue, combine(previousValue, E element)) {
@@ -212,10 +212,6 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
throw new StateError("More than one element");
}
- E min([int compare(E a, E b)]) => IterableMixinWorkaround.min(this, compare);
-
- E max([int compare(E a, E b)]) => IterableMixinWorkaround.max(this, compare);
-
void removeRange(int start, int length) {
checkGrowable(this, 'removeRange');
if (length == 0) {

Powered by Google App Engine
This is Rietveld 408576698