| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library barback.transform_node; | 5 library barback.transform_node; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'asset.dart'; | 9 import 'asset.dart'; |
| 10 import 'asset_id.dart'; | 10 import 'asset_id.dart'; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 error = new TransformerException(info, error); | 125 error = new TransformerException(info, error); |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Catch all transformer errors and pipe them to the results stream. | 128 // Catch all transformer errors and pipe them to the results stream. |
| 129 // This is so a broken transformer doesn't take down the whole graph. | 129 // This is so a broken transformer doesn't take down the whole graph. |
| 130 phase.cascade.reportError(error); | 130 phase.cascade.reportError(error); |
| 131 | 131 |
| 132 // Don't allow partial results from a failed transform. | 132 // Don't allow partial results from a failed transform. |
| 133 newOutputs.clear(); | 133 newOutputs.clear(); |
| 134 }).then((_) { | 134 }).then((_) { |
| 135 if (_isDirty) return []; | 135 if (_isDirty) return new Set(); |
| 136 | 136 |
| 137 return _adjustOutputs(newOutputs); | 137 return _adjustOutputs(newOutputs); |
| 138 }); | 138 }); |
| 139 } | 139 } |
| 140 | 140 |
| 141 /// Gets the asset for an input [id]. | 141 /// Gets the asset for an input [id]. |
| 142 /// | 142 /// |
| 143 /// If an input with that ID cannot be found, throws an | 143 /// If an input with that ID cannot be found, throws an |
| 144 /// [AssetNotFoundException]. | 144 /// [AssetNotFoundException]. |
| 145 Future<Asset> getInput(AssetId id) { | 145 Future<Asset> getInput(AssetId id) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } else { | 194 } else { |
| 195 var controller = new AssetNodeController.available(asset, this); | 195 var controller = new AssetNodeController.available(asset, this); |
| 196 _outputControllers[asset.id] = controller; | 196 _outputControllers[asset.id] = controller; |
| 197 brandNewOutputs.add(controller.node); | 197 brandNewOutputs.add(controller.node); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 return brandNewOutputs; | 201 return brandNewOutputs; |
| 202 } | 202 } |
| 203 } | 203 } |
| OLD | NEW |