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

Unified Diff: tests/compiler/dart2js/inference/inference_test_helper.dart

Issue 2951723002: Add closure_test for kernel based members (Closed)
Patch Set: Cleanup 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/inference/inference_test_helper.dart
diff --git a/tests/compiler/dart2js/inference/inference_test_helper.dart b/tests/compiler/dart2js/inference/inference_test_helper.dart
index 0824374b6d2147804eb38d16c92128a65a887f3b..746babc66c206f614cc7522298e249a940fa79fb 100644
--- a/tests/compiler/dart2js/inference/inference_test_helper.dart
+++ b/tests/compiler/dart2js/inference/inference_test_helper.dart
@@ -12,26 +12,31 @@ import 'package:compiler/src/types/types.dart';
import '../equivalence/id_equivalence.dart';
import '../equivalence/id_equivalence_helper.dart';
-void checkMemberAstTypeMasks(
- Compiler compiler, Map<Id, String> expectedMap, MemberEntity _member) {
+/// Compute type inference data for [_member] as a [MemberElement].
+///
+/// Fills [actualMap] with the data and [sourceSpanMap] with the source spans
+/// for the data origin.
+void computeMemberAstTypeMasks(Compiler compiler, MemberEntity _member,
+ Map<Id, String> actualMap, Map<Id, Spannable> spannableMap) {
MemberElement member = _member;
ResolvedAst resolvedAst = member.resolvedAst;
if (resolvedAst.kind != ResolvedAstKind.PARSED) return;
compiler.reporter.withCurrentElement(member.implementation, () {
- new TypeMaskChecker(compiler.reporter, expectedMap, resolvedAst,
- compiler.globalInference.results)
- .check();
+ new TypeMaskComputer(compiler.reporter, actualMap, spannableMap,
+ resolvedAst, compiler.globalInference.results)
+ .run();
});
}
-class TypeMaskChecker extends AbstractResolvedAstChecker {
+/// AST visitor for computing inference data for a member.
+class TypeMaskComputer extends AbstractResolvedAstComputer {
final GlobalTypeInferenceResults results;
final GlobalTypeInferenceElementResult result;
- TypeMaskChecker(DiagnosticReporter reporter, Map<Id, String> expectedMap,
- ResolvedAst resolvedAst, this.results)
+ TypeMaskComputer(DiagnosticReporter reporter, Map<Id, String> actualMap,
+ Map<Id, Spannable> spannableMap, ResolvedAst resolvedAst, this.results)
: result = results.resultOfMember(resolvedAst.element as MemberElement),
- super(reporter, expectedMap, resolvedAst);
+ super(reporter, actualMap, spannableMap, resolvedAst);
@override
String computeElementValue(AstElement element) {
« no previous file with comments | « tests/compiler/dart2js/equivalence/id_equivalence_test.dart ('k') | tests/compiler/dart2js/inference/send_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698