Index: tests/compiler/dart2js/compiler_helper.dart |
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart |
index 5cae2250f1bb3ee93eee46c0d6b3af9c96f38eb7..bf584780df629e6340f5704ef0475f9357c90070 100644 |
--- a/tests/compiler/dart2js/compiler_helper.dart |
+++ b/tests/compiler/dart2js/compiler_helper.dart |
@@ -9,6 +9,8 @@ import "package:expect/expect.dart"; |
import 'package:compiler/compiler_new.dart'; |
+import 'package:compiler/src/common_elements.dart'; |
+ |
import 'package:compiler/src/elements/elements.dart'; |
export 'package:compiler/src/elements/elements.dart'; |
@@ -74,19 +76,17 @@ Future<String> compile(String code, |
outputProvider: outputCollector); |
await compiler.init(); |
compiler.parseScript(code); |
- LibraryElement mainApp = compiler.mainApp; |
- MethodElement element = mainApp.find(entry); |
+ ElementEnvironment elementEnvironment = |
+ compiler.frontendStrategy.elementEnvironment; |
+ MethodElement element = compiler.mainApp.find(entry); |
if (element == null) return null; |
compiler.phase = Compiler.PHASE_RESOLVING; |
- compiler.processQueue( |
- compiler.frontendStrategy.elementEnvironment, |
- compiler.enqueuer.resolution, |
- element, |
- compiler.libraryLoader.libraries); |
+ compiler.processQueue(elementEnvironment, compiler.enqueuer.resolution, |
+ element, compiler.libraryLoader.libraries); |
ResolutionWorkItem resolutionWork = |
new ResolutionWorkItem(compiler.resolution, element); |
resolutionWork.run(); |
- ClosedWorld closedWorld = compiler.closeResolution().closedWorld; |
+ ClosedWorld closedWorld = compiler.closeResolution(element).closedWorld; |
CodegenWorkItem work = |
new ElementCodegenWorkItem(compiler.backend, closedWorld, element); |
compiler.phase = Compiler.PHASE_COMPILING; |
@@ -129,7 +129,8 @@ Future<String> compile(String code, |
outputProvider: outputCollector); |
Expect.isTrue(result.isSuccess); |
Compiler compiler = result.compiler; |
- LibraryElement mainApp = compiler.mainApp; |
+ LibraryElement mainApp = |
+ compiler.frontendStrategy.elementEnvironment.mainLibrary; |
Element element = mainApp.find(entry); |
js.JavaScriptBackend backend = compiler.backend; |
String generated = backend.getGeneratedCode(element); |
@@ -199,7 +200,7 @@ Future compileSources( |
} |
Element findElement(compiler, String name, [Uri library]) { |
- LibraryElement lib = compiler.mainApp; |
+ LibraryElement lib = compiler.frontendStrategy.elementEnvironment.mainLibrary; |
if (library != null) { |
lib = compiler.libraryLoader.lookupLibrary(library); |
Expect.isNotNull(lib, 'Could not locate library $library.'); |