Index: pkg/dev_compiler/web/web_command.dart |
diff --git a/pkg/dev_compiler/web/web_command.dart b/pkg/dev_compiler/web/web_command.dart |
index 1df3255ec61bf74ce53e0bccdf0b22b16f40c8b0..34659afe8fb9ed911f4547e504a42537949dac66 100644 |
--- a/pkg/dev_compiler/web/web_command.dart |
+++ b/pkg/dev_compiler/web/web_command.dart |
@@ -17,7 +17,6 @@ import 'package:analyzer/dart/element/element.dart' |
import 'package:analyzer/file_system/file_system.dart' show ResourceUriResolver; |
import 'package:analyzer/file_system/memory_file_system.dart' |
show MemoryResourceProvider; |
-import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl; |
import 'package:analyzer/src/summary/idl.dart' show PackageBundle; |
import 'package:analyzer/src/summary/package_bundle_reader.dart' |
show SummaryDataStore, InSummaryUriResolver, InSummarySource; |
@@ -121,8 +120,6 @@ class WebCompileCommand extends Command { |
resourceProvider: resourceProvider, |
summaryData: summaryDataStore); |
- var context = compiler.context as AnalysisContextImpl; |
- |
var compilerOptions = new CompilerOptions.fromArguments(argResults); |
var resolveFn = (String url) { |
@@ -185,7 +182,7 @@ class WebCompileCommand extends Command { |
}; |
CompileModule compileFn = (String imports, String body, String libraryName, |
- String existingLibrary, String fileName) { |
+ String existingLibrary, String fileName) async { |
// Instead of returning a single function, return a pair of functions. |
// Create a new virtual File that contains the given Dart source. |
String sourceCode; |
@@ -195,12 +192,13 @@ class WebCompileCommand extends Command { |
var dir = path.dirname(existingLibrary); |
// Need to pull in all the imports from the existing library and |
// re-export all privates as privates in this library. |
- var source = context.sourceFactory.forUri(existingLibrary); |
+ var source = compiler.driver.sourceFactory.forUri(existingLibrary); |
if (source == null) { |
throw "Unable to load source for library $existingLibrary"; |
} |
- LibraryElement libraryElement = context.computeLibraryElement(source); |
+ var unitResult = await compiler.driver.getUnitElement(source.fullName); |
+ LibraryElement libraryElement = unitResult.element.library; |
if (libraryElement == null) { |
throw "Unable to get library element."; |
} |
@@ -253,7 +251,7 @@ class WebCompileCommand extends Command { |
var unit = new BuildUnit(libraryName, "", [fileName], _moduleForLibrary); |
- JSModuleFile module = compiler.compile(unit, compilerOptions); |
+ JSModuleFile module = await compiler.compile(unit, compilerOptions); |
var moduleCode = ''; |
if (module.isValid) { |