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

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

Issue 2243463003: Link with exports dependencies. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/test/src/summary/pub_summary_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/pub_summary.dart
diff --git a/pkg/analyzer/lib/src/summary/pub_summary.dart b/pkg/analyzer/lib/src/summary/pub_summary.dart
index f3574a27cdb026a70bc6798c0ea9d936beee3b01..341db2af1d1f2ee5c894694ec12014a670d588bf 100644
--- a/pkg/analyzer/lib/src/summary/pub_summary.dart
+++ b/pkg/analyzer/lib/src/summary/pub_summary.dart
@@ -528,28 +528,39 @@ class _LinkedNode extends Node<_LinkedNode> {
@override
List<_LinkedNode> computeDependencies() {
Set<_LinkedNode> dependencies = new Set<_LinkedNode>();
+
+ void appendDependency(String uriStr) {
+ Uri uri = FastUri.parse(uriStr);
+ if (!uri.hasScheme) {
+ // A relative path in this package, skip it.
+ } else if (uri.scheme == 'dart') {
+ // Dependency on the SDK is implicit and always added.
+ // The SDK linked bundle is precomputed before linking packages.
+ } else if (uriStr.startsWith('package:')) {
+ String package = PubSummaryManager.getPackageName(uriStr);
+ _LinkedNode packageNode = packageToNode[package];
+ if (packageNode == null) {
+ failed = true;
+ }
+ dependencies.add(packageNode);
+ } else {
+ failed = true;
+ }
+ }
+
for (UnlinkedUnit unit in unlinked.unlinkedUnits) {
for (UnlinkedImport import in unit.imports) {
- String uriStr = import.isImplicit ? 'dart:core' : import.uri;
- Uri uri = FastUri.parse(uriStr);
- if (!uri.hasScheme) {
- // A relative path in this package, skip it.
- } else if (uri.scheme == 'dart') {
- // Dependency on the SDK is implicit and always added.
- // The SDK linked bundle is precomputed before linking packages.
- } else if (uriStr.startsWith('package:')) {
- String package = PubSummaryManager.getPackageName(uriStr);
- _LinkedNode packageNode = packageToNode[package];
- if (packageNode == null) {
- failed = true;
- return const <_LinkedNode>[];
- }
- dependencies.add(packageNode);
- } else {
- failed = true;
- return const <_LinkedNode>[];
+ if (!import.isImplicit) {
+ appendDependency(import.uri);
}
}
+ for (UnlinkedExportPublic export in unit.publicNamespace.exports) {
+ appendDependency(export.uri);
+ }
+ }
+
+ if (failed) {
+ return const <_LinkedNode>[];
}
return dependencies.toList();
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/pub_summary_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698