| 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 5e462ba5ce179b868e96ea79542f483a2586e48e..385d3c7c35db3efe76c1dcb54f49df1cbf0791c0 100644
|
| --- a/compiler/java/com/google/dart/compiler/DartCompiler.java
|
| +++ b/compiler/java/com/google/dart/compiler/DartCompiler.java
|
| @@ -637,13 +637,23 @@ public class DartCompiler {
|
| }
|
| }
|
|
|
| - // Validate import prefixes.
|
| + // Validate imports.
|
| + boolean hasIO = false;
|
| + boolean hasHTML = false;
|
| for (LibraryNode importNode : lib.getImportPaths()) {
|
| String prefix = importNode.getPrefix();
|
| + hasIO |= "dart:io".equals(importNode.getText());
|
| + hasHTML |= "dart:html".equals(importNode.getText());
|
| + // validate import prefix
|
| if (DartParser.PSEUDO_KEYWORDS_SET.contains(prefix)) {
|
| context.onError(new DartCompilationError(importNode.getSourceInfo(),
|
| ResolverErrorCode.BUILT_IN_IDENTIFIER_AS_IMPORT_PREFIX, prefix));
|
| }
|
| + // validate console/web mix
|
| + if (hasIO && hasHTML) {
|
| + context.onError(new DartCompilationError(importNode.getSourceInfo(),
|
| + DartCompilerErrorCode.CONSOLE_WEB_MIX));
|
| + }
|
| }
|
|
|
| // check that each imported library has a library directive
|
|
|