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

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

Issue 2577423002: Further reduce use of Compiler.closedWorld. (Closed)
Patch Set: Created 4 years 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/type_inference8_test.dart ('k') | tests/compiler/dart2js/type_mask2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_inference_switch_test.dart
diff --git a/tests/compiler/dart2js/type_inference_switch_test.dart b/tests/compiler/dart2js/type_inference_switch_test.dart
index 181fc4156e5b8d99391848432aa28fc3b828d351..f28444bd21e2737f7328269ff5be35779222d5a5 100644
--- a/tests/compiler/dart2js/type_inference_switch_test.dart
+++ b/tests/compiler/dart2js/type_inference_switch_test.dart
@@ -133,17 +133,18 @@ main() {
Future runTest(String test, checker) {
Uri uri = new Uri(scheme: 'source');
var compiler = compilerFor(test, uri);
-
- checkTypeOf(String name, TypeMask type) {
- var commonMasks = compiler.closedWorld.commonMasks;
+ return compiler.run(uri).then((_) {
var typesInferrer = compiler.globalInference.typesInferrerInternal;
- var element = findElement(compiler, name);
- var mask = typesInferrer.getReturnTypeOfElement(element);
- Expect.equals(type, simplify(mask, compiler));
- }
+ var closedWorld = typesInferrer.closedWorld;
+ var commonMasks = closedWorld.commonMasks;
- return compiler.run(uri).then((_) {
- checker(compiler.closedWorld.commonMasks, checkTypeOf);
+ checkTypeOf(String name, TypeMask type) {
+ var element = findElement(compiler, name);
+ var mask = typesInferrer.getReturnTypeOfElement(element);
+ Expect.equals(type, simplify(mask, closedWorld));
+ }
+
+ checker(commonMasks, checkTypeOf);
});
}
« no previous file with comments | « tests/compiler/dart2js/type_inference8_test.dart ('k') | tests/compiler/dart2js/type_mask2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698