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

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

Issue 2689573002: Fix export + local when the library is also exported. (Closed)
Patch Set: Created 3 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/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/prelink.dart
diff --git a/pkg/analyzer/lib/src/summary/prelink.dart b/pkg/analyzer/lib/src/summary/prelink.dart
index 6005808e3826592d8598d8f57b69d2939b0ba343..33ce0f9bf0ac7585e84d8ef3a450b8d868d569ba 100644
--- a/pkg/analyzer/lib/src/summary/prelink.dart
+++ b/pkg/analyzer/lib/src/summary/prelink.dart
@@ -299,37 +299,35 @@ class _Prelinker {
* should be computed), then names defined in [definingUnit] are ignored.
*/
_Namespace computeExportNamespace(String relativeUri) {
- _Namespace exportNamespace = relativeUri == null
- ? new _Namespace()
- : aggregatePublicNamespace(relativeUri);
- void chaseExports(
- NameFilter filter, String relativeUri, Set<String> seenUris) {
+ Set<String> seenUris = new Set<String>();
+ _Namespace chaseExports(String relativeUri, NameFilter filter) {
+ _Namespace exportedNamespace = relativeUri == null
+ ? new _Namespace()
+ : aggregatePublicNamespace(relativeUri);
if (seenUris.add(relativeUri)) {
- UnlinkedPublicNamespace exportedNamespace =
- getImportCached(relativeUri);
- if (exportedNamespace != null) {
- for (UnlinkedExportPublic export in exportedNamespace.exports) {
+ UnlinkedPublicNamespace publicNamespace = getImportCached(relativeUri);
+ if (publicNamespace != null) {
+ for (UnlinkedExportPublic export in publicNamespace.exports) {
String relativeExportUri =
_selectUri(export.uri, export.configurations);
String exportUri = resolveUri(relativeUri, relativeExportUri);
NameFilter newFilter = filter.merge(
new NameFilter.forUnlinkedCombinators(export.combinators));
- aggregatePublicNamespace(exportUri)
- .forEach((String name, _Meaning meaning) {
+ _Namespace exportNamespace = chaseExports(exportUri, newFilter);
+ exportNamespace.forEach((String name, _Meaning meaning) {
if (newFilter.accepts(name) &&
- !exportNamespace.definesLibraryName(name)) {
- exportNamespace.add(name, meaning);
+ !exportedNamespace.definesLibraryName(name)) {
+ exportedNamespace.add(name, meaning);
}
});
- chaseExports(newFilter, exportUri, seenUris);
}
}
seenUris.remove(relativeUri);
}
+ return exportedNamespace;
}
- chaseExports(NameFilter.identity, relativeUri, new Set<String>());
- return exportNamespace;
+ return chaseExports(relativeUri, NameFilter.identity);
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698