| Index: compiler/java/com/google/dart/compiler/DartCompiler.java
|
| ===================================================================
|
| --- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 6094)
|
| +++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
|
| @@ -1140,7 +1140,7 @@
|
| CompilerConfiguration config, DartArtifactProvider provider, DartCompilerListener listener)
|
| throws IOException {
|
| HashMap<URI, LibraryUnit> resolvedLibs = new HashMap<URI, LibraryUnit>();
|
| - return analyzeLibraries(lib, resolvedLibs, parsedUnits, config, provider, listener).get(lib.getUri());
|
| + return analyzeLibraries(lib, resolvedLibs, parsedUnits, config, provider, listener, false).get(lib.getUri());
|
| }
|
|
|
| /**
|
| @@ -1158,14 +1158,16 @@
|
| * invoked
|
| * @param provider A mechanism for specifying where code should be generated
|
| * @param listener An object notified when compilation errors occur
|
| + * @param resolveAllNewLibs <code>true</code> if all new libraries should be resolved
|
| + * or false if only the library specified by the "lib" parameter should be resolved
|
| * @throws NullPointerException if any of the arguments except {@code parsedUnits}
|
| * are {@code null}
|
| * @throws IOException on IO errors, which are not logged
|
| */
|
| public static Map<URI, LibraryUnit> analyzeLibraries(LibrarySource lib,
|
| Map<URI, LibraryUnit> resolvedLibs, Map<URI, DartUnit> parsedUnits,
|
| - CompilerConfiguration config, DartArtifactProvider provider, DartCompilerListener listener)
|
| - throws IOException {
|
| + CompilerConfiguration config, DartArtifactProvider provider, DartCompilerListener listener,
|
| + boolean resolveAllNewLibs) throws IOException {
|
| lib.getClass(); // Quick null check.
|
| provider.getClass(); // Quick null check.
|
| listener.getClass(); // Quick null check.
|
| @@ -1177,9 +1179,10 @@
|
|
|
| Map<URI, LibraryUnit> librariesToResolve;
|
| librariesToResolve = new HashMap<URI, LibraryUnit>();
|
| + if (resolveAllNewLibs) {
|
| + librariesToResolve.putAll(compiler.getLibraries());
|
| + }
|
| 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();
|
|
|