Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: tests/compiler/dart2js/compiler_helper.dart

Issue 2936233003: Remove Compiler.mainApp and Compiler.mainFunction (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.');
« no previous file with comments | « tests/compiler/dart2js/benign_error_test.dart ('k') | tests/compiler/dart2js/constant_expression_evaluate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698