Index: sdk/lib/_internal/pub/lib/src/utils.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart |
index d5210f3d57887889592f05027c36bc629c77ef17..f2706c2064312fd1117c476a68883b5eecdc5eee 100644 |
--- a/sdk/lib/_internal/pub/lib/src/utils.dart |
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart |
@@ -183,14 +183,13 @@ Future streamFirst(Stream stream) { |
/// Returns a wrapped version of [stream] along with a [StreamSubscription] that |
/// can be used to control the wrapped stream. |
Pair<Stream, StreamSubscription> streamWithSubscription(Stream stream) { |
- var controller = new StreamController(sync: true); |
- var controllerStream = stream.isBroadcast ? |
- controller.stream.asBroadcastStream() : |
- controller.stream; |
+ var controller = |
+ stream.isBroadcast ? new StreamController.broadcast(sync: true) |
+ : new StreamController(sync: true); |
var subscription = stream.listen(controller.add, |
onError: controller.addError, |
onDone: controller.close); |
- return new Pair<Stream, StreamSubscription>(controllerStream, subscription); |
+ return new Pair<Stream, StreamSubscription>(controller.stream, subscription); |
} |
// TODO(nweiz): remove this when issue 7787 is fixed. |