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

Unified Diff: sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 11275196: Revert "Report errors on duplicate export." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6a247e209c633f2df7c821a03215fdccb00968a8..359aa435f4b7bc7a141e8c8eb74715c9f462d1a0 100644
--- a/sdk/lib/_internal/compiler/implementation/library_loader.dart
+++ b/sdk/lib/_internal/compiler/implementation/library_loader.dart
@@ -173,12 +173,11 @@ class LibraryLoaderTask extends LibraryLoader {
Uri base = library.entryCompilationUnit.script.uri;
for (LibraryTag tag in library.tags.reverse()) {
if (tag.isImport) {
- Import import = tag;
- tagState = checkTag(TagState.IMPORT_OR_EXPORT, import);
- if (import.uri.dartString.slowToString() == 'dart:core') {
+ tagState = checkTag(TagState.IMPORT_OR_EXPORT, tag);
+ if (tag.uri.dartString.slowToString() == 'dart:core') {
importsDartCore = true;
}
- libraryDependencies.addLast(import);
+ libraryDependencies.addLast(tag);
} else if (tag.isExport) {
tagState = checkTag(TagState.IMPORT_OR_EXPORT, tag);
libraryDependencies.addLast(tag);
@@ -191,11 +190,10 @@ class LibraryLoaderTask extends LibraryLoader {
}
checkDuplicatedLibraryName(library);
} else if (tag.isPart) {
- Part part = tag;
- StringNode uri = part.uri;
+ StringNode uri = tag.uri;
Uri resolved = base.resolve(uri.dartString.slowToString());
- tagState = checkTag(TagState.SOURCE, part);
- scanPart(part, resolved, library);
+ tagState = checkTag(TagState.SOURCE, tag);
+ scanPart(tag, resolved, library);
} else {
compiler.internalError("Unhandled library tag.", node: tag);
}
@@ -548,16 +546,8 @@ class LibraryDependencyNode {
SourceString name = element.name;
Element existingElement = exportScope[name];
if (existingElement != null) {
- if (existingElement.isErroneous()) {
- compiler.reportMessage(compiler.spanFromElement(element),
- MessageKind.DUPLICATE_EXPORT.error([name]), api.Diagnostic.ERROR);
- element = existingElement;
- } else if (existingElement.getLibrary() != library) {
+ if (existingElement.getLibrary() != library) {
// Declared elements hide exported elements.
- compiler.reportMessage(compiler.spanFromElement(existingElement),
- MessageKind.DUPLICATE_EXPORT.error([name]), api.Diagnostic.ERROR);
- compiler.reportMessage(compiler.spanFromElement(element),
- MessageKind.DUPLICATE_EXPORT.error([name]), api.Diagnostic.ERROR);
element = exportScope[name] = new ErroneousElement(
MessageKind.DUPLICATE_EXPORT, [name], name, library);
}
« no previous file with comments | « no previous file | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698