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

Unified Diff: pkg/analyzer/lib/src/summary/summary_sdk.dart

Issue 1567583002: Tests for SummarySdkAnalysisContext. (Closed) Base URL: git@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
Index: pkg/analyzer/lib/src/summary/summary_sdk.dart
diff --git a/pkg/analyzer/lib/src/summary/summary_sdk.dart b/pkg/analyzer/lib/src/summary/summary_sdk.dart
index 70b7bddb736f613411070ce41e64c5be6557887d..4d9b9feb6ce4ce6b59fabe8221debbe1dcc68723 100644
--- a/pkg/analyzer/lib/src/summary/summary_sdk.dart
+++ b/pkg/analyzer/lib/src/summary/summary_sdk.dart
@@ -79,9 +79,16 @@ class SummarySdkAnalysisContext extends SdkAnalysisContext {
entry.setValue(result, true, TargetedResult.EMPTY_LIST);
return true;
} else if (result == SOURCE_KIND) {
- // TODO(scheglov) not every source is a library
- entry.setValue(result, SourceKind.LIBRARY, TargetedResult.EMPTY_LIST);
- return true;
+ String uri = target.uri.toString();
+ if (bundle.prelinkedLibraryUris.contains(uri)) {
+ entry.setValue(result, SourceKind.LIBRARY, TargetedResult.EMPTY_LIST);
+ return true;
+ }
+ if (bundle.unlinkedUnitUris.contains(uri)) {
+ entry.setValue(result, SourceKind.PART, TargetedResult.EMPTY_LIST);
+ return true;
+ }
+ return false;
} else {
// throw new UnimplementedError('$result of $target');
}

Powered by Google App Engine
This is Rietveld 408576698