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

Unified Diff: lib/src/graph/asset_cascade.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/errors.dart ('k') | lib/src/graph/group_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/graph/asset_cascade.dart
diff --git a/lib/src/graph/asset_cascade.dart b/lib/src/graph/asset_cascade.dart
index 70bc4c94b055e27028243ffa4e19b153fd34b87b..d307b87b865d7b0a90624541c24636df2bc1319e 100644
--- a/lib/src/graph/asset_cascade.dart
+++ b/lib/src/graph/asset_cascade.dart
@@ -6,6 +6,8 @@ library barback.graph.asset_cascade;
import 'dart:async';
+import 'package:async/async.dart';
+
import '../asset/asset.dart';
import '../asset/asset_id.dart';
import '../asset/asset_node.dart';
@@ -13,7 +15,6 @@ import '../asset/asset_set.dart';
import '../errors.dart';
import '../log.dart';
import '../transformer/transformer.dart';
-import '../utils.dart';
import '../utils/cancelable_future.dart';
import 'node_status.dart';
import 'node_streams.dart';
@@ -113,13 +114,13 @@ class AssetCascade {
// * If [id] has never been generated and all active transformers provide
// metadata about the file names of assets it can emit, we can prove that
// none of them can emit [id] and fail early.
- return oldLastPhase.getOutput(id).then((node) {
+ return DelegatingFuture.typed(oldLastPhase.getOutput(id).then((node) {
// The last phase may have changed if [updateSources] was called after
// requesting the output. In that case, we want the output from the new
// last phase.
if (_phases.last == oldLastPhase) return node;
return getAssetNode(id);
- });
+ }));
}
/// Adds [sources] to the graph's known set of source assets.
@@ -142,11 +143,11 @@ class AssetCascade {
if (_loadingSources.containsKey(id)) _loadingSources[id].cancel();
_loadingSources[id] = new CancelableFuture<Asset>(
- syncFuture(() => graph.provider.getAsset(id)));
+ new Future.sync(() => graph.provider.getAsset(id)));
_loadingSources[id].whenComplete(() {
_loadingSources.remove(id);
}).then((asset) {
- var controller = _sourceControllerMap[id].setAvailable(asset);
+ _sourceControllerMap[id].setAvailable(asset);
}).catchError((error, stack) {
reportError(new AssetLoadException(id, error, stack));
« no previous file with comments | « lib/src/errors.dart ('k') | lib/src/graph/group_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698