floitsch@google.com
2013-02-15 13:57:18 +00:00
parent ad839e6957
commit 0672317bec
26 changed files with 9 additions and 352 deletions
+1 -1
View File
@@ -35,5 +35,5 @@ class ByteStream extends StreamView<List<int>> {
toBytes().then((bytes) => decodeString(bytes, encoding));
Stream<String> toStringStream([Encoding encoding=Encoding.UTF_8]) =>
wrapStream(mappedBy((bytes) => decodeString(bytes, encoding)));
wrapStream(map((bytes) => decodeString(bytes, encoding)));
}
+1 -1
View File
@@ -216,7 +216,7 @@ class SimpleJsonFormat extends Format {
} else {
throw new SerializationException("Invalid data format");
}
// Do not use mappedBy or other lazy operations for this. They do not play
// Do not use map or other lazy operations for this. They do not play
// well with a function that destructively modifies its arguments.
var newData = mapValues(data, (each) => recursivelyFixUp(each, r, result));
result[ruleNumber].add(newData);
-8
View File
@@ -104,10 +104,6 @@ class _ObjectArray<E> implements List<E> {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(E element)) {
IterableMixinWorkaround.mappedByList(this, f);
}
reduce(initialValue, combine(previousValue, E element)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
@@ -338,10 +334,6 @@ class _ImmutableArray<E> implements List<E> {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(E element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
String join([String separator]) {
return IterableMixinWorkaround.joinList(this, separator);
}
-4
View File
@@ -233,10 +233,6 @@ abstract class _ByteArrayBase {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(int element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
String join([String separator]) {
return IterableMixinWorkaround.join(this, separator);
}
-4
View File
@@ -246,10 +246,6 @@ class _GrowableObjectArray<T> implements List<T> {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(T element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
reduce(initialValue, combine(previousValue, T element)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
-4
View File
@@ -197,8 +197,6 @@ abstract class ListIterable<E> extends Iterable<E> {
Iterable map(f(E element)) => new MappedIterable(this, f);
Iterable mappedBy(f(E element)) => super.mappedBy(f);
reduce(var initialValue, combine(var previousValue, E element)) {
var value = initialValue;
int length = this.length;
@@ -663,8 +661,6 @@ class EmptyIterable<E> extends Iterable<E> {
Iterable map(f(E element)) => const EmptyIterable();
Iterable mappedBy(f(E element)) => const EmptyIterable();
reduce(var initialValue, combine(var previousValue, E element)) {
return initialValue;
}
-16
View File
@@ -97,10 +97,6 @@ abstract class ListBase<E> extends Collection<E> implements List<E> {
return new MappedIterable(this, f);
}
List mappedBy(f(E element)) {
return new MappedList(this, f);
}
Iterable<E> take(int n) {
return new SubListIterable(this, 0, n);
}
@@ -286,18 +282,6 @@ abstract class UnmodifiableListBase<E> extends ListBase<E> {
}
}
class MappedList<S, T> extends UnmodifiableListBase<T> {
final List<S> _list;
// TODO(ahe): Restore type when feature is implemented in dart2js
// checked mode. http://dartbug.com/7733
final /* _Transformation<S, T> */ _f;
MappedList(this._list, T this._f(S element));
T operator[](int index) => _f(_list[index]);
int get length => _list.length;
}
/** An empty fixed-length list. */
class EmptyList<E> extends FixedLengthListBase<E> {
int get length => 0;
@@ -92,10 +92,6 @@ class JSArray<E> implements List<E> {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(E element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
String join([String separator]) {
if (separator == null) separator = "";
var list = new List(this.length);
-7
View File
@@ -133,13 +133,6 @@ abstract class Stream<T> {
return new _MapStream<T, dynamic>(this, convert);
}
/**
* Deprecated alias for [map].
*
* @deprecated
*/
Stream mappedBy(f(T element)) => map(f);
/**
* Create a wrapper Stream that intercepts some errors from this stream.
*
-10
View File
@@ -321,11 +321,6 @@ class IterableMixinWorkaround {
return new MappedListIterable(list, f);
}
static List mappedByList(List list, f(var element)) {
// This is currently a List as well as an Iterable.
return new MappedList(list, f);
}
static Iterable expand(Iterable iterable, Iterable f(var element)) {
return new ExpandIterable(iterable, f);
}
@@ -472,11 +467,6 @@ class Collections {
static Iterable where(Iterable iterable, bool f(var element))
=> IterableMixinWorkaround.where(iterable, f);
/** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/
@deprecated
static List mappedByList(List list, f(var element))
=> IterableMixinWorkaround.mappedByList(list, f);
/** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/
@deprecated
static Iterable takeList(List list, int n)
-6
View File
@@ -50,12 +50,6 @@ abstract class Iterable<E> {
*/
Iterable map(f(E element)) => new MappedIterable<E, dynamic>(this, f);
/**
* Deprecated alias for [map].
*/
@deprecated
Iterable mappedBy(f(E element)) => map(f);
/**
* Returns a lazy [Iterable] with all elements that satisfy the
* predicate [f].
-113
View File
@@ -7197,9 +7197,6 @@ class DomMimeTypeArray implements JavaScriptIndexingBehavior, List<DomMimeType>
Iterable map(f(DomMimeType element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(DomMimeType element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<DomMimeType> where(bool f(DomMimeType element)) =>
IterableMixinWorkaround.where(this, f);
@@ -7454,9 +7451,6 @@ class DomPluginArray implements JavaScriptIndexingBehavior, List<DomPlugin> nati
Iterable map(f(DomPlugin element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(DomPlugin element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<DomPlugin> where(bool f(DomPlugin element)) =>
IterableMixinWorkaround.where(this, f);
@@ -7818,9 +7812,6 @@ class DomStringList implements JavaScriptIndexingBehavior, List<String> native "
Iterable map(f(String element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(String element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<String> where(bool f(String element)) =>
IterableMixinWorkaround.where(this, f);
@@ -8081,10 +8072,6 @@ class _ChildrenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -8306,10 +8293,6 @@ class _FrozenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -10660,9 +10643,6 @@ class FileList implements JavaScriptIndexingBehavior, List<File> native "*FileLi
Iterable map(f(File element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(File element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<File> where(bool f(File element)) =>
IterableMixinWorkaround.where(this, f);
@@ -11220,9 +11200,6 @@ class Float32Array extends ArrayBufferView implements JavaScriptIndexingBehavior
Iterable map(f(num element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(num element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<num> where(bool f(num element)) =>
IterableMixinWorkaround.where(this, f);
@@ -11439,9 +11416,6 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
Iterable map(f(num element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(num element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<num> where(bool f(num element)) =>
IterableMixinWorkaround.where(this, f);
@@ -11967,9 +11941,6 @@ class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -12177,9 +12148,6 @@ class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "*
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -14199,9 +14167,6 @@ class Int16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -14418,9 +14383,6 @@ class Int32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -14637,9 +14599,6 @@ class Int8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, L
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -17143,10 +17102,6 @@ class _ChildNodeListLazy implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Node element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Node> where(bool f(Node element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -17538,9 +17493,6 @@ class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -19856,9 +19808,6 @@ class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior
Iterable map(f(SourceBuffer element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SourceBuffer element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
IterableMixinWorkaround.where(this, f);
@@ -20139,9 +20088,6 @@ class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGramma
Iterable map(f(SpeechGrammar element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechGrammar element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
IterableMixinWorkaround.where(this, f);
@@ -20710,9 +20656,6 @@ class SqlResultSetRowList implements JavaScriptIndexingBehavior, List<Map> nativ
Iterable map(f(Map element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Map element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Map> where(bool f(Map element)) =>
IterableMixinWorkaround.where(this, f);
@@ -21796,9 +21739,6 @@ class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior
Iterable map(f(TextTrackCue element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(TextTrackCue element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
IterableMixinWorkaround.where(this, f);
@@ -22004,9 +21944,6 @@ class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L
Iterable map(f(TextTrack element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(TextTrack element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<TextTrack> where(bool f(TextTrack element)) =>
IterableMixinWorkaround.where(this, f);
@@ -22419,9 +22356,6 @@ class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
Iterable map(f(Touch element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Touch element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Touch> where(bool f(Touch element)) =>
IterableMixinWorkaround.where(this, f);
@@ -22868,9 +22802,6 @@ class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -23087,9 +23018,6 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -23306,9 +23234,6 @@ class Uint8Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -23522,9 +23447,6 @@ class Uint8ClampedArray extends Uint8Array implements JavaScriptIndexingBehavior
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -27241,9 +27163,6 @@ class _ClientRectList implements JavaScriptIndexingBehavior, List<ClientRect> na
Iterable map(f(ClientRect element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(ClientRect element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<ClientRect> where(bool f(ClientRect element)) =>
IterableMixinWorkaround.where(this, f);
@@ -27441,9 +27360,6 @@ class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native "
Iterable map(f(CssRule element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(CssRule element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<CssRule> where(bool f(CssRule element)) =>
IterableMixinWorkaround.where(this, f);
@@ -27641,9 +27557,6 @@ class _CssValueList extends CssValue implements List<CssValue>, JavaScriptIndexi
Iterable map(f(CssValue element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(CssValue element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<CssValue> where(bool f(CssValue element)) =>
IterableMixinWorkaround.where(this, f);
@@ -27841,9 +27754,6 @@ class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "*En
Iterable map(f(Entry element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Entry element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Entry> where(bool f(Entry element)) =>
IterableMixinWorkaround.where(this, f);
@@ -28041,9 +27951,6 @@ class _EntryArraySync implements JavaScriptIndexingBehavior, List<EntrySync> nat
Iterable map(f(EntrySync element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(EntrySync element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<EntrySync> where(bool f(EntrySync element)) =>
IterableMixinWorkaround.where(this, f);
@@ -28241,9 +28148,6 @@ class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native "
Iterable map(f(Gamepad element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Gamepad element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Gamepad> where(bool f(Gamepad element)) =>
IterableMixinWorkaround.where(this, f);
@@ -28504,9 +28408,6 @@ class _MediaStreamList implements JavaScriptIndexingBehavior, List<MediaStream>
Iterable map(f(MediaStream element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(MediaStream element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<MediaStream> where(bool f(MediaStream element)) =>
IterableMixinWorkaround.where(this, f);
@@ -28704,9 +28605,6 @@ class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "*N
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -28928,9 +28826,6 @@ class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechI
Iterable map(f(SpeechInputResult element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechInputResult element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechInputResult> where(bool f(SpeechInputResult element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29128,9 +29023,6 @@ class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<S
Iterable map(f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechRecognitionResult> where(bool f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29328,9 +29220,6 @@ class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> na
Iterable map(f(StyleSheet element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(StyleSheet element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<StyleSheet> where(bool f(StyleSheet element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29903,8 +29792,6 @@ abstract class CssClassSet implements Set<String> {
Iterable map(f(String element)) => readClasses().map(f);
Iterable mappedBy(f(String element)) => readClasses().mappedBy(f);
Iterable<String> where(bool f(String element)) => readClasses().where(f);
Iterable expand(Iterable f(String element)) => readClasses.expand(f);
-113
View File
@@ -7898,9 +7898,6 @@ class DomMimeTypeArray extends NativeFieldWrapperClass1 implements List<DomMimeT
Iterable map(f(DomMimeType element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(DomMimeType element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<DomMimeType> where(bool f(DomMimeType element)) =>
IterableMixinWorkaround.where(this, f);
@@ -8169,9 +8166,6 @@ class DomPluginArray extends NativeFieldWrapperClass1 implements List<DomPlugin>
Iterable map(f(DomPlugin element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(DomPlugin element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<DomPlugin> where(bool f(DomPlugin element)) =>
IterableMixinWorkaround.where(this, f);
@@ -8558,9 +8552,6 @@ class DomStringList extends NativeFieldWrapperClass1 implements List<String> {
Iterable map(f(String element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(String element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<String> where(bool f(String element)) =>
IterableMixinWorkaround.where(this, f);
@@ -8842,10 +8833,6 @@ class _ChildrenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -9067,10 +9054,6 @@ class _FrozenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -11396,9 +11379,6 @@ class FileList extends NativeFieldWrapperClass1 implements List<File> {
Iterable map(f(File element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(File element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<File> where(bool f(File element)) =>
IterableMixinWorkaround.where(this, f);
@@ -12010,9 +11990,6 @@ class Float32Array extends ArrayBufferView implements List<num> {
Iterable map(f(num element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(num element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<num> where(bool f(num element)) =>
IterableMixinWorkaround.where(this, f);
@@ -12248,9 +12225,6 @@ class Float64Array extends ArrayBufferView implements List<num> {
Iterable map(f(num element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(num element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<num> where(bool f(num element)) =>
IterableMixinWorkaround.where(this, f);
@@ -12846,9 +12820,6 @@ class HtmlAllCollection extends NativeFieldWrapperClass1 implements List<Node> {
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -13058,9 +13029,6 @@ class HtmlCollection extends NativeFieldWrapperClass1 implements List<Node> {
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -15419,9 +15387,6 @@ class Int16Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -15657,9 +15622,6 @@ class Int32Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -15895,9 +15857,6 @@ class Int8Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -18680,10 +18639,6 @@ class _ChildNodeListLazy implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Node element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Node> where(bool f(Node element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -19072,9 +19027,6 @@ class NodeList extends NativeFieldWrapperClass1 implements List<Node> {
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -21697,9 +21649,6 @@ class SourceBufferList extends EventTarget implements List<SourceBuffer> {
Iterable map(f(SourceBuffer element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SourceBuffer element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
IterableMixinWorkaround.where(this, f);
@@ -22018,9 +21967,6 @@ class SpeechGrammarList extends NativeFieldWrapperClass1 implements List<SpeechG
Iterable map(f(SpeechGrammar element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechGrammar element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
IterableMixinWorkaround.where(this, f);
@@ -22676,9 +22622,6 @@ class SqlResultSetRowList extends NativeFieldWrapperClass1 implements List<Map>
Iterable map(f(Map element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Map element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Map> where(bool f(Map element)) =>
IterableMixinWorkaround.where(this, f);
@@ -23998,9 +23941,6 @@ class TextTrackCueList extends NativeFieldWrapperClass1 implements List<TextTrac
Iterable map(f(TextTrackCue element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(TextTrackCue element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
IterableMixinWorkaround.where(this, f);
@@ -24210,9 +24150,6 @@ class TextTrackList extends EventTarget implements List<TextTrack> {
Iterable map(f(TextTrack element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(TextTrack element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<TextTrack> where(bool f(TextTrack element)) =>
IterableMixinWorkaround.where(this, f);
@@ -24629,9 +24566,6 @@ class TouchList extends NativeFieldWrapperClass1 implements List<Touch> {
Iterable map(f(Touch element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Touch element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Touch> where(bool f(Touch element)) =>
IterableMixinWorkaround.where(this, f);
@@ -25123,9 +25057,6 @@ class Uint16Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -25361,9 +25292,6 @@ class Uint32Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -25599,9 +25527,6 @@ class Uint8Array extends ArrayBufferView implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -25835,9 +25760,6 @@ class Uint8ClampedArray extends Uint8Array implements List<int> {
Iterable map(f(int element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(int element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<int> where(bool f(int element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29513,9 +29435,6 @@ class _ClientRectList extends NativeFieldWrapperClass1 implements List<ClientRec
Iterable map(f(ClientRect element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(ClientRect element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<ClientRect> where(bool f(ClientRect element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29717,9 +29636,6 @@ class _CssRuleList extends NativeFieldWrapperClass1 implements List<CssRule> {
Iterable map(f(CssRule element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(CssRule element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<CssRule> where(bool f(CssRule element)) =>
IterableMixinWorkaround.where(this, f);
@@ -29921,9 +29837,6 @@ class _CssValueList extends CssValue implements List<CssValue> {
Iterable map(f(CssValue element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(CssValue element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<CssValue> where(bool f(CssValue element)) =>
IterableMixinWorkaround.where(this, f);
@@ -30268,9 +30181,6 @@ class _EntryArray extends NativeFieldWrapperClass1 implements List<Entry> {
Iterable map(f(Entry element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Entry element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Entry> where(bool f(Entry element)) =>
IterableMixinWorkaround.where(this, f);
@@ -30472,9 +30382,6 @@ class _EntryArraySync extends NativeFieldWrapperClass1 implements List<EntrySync
Iterable map(f(EntrySync element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(EntrySync element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<EntrySync> where(bool f(EntrySync element)) =>
IterableMixinWorkaround.where(this, f);
@@ -30676,9 +30583,6 @@ class _GamepadList extends NativeFieldWrapperClass1 implements List<Gamepad> {
Iterable map(f(Gamepad element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Gamepad element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Gamepad> where(bool f(Gamepad element)) =>
IterableMixinWorkaround.where(this, f);
@@ -30971,9 +30875,6 @@ class _MediaStreamList extends NativeFieldWrapperClass1 implements List<MediaStr
Iterable map(f(MediaStream element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(MediaStream element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<MediaStream> where(bool f(MediaStream element)) =>
IterableMixinWorkaround.where(this, f);
@@ -31175,9 +31076,6 @@ class _NamedNodeMap extends NativeFieldWrapperClass1 implements List<Node> {
Iterable map(f(Node element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Node element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Node> where(bool f(Node element)) =>
IterableMixinWorkaround.where(this, f);
@@ -31403,9 +31301,6 @@ class _SpeechInputResultList extends NativeFieldWrapperClass1 implements List<Sp
Iterable map(f(SpeechInputResult element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechInputResult element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechInputResult> where(bool f(SpeechInputResult element)) =>
IterableMixinWorkaround.where(this, f);
@@ -31607,9 +31502,6 @@ class _SpeechRecognitionResultList extends NativeFieldWrapperClass1 implements L
Iterable map(f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<SpeechRecognitionResult> where(bool f(SpeechRecognitionResult element)) =>
IterableMixinWorkaround.where(this, f);
@@ -31811,9 +31703,6 @@ class _StyleSheetList extends NativeFieldWrapperClass1 implements List<StyleShee
Iterable map(f(StyleSheet element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(StyleSheet element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<StyleSheet> where(bool f(StyleSheet element)) =>
IterableMixinWorkaround.where(this, f);
@@ -32388,8 +32277,6 @@ abstract class CssClassSet implements Set<String> {
Iterable map(f(String element)) => readClasses().map(f);
Iterable mappedBy(f(String element)) => readClasses().mappedBy(f);
Iterable<String> where(bool f(String element)) => readClasses().where(f);
Iterable expand(Iterable f(String element)) => readClasses.expand(f);
@@ -102,7 +102,6 @@ class FilteredElementList implements List {
}
Iterable map(f(Element element)) => _filtered.map(f);
List mappedBy(f(Element element)) => _filtered.mappedBy(f);
Iterable<Element> where(bool f(Element element)) => _filtered.where(f);
Iterable expand(Iterable f(Element element)) => _filtered.expand(f);
-18
View File
@@ -3082,9 +3082,6 @@ class LengthList implements JavaScriptIndexingBehavior, List<Length> native "*SV
Iterable map(f(Length element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Length element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Length> where(bool f(Length element)) =>
IterableMixinWorkaround.where(this, f);
@@ -3709,9 +3706,6 @@ class NumberList implements JavaScriptIndexingBehavior, List<Number> native "*SV
Iterable map(f(Number element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Number element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Number> where(bool f(Number element)) =>
IterableMixinWorkaround.where(this, f);
@@ -4612,9 +4606,6 @@ class PathSegList implements JavaScriptIndexingBehavior, List<PathSeg> native "*
Iterable map(f(PathSeg element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(PathSeg element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<PathSeg> where(bool f(PathSeg element)) =>
IterableMixinWorkaround.where(this, f);
@@ -5499,9 +5490,6 @@ class StringList implements JavaScriptIndexingBehavior, List<String> native "*SV
Iterable map(f(String element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(String element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<String> where(bool f(String element)) =>
IterableMixinWorkaround.where(this, f);
@@ -6665,9 +6653,6 @@ class TransformList implements List<Transform>, JavaScriptIndexingBehavior nativ
Iterable map(f(Transform element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Transform element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Transform> where(bool f(Transform element)) =>
IterableMixinWorkaround.where(this, f);
@@ -7185,9 +7170,6 @@ class _ElementInstanceList implements JavaScriptIndexingBehavior, List<ElementIn
Iterable map(f(ElementInstance element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(ElementInstance element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<ElementInstance> where(bool f(ElementInstance element)) =>
IterableMixinWorkaround.where(this, f);
-18
View File
@@ -3346,9 +3346,6 @@ class LengthList extends NativeFieldWrapperClass1 implements List<Length> {
Iterable map(f(Length element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Length element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Length> where(bool f(Length element)) =>
IterableMixinWorkaround.where(this, f);
@@ -4050,9 +4047,6 @@ class NumberList extends NativeFieldWrapperClass1 implements List<Number> {
Iterable map(f(Number element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Number element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Number> where(bool f(Number element)) =>
IterableMixinWorkaround.where(this, f);
@@ -5230,9 +5224,6 @@ class PathSegList extends NativeFieldWrapperClass1 implements List<PathSeg> {
Iterable map(f(PathSeg element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(PathSeg element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<PathSeg> where(bool f(PathSeg element)) =>
IterableMixinWorkaround.where(this, f);
@@ -6215,9 +6206,6 @@ class StringList extends NativeFieldWrapperClass1 implements List<String> {
Iterable map(f(String element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(String element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<String> where(bool f(String element)) =>
IterableMixinWorkaround.where(this, f);
@@ -7470,9 +7458,6 @@ class TransformList extends NativeFieldWrapperClass1 implements List<Transform>
Iterable map(f(Transform element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(Transform element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<Transform> where(bool f(Transform element)) =>
IterableMixinWorkaround.where(this, f);
@@ -8044,9 +8029,6 @@ class _ElementInstanceList extends NativeFieldWrapperClass1 implements List<Elem
Iterable map(f(ElementInstance element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f(ElementInstance element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<ElementInstance> where(bool f(ElementInstance element)) =>
IterableMixinWorkaround.where(this, f);
+1 -1
View File
@@ -66,7 +66,7 @@ main() {
expect(classes, unorderedEquals(['foo', 'bar', 'baz']));
});
test('mappedBy', () {
test('map', () {
expect(makeClassSet().map((c) => c.toUpperCase()).toList(),
unorderedEquals(['FOO', 'BAR', 'BAZ']));
});
+1 -1
View File
@@ -537,7 +537,7 @@ main() {
expect(els[2], isHRElement);
});
test('mappedBy', () {
test('map', () {
var texts = getQueryAll().map((el) => el.text).toList();
expect(texts, equals(['Dart!', 'Hello', '']));
});
+1 -1
View File
@@ -191,7 +191,7 @@ main() {
stream.where((_) => true).listen((_) {});
});
test('mappedBy', () {
test('map', () {
stream.map((_) => null).listen((_) {});
});
@@ -439,7 +439,7 @@ testRethrow() {
}
testStream("where", (s, act) => s.where(act));
testStream("mappedBy", (s, act) => s.map(act));
testStream("map", (s, act) => s.map(act));
testStream("expand", (s, act) => s.expand(act));
testStream("where", (s, act) => s.where(act));
testStreamError("handleError", (s, act) => s.handleError(act));
-2
View File
@@ -46,8 +46,6 @@ abstract class CssClassSet implements Set<String> {
Iterable map(f(String element)) => readClasses().map(f);
Iterable mappedBy(f(String element)) => readClasses().mappedBy(f);
Iterable<String> where(bool f(String element)) => readClasses().where(f);
Iterable expand(Iterable f(String element)) => readClasses.expand(f);
@@ -65,10 +65,6 @@ class _ChildrenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -290,10 +286,6 @@ class _FrozenElementList implements List {
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Element element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Element> where(bool f(Element element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -145,10 +145,6 @@ $endif
return IterableMixinWorkaround.mapList(this, f);
}
List mappedBy(f(Node element)) {
return IterableMixinWorkaround.mappedByList(this, f);
}
Iterable<Node> where(bool f(Node element)) {
return IterableMixinWorkaround.where(this, f);
}
@@ -32,9 +32,6 @@ $endif
Iterable map(f($E element)) =>
IterableMixinWorkaround.mapList(this, f);
List mappedBy(f($E element)) =>
IterableMixinWorkaround.mappedByList(this, f);
Iterable<$E> where(bool f($E element)) =>
IterableMixinWorkaround.where(this, f);
+2 -2
View File
@@ -274,13 +274,13 @@ Stream wrapStream(Stream stream) {
/// Like [Iterable.where], but allows [test] to return [Future]s and uses the
/// results of those [Future]s as the test.
Future<Iterable> futureWhere(Iterable iter, test(value)) {
return Future.wait(iter.mappedBy((e) {
return Future.wait(iter.map((e) {
var result = test(e);
if (result is! Future) result = new Future.immediate(result);
return result.then((result) => new Pair(e, result));
}))
.then((pairs) => pairs.where((pair) => pair.last))
.then((pairs) => pairs.mappedBy((pair) => pair.first));
.then((pairs) => pairs.map((pair) => pair.first));
}
// TODO(nweiz): unify the following functions with the utility functions in
+1 -1
View File
@@ -7,7 +7,7 @@
// TODO(jmesserly): we might want a version of this that return an iterable,
// however JS, Python and Ruby versions are all eager.
List mappedBy(Iterable source, mapper(source)) {
List map(Iterable source, mapper(source)) {
List result = new List();
if (source is List) {
List list = source; // TODO: shouldn't need this