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

Unified Diff: sdk/lib/async/stream.dart

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing Created 7 years, 6 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
« no previous file with comments | « sdk/lib/_internal/lib/js_array.dart ('k') | sdk/lib/collection/hash_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index c6d7dbf0820b93885cb427502642af0bb3869626..0de29194a517516241b003128471226d06800513 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -312,12 +312,12 @@ abstract class Stream<T> {
}
/**
- * Checks whether [match] occurs in the elements provided by this stream.
+ * Checks whether [needle] occurs in the elements provided by this stream.
*
* Completes the [Future] when the answer is known.
* If this stream reports an error, the [Future] will report that error.
*/
- Future<bool> contains(T match) {
+ Future<bool> contains(Object needle) {
_FutureImpl<bool> future = new _FutureImpl<bool>();
StreamSubscription subscription;
subscription = this.listen(
@@ -325,7 +325,7 @@ abstract class Stream<T> {
// checked mode. http://dartbug.com/7733
(/*T*/ element) {
_runUserCode(
- () => (element == match),
+ () => (element == needle),
(bool isMatch) {
if (isMatch) {
subscription.cancel();
@@ -678,8 +678,8 @@ abstract class Stream<T> {
* with no [defaultValue] function provided, the future will receive an
* error.
*/
- Future<T> firstWhere(bool test(T element), {T defaultValue()}) {
- _FutureImpl<T> future = new _FutureImpl<T>();
+ Future<dynamic> firstWhere(bool test(T element), {Object defaultValue()}) {
+ _FutureImpl<dynamic> future = new _FutureImpl();
StreamSubscription subscription;
subscription = this.listen(
// TODO(ahe): Restore type when feature is implemented in dart2js
@@ -715,8 +715,8 @@ abstract class Stream<T> {
* That means that the result cannot be provided before this stream
* is done.
*/
- Future<T> lastWhere(bool test(T element), {T defaultValue()}) {
- _FutureImpl<T> future = new _FutureImpl<T>();
+ Future<dynamic> lastWhere(bool test(T element), {Object defaultValue()}) {
+ _FutureImpl<dynamic> future = new _FutureImpl();
T result = null;
bool foundResult = false;
StreamSubscription subscription;
« no previous file with comments | « sdk/lib/_internal/lib/js_array.dart ('k') | sdk/lib/collection/hash_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698