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

Unified Diff: pkg/barback/lib/src/utils.dart

Issue 25094002: Adapt streams for additional stackTrace argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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: 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;

Powered by Google App Engine
This is Rietveld 408576698