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

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

Issue 2846433003: Run closed_world2_test using the normal compiler pipeline. (Closed)
Patch Set: Updated cf. comments Created 3 years, 8 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
« no previous file with comments | « tests/compiler/dart2js/assert_message_throw_test.dart ('k') | tests/compiler/dart2js/compiler_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/compiler_helper.dart
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index 42ed72aba75acb4b338c8456c94081242532aeb3..c49d1182659f32b0d48689d2c357f6b76cd61cb0 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -9,7 +9,7 @@ import "package:expect/expect.dart";
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/elements/elements.dart' as lego;
+import 'package:compiler/src/elements/elements.dart';
export 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/js_backend/js_backend.dart' as js;
@@ -22,7 +22,6 @@ export 'package:compiler/src/diagnostics/messages.dart';
export 'package:compiler/src/diagnostics/source_span.dart';
export 'package:compiler/src/diagnostics/spannable.dart';
-import 'package:compiler/src/types/types.dart' as types;
export 'package:compiler/src/types/types.dart' show TypeMask;
import 'package:compiler/src/util/util.dart';
@@ -71,7 +70,8 @@ Future<String> compile(String code,
outputProvider: outputCollector);
await compiler.init();
compiler.parseScript(code);
- lego.Element element = compiler.mainApp.find(entry);
+ LibraryElement mainApp = compiler.mainApp;
+ MethodElement element = mainApp.find(entry);
if (element == null) return null;
compiler.phase = Compiler.PHASE_RESOLVING;
compiler.processQueue(compiler.enqueuer.resolution, element,
@@ -121,7 +121,8 @@ Future<String> compile(String code,
outputProvider: outputCollector);
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
- lego.Element element = compiler.mainApp.find(entry);
+ LibraryElement mainApp = compiler.mainApp;
+ Element element = mainApp.find(entry);
js.JavaScriptBackend backend = compiler.backend;
String generated = backend.getGeneratedCode(element);
if (check != null) {
@@ -158,8 +159,8 @@ Future<String> compileAll(String code,
});
}
-Future analyzeAndCheck(String code, String name,
- check(MockCompiler compiler, lego.Element element),
+Future analyzeAndCheck(
+ String code, String name, check(MockCompiler compiler, Element element),
{int expectedErrors, int expectedWarnings}) {
Uri uri = new Uri(scheme: 'source');
MockCompiler compiler = compilerFor(code, uri,
@@ -167,7 +168,7 @@ Future analyzeAndCheck(String code, String name,
expectedWarnings: expectedWarnings,
analyzeOnly: true);
return compiler.run(uri).then((_) {
- lego.Element element = findElement(compiler, name);
+ Element element = findElement(compiler, name);
return check(compiler, element);
});
}
@@ -189,8 +190,8 @@ Future compileSources(
});
}
-lego.Element findElement(compiler, String name, [Uri library]) {
- lego.LibraryElement lib = compiler.mainApp;
+Element findElement(compiler, String name, [Uri library]) {
+ LibraryElement lib = compiler.mainApp;
if (library != null) {
lib = compiler.libraryLoader.lookupLibrary(library);
Expect.isNotNull(lib, 'Could not locate library $library.');
« no previous file with comments | « tests/compiler/dart2js/assert_message_throw_test.dart ('k') | tests/compiler/dart2js/compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698