Add stubs for new Dart 2.0 Iterable methods to Link.

See https://github.com/dart-lang/sdk/issues/31664 for more detail on
the core library changes.

Bug:
Change-Id: Id67b60b12a1a47f121ca40f7ee146516a4ac51ee
Reviewed-on: https://dart-review.googlesource.com/29940
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
This commit is contained in:
Leaf Petersen 2017-12-20 17:08:02 +00:00 committed by commit-bot@chromium.org
parent 55d13097e0
commit 36057d82fa

View file

@ -127,6 +127,7 @@ class Link<T> implements Iterable<T> {
// Unsupported Iterable<T> methods.
//
bool any(bool f(T e)) => _unsupported('any');
Iterable<T> cast<T>() => _unsupported('cast');
T elementAt(int i) => _unsupported('elementAt');
Iterable<K> expand<K>(Iterable<K> f(T e)) => _unsupported('expand');
T firstWhere(bool f(T e), {T orElse()}) => _unsupported('firstWhere');
@ -134,15 +135,18 @@ class Link<T> implements Iterable<T> {
return _unsupported('fold');
}
Iterable<T> followedBy(Iterable<T> other) => _unsupported('followedBy');
T get last => _unsupported('get:last');
T lastWhere(bool f(T e), {T orElse()}) => _unsupported('lastWhere');
String join([separator = '']) => _unsupported('join');
T reduce(T combine(T a, T b)) => _unsupported('reduce');
T singleWhere(bool f(T e)) => _unsupported('singleWhere');
Iterable<T> retype<T>() => _unsupported('retype');
T singleWhere(bool f(T e), {T orElse()}) => _unsupported('singleWhere');
Iterable<T> skipWhile(bool f(T e)) => _unsupported('skipWhile');
Iterable<T> take(int n) => _unsupported('take');
Iterable<T> takeWhile(bool f(T e)) => _unsupported('takeWhile');
Set<T> toSet() => _unsupported('toSet');
Iterable<T> whereType<T>() => _unsupported('whereType');
Iterable<T> where(bool f(T e)) => _unsupported('where');
_unsupported(String method) => throw new UnsupportedError(method);