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

Side by Side Diff: tests/compiler/dart2js/inference/inference_test_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:compiler/src/common.dart'; 5 import 'package:compiler/src/common.dart';
6 import 'package:compiler/src/common_elements.dart'; 6 import 'package:compiler/src/common_elements.dart';
7 import 'package:compiler/src/compiler.dart'; 7 import 'package:compiler/src/compiler.dart';
8 import 'package:compiler/src/elements/elements.dart'; 8 import 'package:compiler/src/elements/elements.dart';
9 import 'package:compiler/src/elements/entities.dart'; 9 import 'package:compiler/src/elements/entities.dart';
10 import 'package:compiler/src/resolution/tree_elements.dart'; 10 import 'package:compiler/src/resolution/tree_elements.dart';
(...skipping 13 matching lines...) Expand all
24 /// annotation. Any [Id] left in the map will be reported as missing. 24 /// annotation. Any [Id] left in the map will be reported as missing.
25 checkCode(String annotatedCode, CheckMemberFunction checkMember, 25 checkCode(String annotatedCode, CheckMemberFunction checkMember,
26 {List<String> options: const <String>[]}) async { 26 {List<String> options: const <String>[]}) async {
27 AnnotatedCode code = new AnnotatedCode.fromText(annotatedCode, '/*', '*/'); 27 AnnotatedCode code = new AnnotatedCode.fromText(annotatedCode, '/*', '*/');
28 Map<Id, String> expectedMap = computeExpectedMap(code); 28 Map<Id, String> expectedMap = computeExpectedMap(code);
29 Compiler compiler = compilerFor( 29 Compiler compiler = compilerFor(
30 memorySourceFiles: {'main.dart': code.sourceCode}, options: options); 30 memorySourceFiles: {'main.dart': code.sourceCode}, options: options);
31 compiler.stopAfterTypeInference = true; 31 compiler.stopAfterTypeInference = true;
32 Uri mainUri = Uri.parse('memory:main.dart'); 32 Uri mainUri = Uri.parse('memory:main.dart');
33 await compiler.run(mainUri); 33 await compiler.run(mainUri);
34 LibraryElement mainApp = compiler.mainApp; 34 LibraryElement mainApp =
35 compiler.frontendStrategy.elementEnvironment.mainLibrary;
35 mainApp.forEachLocalMember((member) { 36 mainApp.forEachLocalMember((member) {
36 if (member.isClass) { 37 if (member.isClass) {
37 member.forEachLocalMember((member) { 38 member.forEachLocalMember((member) {
38 checkMember(compiler, expectedMap, member); 39 checkMember(compiler, expectedMap, member);
39 }); 40 });
40 } else if (member.isTypedef) { 41 } else if (member.isTypedef) {
41 // Skip. 42 // Skip.
42 } else { 43 } else {
43 checkMember(compiler, expectedMap, member); 44 checkMember(compiler, expectedMap, member);
44 } 45 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 visitSend(Send node) { 174 visitSend(Send node) {
174 checkSend(node); 175 checkSend(node);
175 visitNode(node); 176 visitNode(node);
176 } 177 }
177 178
178 visitSendSet(SendSet node) { 179 visitSendSet(SendSet node) {
179 checkSend(node); 180 checkSend(node);
180 visitNode(node); 181 visitNode(node);
181 } 182 }
182 } 183 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/expect_annotations_test.dart ('k') | tests/compiler/dart2js/instantiated_classes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698