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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 11110006: Issue 5735. Fix for 'export' without 'import' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: If re-export if local element with same name exists Created 8 years, 2 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 | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
index b72e73aa05599cc8045b6cacafbdd7aa24dda23a..2a4e52b933eb38a420af520becab31c69e16f81f 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
@@ -144,8 +144,14 @@ public class TopLevelElementBuilder {
// Fill "library" export scope with re-exports.
for (LibraryExport export : library.getExports()) {
LibraryUnit lib = export.getLibrary();
+ fillInLibraryScope(lib, listener);
for (Element element : lib.getElement().getExportedElements()) {
String name = element.getName();
+ // re-export only in not defined locally
+ if (scope.findLocalElement(name) != null) {
+ continue;
+ }
+ // check if show/hide combinators of "export" are satisfied
if (export.isVisible(name)) {
Elements.addExportedElement(library.getElement(), element);
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698