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

Unified Diff: tests/compiler/dart2js/expect_annotations_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
Index: tests/compiler/dart2js/expect_annotations_test.dart
diff --git a/tests/compiler/dart2js/expect_annotations_test.dart b/tests/compiler/dart2js/expect_annotations_test.dart
index c9c47e0fdd146a566f7190313b47d26d65a24bb9..6399e5242a28c761357c8b233f115d2562f7606d 100644
--- a/tests/compiler/dart2js/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/expect_annotations_test.dart
@@ -8,6 +8,7 @@ import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/js_backend/js_backend.dart';
import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/world.dart' show ClosedWorld;
import 'type_mask_test_helper.dart';
import 'memory_compiler.dart';
@@ -51,6 +52,7 @@ main() {
CompilationResult result =
await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
Compiler compiler = result.compiler;
+ ClosedWorld closedWorld = compiler.closedWorld;
Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
JavaScriptBackend backend = compiler.backend;
Expect.isNotNull(backend.annotations.expectNoInlineClass,
@@ -65,12 +67,12 @@ main() {
for (ParameterElement parameter in function.parameters) {
TypeMask type = inferrer.getTypeOfElement(parameter);
Expect.equals(
- expectedParameterType, simplify(type, compiler), "$parameter");
+ expectedParameterType, simplify(type, closedWorld), "$parameter");
}
if (expectedReturnType != null) {
TypeMask type = inferrer.getReturnTypeOfElement(function);
Expect.equals(
- expectedReturnType, simplify(type, compiler), "$function");
+ expectedReturnType, simplify(type, closedWorld), "$function");
}
}
@@ -97,15 +99,15 @@ main() {
testTypeMatch(
method, expectedParameterType, expectedReturnType, inferrer);
} else if (expectAssumeDynamic) {
- testTypeMatch(method, compiler.closedWorld.commonMasks.dynamicType,
- null, inferrer);
+ testTypeMatch(
+ method, closedWorld.commonMasks.dynamicType, null, inferrer);
}
}
- TypeMask jsStringType = compiler.closedWorld.commonMasks.stringType;
- TypeMask jsIntType = compiler.closedWorld.commonMasks.intType;
- TypeMask coreStringType = new TypeMask.subtype(
- compiler.coreClasses.stringClass, compiler.closedWorld);
+ TypeMask jsStringType = closedWorld.commonMasks.stringType;
+ TypeMask jsIntType = closedWorld.commonMasks.intType;
+ TypeMask coreStringType =
+ new TypeMask.subtype(compiler.coreClasses.stringClass, closedWorld);
test('method');
test('methodAssumeDynamic', expectAssumeDynamic: true);
« no previous file with comments | « tests/compiler/dart2js/dictionary_types_test.dart ('k') | tests/compiler/dart2js/field_type_simple_inferer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698