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

Side by Side Diff: sdk/lib/async/stream.dart

Issue 12086062: Rename mappedBy to map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo change to test-script. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/dartdoc.dart ('k') | sdk/lib/collection/collections.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.async; 5 part of dart.async;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 * but it only sends the data events that satisfy the [test]. 122 * but it only sends the data events that satisfy the [test].
123 */ 123 */
124 Stream<T> where(bool test(T event)) { 124 Stream<T> where(bool test(T event)) {
125 return new _WhereStream<T>(this, test); 125 return new _WhereStream<T>(this, test);
126 } 126 }
127 127
128 /** 128 /**
129 * Create a new stream that converts each element of this stream 129 * Create a new stream that converts each element of this stream
130 * to a new value using the [convert] function. 130 * to a new value using the [convert] function.
131 */ 131 */
132 Stream mappedBy(convert(T event)) { 132 Stream map(convert(T event)) {
133 return new _MapStream<T, dynamic>(this, convert); 133 return new _MapStream<T, dynamic>(this, convert);
134 } 134 }
135 135
136 /** 136 /**
137 * Deprecated alias for [map].
138 *
139 * @deprecated
140 */
141 Stream mappedBy(f(E element)) => map(f);
142
143 /**
137 * Create a wrapper Stream that intercepts some errors from this stream. 144 * Create a wrapper Stream that intercepts some errors from this stream.
138 * 145 *
139 * If this stream sends an error that matches [test], then it is intercepted 146 * If this stream sends an error that matches [test], then it is intercepted
140 * by the [handle] function. 147 * by the [handle] function.
141 * 148 *
142 * An [AsyncError] [:e:] is matched by a test function if [:test(e):] returns 149 * An [AsyncError] [:e:] is matched by a test function if [:test(e):] returns
143 * true. If [test] is omitted, every error is considered matching. 150 * true. If [test] is omitted, every error is considered matching.
144 * 151 *
145 * If the error is intercepted, the [handle] function can decide what to do 152 * If the error is intercepted, the [handle] function can decide what to do
146 * with it. It can throw if it wants to raise a new (or the same) error, 153 * with it. It can throw if it wants to raise a new (or the same) error,
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 } 1111 }
1105 1112
1106 class _StreamOutputSinkWrapper<T> implements StreamSink<T> { 1113 class _StreamOutputSinkWrapper<T> implements StreamSink<T> {
1107 _StreamOutputSink _sink; 1114 _StreamOutputSink _sink;
1108 _StreamOutputSinkWrapper(this._sink); 1115 _StreamOutputSinkWrapper(this._sink);
1109 1116
1110 void add(T data) => _sink._sendData(data); 1117 void add(T data) => _sink._sendData(data);
1111 void signalError(AsyncError error) => _sink._sendError(error); 1118 void signalError(AsyncError error) => _sink._sendError(error);
1112 void close() => _sink._sendDone(); 1119 void close() => _sink._sendDone();
1113 } 1120 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/dartdoc.dart ('k') | sdk/lib/collection/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698