mirror of
https://github.com/dart-lang/sdk
synced 2024-10-01 19:14:49 +00:00
Forward drain
argument through after .take(0)
Fixes #30305 Change-Id: I7a30cee3e9a406e99f5d714a201b031c428a12e8 Reviewed-on: https://dart-review.googlesource.com/74015 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This commit is contained in:
parent
bf68afbaa9
commit
3c4a86c709
|
@ -21,6 +21,11 @@
|
|||
succeed.
|
||||
* Exported `Future` and `Stream` from `dart:core`.
|
||||
|
||||
#### `dart:async`
|
||||
|
||||
* Fix a bug where calling `stream.take(0).drain(value)` would not correctly
|
||||
forward the `value` through the returned `Future`.
|
||||
|
||||
## 2.1.0-dev.3.0
|
||||
|
||||
### Core library changes
|
||||
|
|
|
@ -766,7 +766,7 @@ class _DoneStreamSubscription<T> implements StreamSubscription<T> {
|
|||
Future<E> asFuture<E>([E futureValue]) {
|
||||
_Future<E> result = new _Future<E>();
|
||||
_onDone = () {
|
||||
result._completeWithValue(null);
|
||||
result._completeWithValue(futureValue);
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,9 @@ tests() async {
|
|||
Expect.listEquals([], await makeStream(5).take(0).toList());
|
||||
|
||||
Expect.listEquals([], await makeStream(0).take(0).toList());
|
||||
|
||||
// Regression for https://github.com/dart-lang/sdk/issues/30305
|
||||
Expect.equals('result', await makeStream(5).take(0).drain('result'));
|
||||
}
|
||||
|
||||
Future expectThrowsAsync(Future computation, String name) {
|
||||
|
|
Loading…
Reference in a new issue