Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/DartCompiler.java |
| diff --git a/compiler/java/com/google/dart/compiler/DartCompiler.java b/compiler/java/com/google/dart/compiler/DartCompiler.java |
| index dd85e0b109ce94f4687c1b3210255d64f2e9e1f0..a199884fa04163b915519244ddd57427b3fe83b1 100644 |
| --- a/compiler/java/com/google/dart/compiler/DartCompiler.java |
| +++ b/compiler/java/com/google/dart/compiler/DartCompiler.java |
| @@ -619,6 +619,19 @@ public class DartCompiler { |
| if (SystemLibraryManager.isDartUri(lib.getSource().getUri())) { |
| continue; |
| } |
| + |
| + // check for #source uniqueness |
| + { |
| + Set<String> includedSourcePaths = Sets.newHashSet(); |
| + for (LibraryNode sourceNode : lib.getSourcePaths()) { |
| + String path = sourceNode.getText(); |
|
Brian Wilkerson
2012/06/12 15:34:14
I'm not sure this is correct. Don't we need to cat
scheglov
2012/06/12 18:17:51
Done.
|
| + if (includedSourcePaths.contains(path)) { |
| + context.onError(new DartCompilationError(sourceNode.getSourceInfo(), |
| + DartCompilerErrorCode.UNIT_WAS_ALREADY_INCLUDED, path)); |
| + } |
| + includedSourcePaths.add(path); |
| + } |
| + } |
| // check that each imported library has a library directive |
| for (LibraryUnit importedLib : lib.getImports()) { |
| @@ -673,6 +686,7 @@ public class DartCompiler { |
| continue; |
| } |
| DartSource dartSource = (DartSource) unit.getSourceInfo().getSource(); |
| + // check for directives |
| if (dartSource.getRelativePath().equals(sourceNode.getText())) { |
| context.onError(new DartCompilationError(unit.getDirectives().get(0), |
| DartCompilerErrorCode.ILLEGAL_DIRECTIVES_IN_SOURCED_UNIT, |