Chromium Code Reviews| 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 ecd8d8f677f6b481fc6ca1b586bab96a51542974..ee56ffd46600f56c02c18edbe71a89cc770e5ab4 100644 |
| --- a/pkg/barback/lib/src/transform_node.dart |
| +++ b/pkg/barback/lib/src/transform_node.dart |
| @@ -114,12 +114,16 @@ class TransformNode { |
| /// [declareOutputs] has been run successfully. |
| Set<AssetId> _declaredOutputs; |
| - TransformNode(this.phase, Transformer transformer, this.primary, |
| + TransformNode(this.phase, Transformer transformer, AssetNode primary, |
| this._location) |
| : transformer = transformer, |
| - _isLazy = transformer is LazyTransformer { |
| + primary = primary, |
| + _isLazy = transformer is LazyTransformer || |
| + (transformer is DeclaringTransformer && primary.isLazy) { |
|
Bob Nystrom
2014/04/10 20:45:34
Laziness propagates downwards from previous lazy t
nweiz
2014/04/10 20:54:53
Done.
|
| _onLogPool.add(_onLogController.stream); |
| + if (!_isLazy) primary.force(); |
| + |
| _primarySubscription = primary.onStateChange.listen((state) { |
| if (state.isRemoved) { |
| remove(); |
| @@ -167,6 +171,7 @@ class TransformNode { |
| // TODO(nweiz): we might want to have a timeout after which, if the |
| // transform's outputs have gone unused, we switch it back to lazy mode. |
| if (!_isLazy) return; |
| + primary.force(); |
| _isLazy = false; |
| _dirty(); |
| } |
| @@ -253,7 +258,7 @@ class TransformNode { |
| if (!_declaredOutputs.contains(primary.id)) _emitPassThrough(); |
| for (var id in _declaredOutputs) { |
| - var controller = transformer is LazyTransformer |
| + var controller = _isLazy |
| ? new AssetNodeController.lazy(id, force, this) |
| : new AssetNodeController(id, this); |
| _outputControllers[id] = controller; |