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

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

Issue 1605923005: Improve failure mode when there is no SDK (issue 25528) (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 7c112560219d79336a2650e87d5d18506e2959a8..872e2af69b25ea27997764ca1a719206ce7156dd 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -3551,6 +3551,16 @@ class ParseDartTask extends SourceBasedAnalysisTask {
HashSet<Source> importedSourceSet =
new HashSet.from(explicitlyImportedSourceSet);
Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE);
+ if (coreLibrarySource == null) {
+ String message;
+ DartSdk sdk = context.sourceFactory.dartSdk;
+ if (sdk == null) {
+ message = 'Could not resolve "dart:core": SDK not defined';
+ } else {
+ message = 'Could not resolve "dart:core": SDK incorrectly configured';
+ }
+ throw new AnalysisException(message);
+ }
importedSourceSet.add(coreLibrarySource);
//
// Compute kind.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698