| Index: compiler/java/com/google/dart/compiler/DartCompiler.java
|
| ===================================================================
|
| --- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 5878)
|
| +++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
|
| @@ -1160,16 +1160,26 @@
|
| DartCompilerMainContext context = new DartCompilerMainContext(lib, provider, listener, config);
|
| Compiler compiler = new SelectiveCompiler(lib, resolvedLibs, parsedUnits, config, context);
|
|
|
| - compiler.updateAndResolve();
|
| + LibraryUnit topLibUnit = compiler.updateAndResolve();
|
|
|
| + Map<URI, LibraryUnit> librariesToResolve;
|
| + librariesToResolve = new HashMap<URI, LibraryUnit>();
|
| + librariesToResolve.put(topLibUnit.getSource().getUri(), topLibUnit);
|
| + // TODO (danrubel) revisit when AnalysisServer is turned on
|
| + // librariesToResolve.putAll(compiler.getLibraries());
|
| +
|
| DartCompilationPhase[] phases = {new Resolver.Phase(), new TypeAnalyzer()};
|
| Map<URI, LibraryUnit> newLibraries = Maps.newHashMap();
|
| - for (Entry<URI, LibraryUnit> entry : compiler.getLibraries().entrySet()) {
|
| + for (Entry<URI, LibraryUnit> entry : librariesToResolve.entrySet()) {
|
| URI libUri = entry.getKey();
|
| LibraryUnit libUnit = entry.getValue();
|
| if (!resolvedLibs.containsKey(libUri) && libUnit != null) {
|
| newLibraries.put(libUri, libUnit);
|
| for (DartUnit unit : libUnit.getUnits()) {
|
| + // Don't analyze diet units.
|
| + if (unit.isDiet()) {
|
| + continue;
|
| + }
|
| for (DartCompilationPhase phase : phases) {
|
| unit = phase.exec(unit, context, compiler.getTypeProvider());
|
| // Ignore errors. Resolver and TypeAnalyzer should be able to cope with
|
|
|