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

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

Issue 101523003: Add chain support to barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 7 years 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/asset_node.dart
diff --git a/pkg/barback/lib/src/asset_node.dart b/pkg/barback/lib/src/asset_node.dart
index 2372ba909c380217af965c26f882a64564c20acd..a1af547ddddc53cedd25b3f6044bf28cdbdad51d 100644
--- a/pkg/barback/lib/src/asset_node.dart
+++ b/pkg/barback/lib/src/asset_node.dart
@@ -10,6 +10,7 @@ import 'asset.dart';
import 'asset_id.dart';
import 'errors.dart';
import 'transform_node.dart';
+import 'utils.dart';
/// Describes the current state of an asset as part of a transformation graph.
///
@@ -125,7 +126,7 @@ class AssetNode {
/// The return value of [callback] is piped to the returned Future.
Future _waitForState(bool test(AssetState state),
callback(AssetState state)) {
- if (test(state)) return new Future.sync(() => callback(state));
+ if (test(state)) return syncFuture(() => callback(state));
return onStateChange.firstWhere(test).then((_) => callback(state));
}

Powered by Google App Engine
This is Rietveld 408576698