Chromium Code Reviews| 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 6fd86c622d7fab8058c23f134104e2f02690c719..7bef7a0afa1ad238b3607abbf28dd1f01fbf2252 100644 |
| --- a/pkg/barback/lib/src/asset_node.dart |
| +++ b/pkg/barback/lib/src/asset_node.dart |
| @@ -17,17 +17,21 @@ import 'transform_node.dart'; |
| /// Keeps a cache of the last asset that was built for this node (i.e. for this |
| /// node's ID and phase) and tracks which transforms depend on it. |
| class AssetNode { |
|
nweiz
2013/07/03 20:08:25
Is this class really doing anything now? Couldn't
Bob Nystrom
2013/07/03 22:32:11
It keeps track of the set of transforms that depen
|
| - final AssetId id; |
| Asset asset; |
| /// The [TransformNode]s that consume this node's asset as an input. |
| final consumers = new Set<TransformNode>(); |
| - AssetNode(this.id); |
| + AssetId get id => asset.id; |
| + |
| + AssetNode(this.asset); |
| /// Updates this node's generated asset value and marks all transforms that |
| /// use this as dirty. |
| void updateAsset(Asset asset) { |
| + // Cannot update an asset to one with a different ID. |
| + assert(id == asset.id); |
| + |
| this.asset = asset; |
| consumers.forEach((consumer) => consumer.dirty()); |
| } |