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

Unified Diff: lib/src/graph/phase.dart

Issue 1947773002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Code review changes Created 4 years, 7 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
« no previous file with comments | « lib/src/graph/package_graph.dart ('k') | lib/src/graph/static_asset_cascade.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/graph/phase.dart
diff --git a/lib/src/graph/phase.dart b/lib/src/graph/phase.dart
index 4bfc5e19fd1a74decd504ee8e1f1b8aa3a9a0a19..629291a11d00c4754ca8da08030f9b9e027d548c 100644
--- a/lib/src/graph/phase.dart
+++ b/lib/src/graph/phase.dart
@@ -6,6 +6,8 @@ library barback.graph.phase;
import 'dart:async';
+import 'package:collection/collection.dart';
+
import '../asset/asset_id.dart';
import '../asset/asset_node.dart';
import '../asset/asset_node_set.dart';
@@ -14,7 +16,6 @@ import '../log.dart';
import '../transformer/aggregate_transformer.dart';
import '../transformer/transformer.dart';
import '../transformer/transformer_group.dart';
-import '../utils.dart';
import '../utils/multiset.dart';
import 'asset_cascade.dart';
import 'group_runner.dart';
@@ -205,7 +206,7 @@ class Phase {
///
/// If the output cannot be found, returns null.
Future<AssetNode> getOutput(AssetId id) {
- return syncFuture(() {
+ return new Future.sync(() {
if (id.package != cascade.package) return cascade.graph.getAssetNode(id);
if (_outputs.containsKey(id)) {
var output = _outputs[id].output;
@@ -258,8 +259,8 @@ class Phase {
}
}
- var newGroups = transformers.where((op) => op is TransformerGroup)
- .toSet();
+ var newGroups = DelegatingSet.typed/*<TransformerGroup>*/(
+ transformers.where((op) => op is TransformerGroup).toSet());
var oldGroups = _groups.keys.toSet();
for (var removed in oldGroups.difference(newGroups)) {
_groups.remove(removed).remove();
@@ -389,7 +390,9 @@ class Phase {
asset.whenStateChanges().then((state) {
if (state.isRemoved) return getOutput(asset.id);
return asset;
- }).then(request.complete).catchError(request.completeError);
+ })
+ .then((asset) => request.complete(asset))
+ .catchError(request.completeError);
}
String toString() => "phase $_location.$_index";
« no previous file with comments | « lib/src/graph/package_graph.dart ('k') | lib/src/graph/static_asset_cascade.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698