OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.task.test_support; | 5 library test.src.task.test_support; |
6 | 6 |
7 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 7 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
8 import 'package:analyzer/src/generated/java_engine.dart'; | 8 import 'package:analyzer/src/generated/java_engine.dart'; |
9 import 'package:analyzer/task/model.dart'; | 9 import 'package:analyzer/task/model.dart'; |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 /** | 30 /** |
31 * The next value that is to be used for a result. | 31 * The next value that is to be used for a result. |
32 */ | 32 */ |
33 int value; | 33 int value; |
34 | 34 |
35 @override | 35 @override |
36 final bool handlesDependencyCycles; | 36 final bool handlesDependencyCycles; |
37 | 37 |
38 TestAnalysisTask(AnalysisContext context, AnalysisTarget target, | 38 TestAnalysisTask(AnalysisContext context, AnalysisTarget target, |
39 {this.descriptor, this.exception, this.handlesDependencyCycles: false, | 39 {this.descriptor, |
40 this.results, this.value: 1}) | 40 this.exception, |
| 41 this.handlesDependencyCycles: false, |
| 42 this.results, |
| 43 this.value: 1}) |
41 : super(context, target); | 44 : super(context, target); |
42 | 45 |
43 @override | 46 @override |
44 String get description => 'Test task'; | 47 String get description => 'Test task'; |
45 | 48 |
46 @override | 49 @override |
47 internalPerform() { | 50 internalPerform() { |
48 if (exception != null) { | 51 if (exception != null) { |
49 caughtException = exception; | 52 caughtException = exception; |
50 } else if (results != null) { | 53 } else if (results != null) { |
51 for (ResultDescriptor result in results) { | 54 for (ResultDescriptor result in results) { |
52 outputs[result] = value++; | 55 outputs[result] = value++; |
53 } | 56 } |
54 } else if (descriptor != null) { | 57 } else if (descriptor != null) { |
55 for (ResultDescriptor result in descriptor.results) { | 58 for (ResultDescriptor result in descriptor.results) { |
56 outputs[result] = value++; | 59 outputs[result] = value++; |
57 } | 60 } |
58 } | 61 } |
59 } | 62 } |
60 } | 63 } |
OLD | NEW |