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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/barback.dart

Issue 25094002: Adapt streams for additional stackTrace argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove types in closures. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.barback; 5 library pub.barback;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 var completer = new Completer(); 67 var completer = new Completer();
68 68
69 // If any errors get emitted either by barback or by the server, including 69 // If any errors get emitted either by barback or by the server, including
70 // non-programmatic barback errors, they should take down the whole program. 70 // non-programmatic barback errors, they should take down the whole program.
71 var subscriptions = [ 71 var subscriptions = [
72 server.barback.errors.listen((error) { 72 server.barback.errors.listen((error) {
73 if (error is TransformerException) error = error.error; 73 if (error is TransformerException) error = error.error;
74 if (!completer.isCompleted) completer.completeError(error); 74 if (!completer.isCompleted) completer.completeError(error);
75 }), 75 }),
76 server.barback.results.listen((_) {}, onError: (error) { 76 server.barback.results.listen((_) {}, onError: (error, stackTrace) {
77 if (!completer.isCompleted) completer.completeError(error); 77 if (!completer.isCompleted) completer.completeError(error, stackTrace);
78 }), 78 }),
79 server.results.listen((_) {}, onError: (error) { 79 server.results.listen((_) {}, onError: (error, stackTrace) {
80 if (!completer.isCompleted) completer.completeError(error); 80 if (!completer.isCompleted) completer.completeError(error, stackTrace);
81 }) 81 })
82 ]; 82 ];
83 83
84 loadAllTransformers(server, graph, builtInTransformers).then((_) { 84 loadAllTransformers(server, graph, builtInTransformers).then((_) {
85 if (!completer.isCompleted) completer.complete(server); 85 if (!completer.isCompleted) completer.complete(server);
86 }).catchError((error) { 86 }).catchError((error, stackTrace) {
87 if (!completer.isCompleted) completer.completeError(error); 87 if (!completer.isCompleted) completer.completeError(error, stackTrace);
88 }); 88 });
89 89
90 return completer.future.whenComplete(() { 90 return completer.future.whenComplete(() {
91 for (var subscription in subscriptions) { 91 for (var subscription in subscriptions) {
92 subscription.cancel(); 92 subscription.cancel();
93 } 93 }
94 }); 94 });
95 }); 95 });
96 } 96 }
97 97
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 var package = parts[index + 1]; 177 var package = parts[index + 1];
178 var assetPath = path.url.join(dirName, 178 var assetPath = path.url.join(dirName,
179 path.url.joinAll(parts.skip(index + 2))); 179 path.url.joinAll(parts.skip(index + 2)));
180 return new AssetId(package, assetPath); 180 return new AssetId(package, assetPath);
181 } 181 }
182 182
183 return null; 183 return null;
184 } 184 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/dartdoc.dart ('k') | sdk/lib/_internal/pub/lib/src/barback/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698