Index: pkg/barback/lib/src/utils.dart |
diff --git a/pkg/barback/lib/src/utils.dart b/pkg/barback/lib/src/utils.dart |
index 95f498e037a634f3c0aac681663b242b57be6882..33cf145bdae68651ceb8747999ed2b1b6365a3eb 100644 |
--- a/pkg/barback/lib/src/utils.dart |
+++ b/pkg/barback/lib/src/utils.dart |
@@ -137,14 +137,13 @@ Stream mergeStreams(Iterable<Stream> streams, {bool broadcast: false}) { |
: new StreamController(sync: true); |
for (var stream in streams) { |
- stream.listen((value) { |
- controller.add(value); |
- }, onError: (error) { |
- controller.addError(error); |
- }, onDone: () { |
- doneCount++; |
- if (doneCount == streams.length) controller.close(); |
- }); |
+ stream.listen( |
+ controller.add, |
+ onError: controller.addError, |
+ onDone: () { |
+ doneCount++; |
+ if (doneCount == streams.length) controller.close(); |
+ }); |
nweiz
2013/10/07 18:49:51
The indentation here is wrong. It should be:
stre
floitsch
2013/10/10 14:22:52
Done.
|
} |
return controller.stream; |
@@ -188,10 +187,10 @@ Stream futureStream(Future<Stream> future) { |
future.then((stream) { |
stream.listen( |
controller.add, |
- onError: (error) => controller.addError(error), |
+ onError: controller.addError, |
onDone: controller.close); |
- }).catchError((e) { |
- controller.addError(e); |
+ }).catchError((e, StackTrace stackTrace) { |
nweiz
2013/10/07 18:49:51
Should this stackTrace parameter be optional? It's
floitsch
2013/10/10 14:22:52
We know where the catchError comes from. (It's fro
|
+ controller.addError(e, stackTrace); |
controller.close(); |
}); |
return controller.stream; |