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

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

Issue 1715563002: Tolerate SDKs that do not include dart:async (issue 25520) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added test Created 4 years, 10 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 | pkg/analyzer/lib/task/model.dart » ('j') | 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 b52bed60c9c576c0ef6e1e9eb84ff2de88b3e299..e99e82da669f4dbad2e0add88b3bec3cc9d874ef 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -1578,7 +1578,11 @@ class BuildTypeProviderTask extends SourceBasedAnalysisTask {
@override
void internalPerform() {
LibraryElement coreLibrary = getRequiredInput(CORE_INPUT);
- LibraryElement asyncLibrary = getRequiredInput(ASYNC_INPUT);
+ LibraryElement asyncLibrary = getOptionalInput(ASYNC_INPUT);
+ if (asyncLibrary == null) {
+ asyncLibrary =
+ (context as AnalysisContextImpl).createMockAsyncLib(coreLibrary);
+ }
Namespace coreNamespace = coreLibrary.publicNamespace;
Namespace asyncNamespace = asyncLibrary.publicNamespace;
//
@@ -1600,6 +1604,9 @@ class BuildTypeProviderTask extends SourceBasedAnalysisTask {
SourceFactory sourceFactory = contextTarget.context.sourceFactory;
Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
Source asyncSource = sourceFactory.forUri(DartSdk.DART_ASYNC);
+ if (asyncSource == null) {
+ return <String, TaskInput>{CORE_INPUT: LIBRARY_ELEMENT3.of(coreSource)};
+ }
return <String, TaskInput>{
CORE_INPUT: LIBRARY_ELEMENT3.of(coreSource),
ASYNC_INPUT: LIBRARY_ELEMENT3.of(asyncSource)
« no previous file with comments | « no previous file | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698