| Index: runtime/lib/typed_data.dart
|
| diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
|
| index 0df6950a0a4aecb9ab24a11644f1814df232e740..b8c61682eb5e1fe6f0bfc643bfe7f21ff7767c41 100644
|
| --- a/runtime/lib/typed_data.dart
|
| +++ b/runtime/lib/typed_data.dart
|
| @@ -241,7 +241,7 @@ patch class ByteData {
|
|
|
| // Based class for _TypedList that provides common methods for implementing
|
| // the collection and list interfaces.
|
| -
|
| +// TODO(13647): Make this extends ListBase<T>
|
| abstract class _TypedListBase {
|
|
|
| // Method(s) implementing the Collection interface.
|
| @@ -254,10 +254,6 @@ abstract class _TypedListBase {
|
| }
|
| }
|
|
|
| - Iterable map(f(element)) {
|
| - return IterableMixinWorkaround.mapList(this, f);
|
| - }
|
| -
|
| String join([String separator = ""]) {
|
| return IterableMixinWorkaround.join(this, separator);
|
| }
|
| @@ -271,30 +267,48 @@ abstract class _TypedListBase {
|
| return IterableMixinWorkaround.fold(this, initialValue, combine);
|
| }
|
|
|
| - Iterable where(bool f(element)) {
|
| - return IterableMixinWorkaround.where(this, f);
|
| + Iterable map(f(element)) {
|
| + return IterableMixinWorkaround.mapList(this, f);
|
| }
|
|
|
| Iterable expand(Iterable f(element)) {
|
| return IterableMixinWorkaround.expand(this, f);
|
| }
|
|
|
| + // The following methods need to know the element type (int or double).
|
| + Iterable where(bool f(element)) {
|
| + return new IterableMixinWorkaround().where(this, f);
|
| + }
|
| +
|
| Iterable take(int n) {
|
| - return IterableMixinWorkaround.takeList(this, n);
|
| + return new IterableMixinWorkaround().takeList(this, n);
|
| }
|
|
|
| Iterable takeWhile(bool test(element)) {
|
| - return IterableMixinWorkaround.takeWhile(this, test);
|
| + return new IterableMixinWorkaround().takeWhile(this, test);
|
| }
|
|
|
| Iterable skip(int n) {
|
| - return IterableMixinWorkaround.skipList(this, n);
|
| + return new IterableMixinWorkaround().skipList(this, n);
|
| }
|
|
|
| Iterable skipWhile(bool test(element)) {
|
| - return IterableMixinWorkaround.skipWhile(this, test);
|
| + return new IterableMixinWorkaround().skipWhile(this, test);
|
| }
|
|
|
| + Iterable<dynamic> get reversed {
|
| + return new IterableMixinWorkaround().reversedList(this);
|
| + }
|
| +
|
| + Map<int, dynamic> asMap() {
|
| + return new IterableMixinWorkaround().asMapList(this);
|
| + }
|
| +
|
| + Iterable getRange(int start, [int end]) {
|
| + return new IterableMixinWorkaround().getRangeList(this, start, end);
|
| + }
|
| + // End of methods returning incorrectly parameterized types.
|
| +
|
| bool every(bool f(element)) {
|
| return IterableMixinWorkaround.every(this, f);
|
| }
|
| @@ -315,10 +329,6 @@ abstract class _TypedListBase {
|
| return IterableMixinWorkaround.singleWhere(this, test);
|
| }
|
|
|
| - Iterable<dynamic> get reversed {
|
| - return IterableMixinWorkaround.reversedList(this);
|
| - }
|
| -
|
| dynamic elementAt(int index) {
|
| return this[index];
|
| }
|
| @@ -436,10 +446,6 @@ abstract class _TypedListBase {
|
| return new Set.from(this);
|
| }
|
|
|
| - Map<int, dynamic> asMap() {
|
| - return IterableMixinWorkaround.asMapList(this);
|
| - }
|
| -
|
| List sublist(int start, [int end]) {
|
| if (end == null) end = this.length;
|
| int length = end - start;
|
| @@ -449,10 +455,6 @@ abstract class _TypedListBase {
|
| return result;
|
| }
|
|
|
| - Iterable getRange(int start, [int end]) {
|
| - return IterableMixinWorkaround.getRangeList(this, start, end);
|
| - }
|
| -
|
| void setRange(int start, int end, Iterable from, [int skipCount = 0]) {
|
| // Check ranges.
|
| if ((start < 0) || (start > length)) {
|
|
|