Index: packages/barback/lib/src/graph/package_graph.dart |
diff --git a/packages/barback/lib/src/graph/package_graph.dart b/packages/barback/lib/src/graph/package_graph.dart |
index 1c2b534e08113ba55e616cbb24bc33e28d6e43ec..8eec163c5ef0dbc0ec2f33f3b4d7ef8f3859a129 100644 |
--- a/packages/barback/lib/src/graph/package_graph.dart |
+++ b/packages/barback/lib/src/graph/package_graph.dart |
@@ -57,8 +57,8 @@ class PackageGraph { |
final _logController = new StreamController<LogEntry>.broadcast(sync: true); |
/// How far along [this] is in processing its assets. |
- NodeStatus get _status => NodeStatus.dirtiest( |
- _cascades.values.map((cascade) => cascade.status)); |
+ NodeStatus get _status => |
+ NodeStatus.dirtiest(_cascades.values.map((cascade) => cascade.status)); |
/// Whether a [BuildResult] is scheduled to be emitted on [results] (see |
/// [_tryScheduleResult]). |
@@ -127,7 +127,7 @@ class PackageGraph { |
/// |
/// If the asset cannot be found, returns null. |
Future<AssetNode> getAssetNode(AssetId id) { |
- return _inErrorZone/*<Future<AssetNode>>*/(() { |
+ return _inErrorZone<Future<AssetNode>>(() { |
var cascade = _cascades[id.package]; |
if (cascade != null) return cascade.getAssetNode(id); |
return new Future.value(null); |
@@ -158,7 +158,7 @@ class PackageGraph { |
if (_status != NodeStatus.IDLE) { |
// A build is still ongoing, so wait for it to complete and try again. |
- return results.first.then/*<Future<AssetSet>>*/((_) => getAllAssets()); |
+ return results.first.then<Future<AssetSet>>((_) => getAllAssets()); |
} |
// If an unexpected error occurred, complete with that. |
@@ -174,9 +174,9 @@ class PackageGraph { |
} |
// Otherwise, return all of the final output assets. |
- return Future.wait(_cascades.values.map( |
- (cascade) => cascade.availableOutputs)) |
- .then((assetSets) { |
+ return Future |
+ .wait(_cascades.values.map((cascade) => cascade.availableOutputs)) |
+ .then((assetSets) { |
var assets = unionAll(assetSets.map((assetSet) => assetSet.toSet())); |
return new AssetSet.from(assets); |
}); |
@@ -225,8 +225,8 @@ class PackageGraph { |
void _onLog(LogEntry entry) { |
if (entry.level == LogLevel.ERROR) { |
// TODO(nweiz): keep track of stack chain. |
- _accumulatedErrors.add( |
- new TransformerException(entry.transform, entry.message, null)); |
+ _accumulatedErrors |
+ .add(new TransformerException(entry.transform, entry.message, null)); |
} |
if (_logController.hasListener) { |
@@ -274,10 +274,11 @@ class PackageGraph { |
/// [Future]. If it throws a [BarbackException], that exception will be piped |
/// to the returned [Future] as well. Any other exceptions will be piped to |
/// [results]. |
- Future/*<T>*/ _inErrorZone/*<T>*/(/*=T*/ body()) { |
- var completer = new Completer/*<T>*/.sync(); |
+ Future<T> _inErrorZone<T>(T body()) { |
+ var completer = new Completer<T>.sync(); |
runZoned(() { |
- new Future.sync(body).then(completer.complete) |
+ new Future.sync(body) |
+ .then(completer.complete) |
.catchError((error, stackTrace) { |
if (error is! BarbackException) throw error; |
completer.completeError(error, stackTrace); |