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

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: Fix type error. 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
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index bff0435af274aef86df2fb9a4f2bcb14d61df57c..f52fd84519be7e2660e7bf990f6087a4d10234be 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -307,12 +307,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(
@@ -320,7 +320,7 @@ abstract class Stream<T> {
// checked mode. http://dartbug.com/7733
(/*T*/ element) {
_runUserCode(
- () => (element == match),
+ () => (element == needle),
(bool isMatch) {
if (isMatch) {
subscription.cancel();

Powered by Google App Engine
This is Rietveld 408576698