Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/library_loader.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/library_loader.dart b/sdk/lib/_internal/compiler/implementation/library_loader.dart |
| index bad6e10da309ea9cb592193a38dbb855c60de301..575662540d4927e9b78129b0416dc4ec999efca1 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/library_loader.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/library_loader.dart |
| @@ -714,12 +714,14 @@ class LibraryDependencyNode { |
| */ |
| Element addElementToExportScope(Compiler compiler, Element element, |
| Link<Export> exports) { |
| - |
| SourceString name = element.name; |
| void reportDuplicateExport(Element duplicate, |
| Link<Export> duplicateExports, |
| {bool reportError: true}) { |
| + assert(invariant(library, !duplicateExports.isEmpty, |
| + message: "No export for $duplicate from ${duplicate.getLibrary()} " |
| + "in $library.")); |
| compiler.withCurrentElement(library, () { |
| for (Export export in duplicateExports) { |
| if (reportError) { |
| @@ -736,6 +738,9 @@ class LibraryDependencyNode { |
| void reportDuplicateExportDecl(Element duplicate, |
| Link<Export> duplicateExports) { |
| + assert(invariant(library, !duplicateExports.isEmpty, |
| + message: "No export for $duplicate from ${duplicate.getLibrary()} " |
| + "in $library.")); |
| compiler.reportInfo(duplicate, MessageKind.DUPLICATE_EXPORT_DECL, |
| {'name': name, 'uriString': duplicateExports.head.uri}); |
| } |
| @@ -746,7 +751,13 @@ class LibraryDependencyNode { |
| reportDuplicateExport(element, exports); |
| reportDuplicateExportDecl(element, exports); |
| element = existingElement; |
| - } else if (existingElement.getLibrary() != library) { |
| + } else if (existingElement.getLibrary() == library) { |
| + // Do nothing. [existingElement] hides [element]. |
| + } else if (element.getLibrary() == library) { |
| + // Do nothing. [element] hides [existingElement]. |
|
karlklose
2013/10/03 13:35:19
Remove "Do nothing."
Johnni Winther
2013/10/03 13:38:51
Done.
|
| + exportScope[name] = element; |
| + exporters[element] = exports; |
| + } else { |
| // Declared elements hide exported elements. |
| Link<Export> existingExports = exporters[existingElement]; |
| reportDuplicateExport(existingElement, existingExports); |