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

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

Issue 189263002: Make Phase.getInput in barback play nicely with the push model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
Index: pkg/barback/lib/src/transform_node.dart
diff --git a/pkg/barback/lib/src/transform_node.dart b/pkg/barback/lib/src/transform_node.dart
index 2fa826e2f9e10030b9f980fbeff53a8d07e83b6d..8aeb657ee922ba9d8e9a3dcdccefff89fb6a8274 100644
--- a/pkg/barback/lib/src/transform_node.dart
+++ b/pkg/barback/lib/src/transform_node.dart
@@ -229,19 +229,10 @@ class TransformNode {
// results stream.
if (node == null) throw new MissingInputException(info, id);
- // If the asset node is found, wait until its contents are actually
- // available before we return them.
- return node.whenAvailable((asset) {
- _inputSubscriptions.putIfAbsent(node.id,
- () => node.onStateChange.listen((_) => _dirty()));
-
- return asset;
- }).catchError((error) {
- if (error is! AssetNotFoundException || error.id != id) throw error;
- // If the node was removed before it could be loaded, treat it as though
- // it never existed and throw a MissingInputException.
- throw new MissingInputException(info, id);
- });
+ _inputSubscriptions.putIfAbsent(node.id,
+ () => node.onStateChange.listen((_) => _dirty()));
+
+ return node.asset;
});
}

Powered by Google App Engine
This is Rietveld 408576698