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

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

Issue 229833003: Don't treat the primary input as a secondary input in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/transform.dart
diff --git a/pkg/barback/lib/src/transform.dart b/pkg/barback/lib/src/transform.dart
index 25c260af53a809be0af5c067fb6af2f9d3de7a0a..268849d78a419d2faa567df217ffc3560e948854 100644
--- a/pkg/barback/lib/src/transform.dart
+++ b/pkg/barback/lib/src/transform.dart
@@ -57,7 +57,10 @@ class Transform extends BaseTransform {
/// Gets the asset for an input [id].
///
/// If an input with [id] cannot be found, throws an [AssetNotFoundException].
- Future<Asset> getInput(AssetId id) => _node.getInput(id);
+ Future<Asset> getInput(AssetId id) {
+ if (id == _node.primary.id) return syncFuture(() => primaryInput);
+ return _node.getInput(id);
+ }
/// A convenience method to the contents of the input with [id] as a string.
///
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698