| 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.phase; | 5 library barback.phase; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'asset.dart'; | 10 import 'asset.dart'; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 _adjustTransformers(node); | 221 _adjustTransformers(node); |
| 222 } | 222 } |
| 223 }).catchError((e) { | 223 }).catchError((e) { |
| 224 _adjustTransformersFutures[node.id] = new Future.error(e); | 224 _adjustTransformersFutures[node.id] = new Future.error(e); |
| 225 }); | 225 }); |
| 226 }).catchError((error) { | 226 }).catchError((error) { |
| 227 if (error is! AssetNotFoundException || error.id != node.id) throw error; | 227 if (error is! AssetNotFoundException || error.id != node.id) throw error; |
| 228 | 228 |
| 229 // If the asset is removed, [tryUntilStable] will throw an | 229 // If the asset is removed, [tryUntilStable] will throw an |
| 230 // [AssetNotFoundException]. In that case, just remove all transforms for | 230 // [AssetNotFoundException]. In that case, just remove all transforms for |
| 231 // the node. | 231 // the node, and its pass-through. |
| 232 _transforms.remove(node.id); | 232 _transforms.remove(node.id); |
| 233 var passThrough = _passThroughControllers.remove(node.id); |
| 234 if (passThrough != null) passThrough.setRemoved(); |
| 233 }).whenComplete(() { | 235 }).whenComplete(() { |
| 234 _adjustTransformersFutures.remove(node.id); | 236 _adjustTransformersFutures.remove(node.id); |
| 235 }); | 237 }); |
| 236 | 238 |
| 237 // Don't top-level errors coming from the input processing. Any errors will | 239 // Don't top-level errors coming from the input processing. Any errors will |
| 238 // eventually be piped through [process]'s returned Future. | 240 // eventually be piped through [process]'s returned Future. |
| 239 _adjustTransformersFutures[node.id].catchError((_) {}); | 241 _adjustTransformersFutures[node.id].catchError((_) {}); |
| 240 } | 242 } |
| 241 | 243 |
| 242 // Remove any old transforms that used to have [asset] as a primary asset but | 244 // Remove any old transforms that used to have [asset] as a primary asset but |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // Pump the event queue to ensure that the removal of the input triggers | 424 // Pump the event queue to ensure that the removal of the input triggers |
| 423 // a new build to which we can attach the error. | 425 // a new build to which we can attach the error. |
| 424 newFuture(() => cascade.reportError(new AssetCollisionException( | 426 newFuture(() => cascade.reportError(new AssetCollisionException( |
| 425 assets.where((asset) => asset.transform != null) | 427 assets.where((asset) => asset.transform != null) |
| 426 .map((asset) => asset.transform.info), | 428 .map((asset) => asset.transform.info), |
| 427 output.id))); | 429 output.id))); |
| 428 } | 430 } |
| 429 }); | 431 }); |
| 430 } | 432 } |
| 431 } | 433 } |
| OLD | NEW |