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

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 793653003: Display exports that lead to dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | tests/compiler/dart2js/import_mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index b2db0bb1aa19d5143141af894ff82b00f4dd11ae..8debbe7c92c3ddc79c02608ea5041816dfd72286 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -708,6 +708,9 @@ class LibraryDependencyNode {
*/
Link<ImportLink> imports = const Link<ImportLink>();
+ /// A linked list of all libraries directly exported by [library].
+ Link<LibraryElement> exports = const Link<LibraryElement>();
+
/**
* A linked list of the export tags the dependent upon this node library.
* This is used to propagate exports during the computation of export scopes.
@@ -750,6 +753,10 @@ class LibraryDependencyNode {
*/
void registerExportDependency(Export export,
LibraryDependencyNode exportingLibraryNode) {
+ // Register the exported library in the exporting library node.
+ exportingLibraryNode.exports =
+ exportingLibraryNode.exports.prepend(library);
+ // Register the export in the exported library node.
dependencies =
dependencies.prepend(new ExportLink(export, exportingLibraryNode));
}
@@ -1104,16 +1111,18 @@ class _LoadedLibraries implements LoadedLibraries {
List<Link<Uri>> suffixes = [];
if (targetUri != canonicalUri) {
LibraryDependencyNode node = nodeMap[library];
- for (ImportLink import in node.imports.reverse()) {
+
+ /// Process the import (or export) of [importedLibrary].
+ void processLibrary(LibraryElement importedLibrary) {
bool suffixesArePrecomputed =
- suffixChainMap.containsKey(import.importedLibrary);
+ suffixChainMap.containsKey(importedLibrary);
if (!suffixesArePrecomputed) {
- computeSuffixes(import.importedLibrary, prefix);
+ computeSuffixes(importedLibrary, prefix);
if (aborted) return;
}
- for (Link<Uri> suffix in suffixChainMap[import.importedLibrary]) {
+ for (Link<Uri> suffix in suffixChainMap[importedLibrary]) {
suffixes.add(suffix.prepend(canonicalUri));
if (suffixesArePrecomputed) {
@@ -1132,6 +1141,15 @@ class _LoadedLibraries implements LoadedLibraries {
}
}
}
+
+ for (ImportLink import in node.imports.reverse()) {
+ processLibrary(import.importedLibrary);
+ if (aborted) return;
+ }
+ for (LibraryElement exportedLibrary in node.exports.reverse()) {
+ processLibrary(exportedLibrary);
+ if (aborted) return;
+ }
} else { // Here `targetUri == canonicalUri`.
if (!callback(prefix)) {
aborted = true;
« no previous file with comments | « no previous file | tests/compiler/dart2js/import_mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698