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

Unified Diff: pkg/compiler/lib/src/dart_backend/outputter.dart

Issue 1335983004: Add ImportElement and ExportElement (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 3 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 | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_backend/outputter.dart
diff --git a/pkg/compiler/lib/src/dart_backend/outputter.dart b/pkg/compiler/lib/src/dart_backend/outputter.dart
index 07d5a4e0b8791825c6070f1e3633e8e8d5385237..82e51702def50095f7e85e843f127023ae6319fc 100644
--- a/pkg/compiler/lib/src/dart_backend/outputter.dart
+++ b/pkg/compiler/lib/src/dart_backend/outputter.dart
@@ -267,7 +267,7 @@ class LibraryInfo {
fixedStaticNames.add(element.name);
});
- for (Element export in library.exports) {
+ library.forEachExport((Element export) {
if (!library.isInternalLibrary &&
export.library.isInternalLibrary) {
// If an element of an internal library is reexported by a platform
@@ -276,7 +276,7 @@ class LibraryInfo {
// implementation detail of dart2js.
reexportingLibraries[export] = library;
}
- }
+ });
}
// Map to keep track of names of enum classes. Since these cannot be renamed
@@ -526,23 +526,22 @@ class MainOutputGenerator {
stripTypes: forceStripTypes,
minify: enableMinification);
unparsers[outputLibrary] = unparser;
- LibraryName libraryName = outputLibrary.libraryTag;
- if (libraryName != null) {
- unparser.visitLibraryName(libraryName);
+ if (outputLibrary.hasLibraryName) {
+ unparser.unparseLibraryName(outputLibrary.libraryName);
}
- for (LibraryTag tag in outputLibrary.tags) {
- if (tag is! LibraryDependency) continue;
- LibraryDependency dependency = tag;
- LibraryElement libraryElement =
- outputLibrary.getLibraryFromTag(dependency);
+ for (ImportElement import in outputLibrary.imports) {
+ LibraryElement libraryElement = import.importedLibrary;
String uri = outputPaths.containsKey(libraryElement)
? "${outputPaths[libraryElement]}.dart"
: libraryElement.canonicalUri.toString();
- if (dependency is Import) {
- unparser.unparseImportTag(uri);
- } else {
- unparser.unparseExportTag(uri);
- }
+ unparser.unparseImportTag(uri);
+ }
+ for (ExportElement export in outputLibrary.exports) {
+ LibraryElement libraryElement = export.exportedLibrary;
+ String uri = outputPaths.containsKey(libraryElement)
+ ? "${outputPaths[libraryElement]}.dart"
+ : libraryElement.canonicalUri.toString();
+ unparser.unparseExportTag(uri);
}
}
} else {
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698