| 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.group_runner; | 5 library barback.group_runner; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'asset_cascade.dart'; | 9 import 'asset_cascade.dart'; |
| 10 import 'asset_node.dart'; | 10 import 'asset_node.dart'; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Process the first phase that needs to do work. | 78 // Process the first phase that needs to do work. |
| 79 for (var phase in _phases) { | 79 for (var phase in _phases) { |
| 80 var future = phase.process(); | 80 var future = phase.process(); |
| 81 if (future != null) return future.then((_) => process()); | 81 if (future != null) return future.then((_) => process()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 // If we get here, all phases are done processing. | 84 // If we get here, all phases are done processing. |
| 85 var newOutputs = _phases.last.availableOutputs | 85 var newOutputs = _phases.last.availableOutputs |
| 86 .difference(_alreadyEmittedOutputs); | 86 .difference(_alreadyEmittedOutputs); |
| 87 for (var output in newOutputs) { | 87 for (var output in newOutputs) { |
| 88 output.whenRemoved.then((_) => _alreadyEmittedOutputs.remove(output)); | 88 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output)); |
| 89 } | 89 } |
| 90 _alreadyEmittedOutputs.addAll(newOutputs); | 90 _alreadyEmittedOutputs.addAll(newOutputs); |
| 91 | 91 |
| 92 return new Future.value(newOutputs); | 92 return new Future.value(newOutputs); |
| 93 } | 93 } |
| 94 } | 94 } |
| OLD | NEW |