Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1645643002: Replace isAppropriateFor with suitabilityFor and start using it (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/lib/src/task/html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/driver.dart
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index db9cd1d46e1715fc4cb8a2711a36f45eda372f37..0f3b523435d941f418f24c1c50bd56766d4ce2b5 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -154,7 +154,7 @@ class AnalysisDriver {
/**
* Create a work order that will produce the given [result] for the given
* [target]. Return the work order that was created, or `null` if the result
- * has already been computed.
+ * has either already been computed or cannot be computed.
*/
WorkOrder createWorkOrderForResult(
AnalysisTarget target, ResultDescriptor result) {
@@ -166,6 +166,9 @@ class AnalysisDriver {
return null;
}
TaskDescriptor taskDescriptor = taskManager.findTask(target, result);
+ if (taskDescriptor == null) {
+ return null;
+ }
try {
WorkItem workItem =
new WorkItem(context, target, taskDescriptor, result, 0, null);
@@ -709,11 +712,22 @@ class WorkItem {
try {
TaskDescriptor descriptor =
taskManager.findTask(inputTarget, inputResult);
+ if (descriptor == null) {
+ throw new AnalysisException(
+ 'Cannot find task to build $inputResult for $inputTarget');
+ }
return new WorkItem(context, inputTarget, descriptor, inputResult,
level + 1, workOrder);
} on AnalysisException catch (exception, stackTrace) {
this.exception = new CaughtException(exception, stackTrace);
return null;
+ } catch (exception, stackTrace) {
+ this.exception = new CaughtException(
+ throw new AnalysisException(
+ 'Cannot create work order to build $inputResult for $inputTarget',
+ exception),
+ stackTrace);
+ return null;
}
}
} else {
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/lib/src/task/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698