OLD | NEW |
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 14 matching lines...) Expand all Loading... |
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 = compiler.mainApp; |
35 mainApp.forEachLocalMember((member) { | 35 mainApp.forEachLocalMember((dynamic member) { |
36 if (member.isClass) { | 36 if (member.isClass) { |
37 member.forEachLocalMember((member) { | 37 member.forEachLocalMember((member) { |
38 checkMember(compiler, expectedMap, member); | 38 checkMember(compiler, expectedMap, member); |
39 }); | 39 }); |
40 } else if (member.isTypedef) { | 40 } else if (member.isTypedef) { |
41 // Skip. | 41 // Skip. |
42 } else { | 42 } else { |
43 checkMember(compiler, expectedMap, member); | 43 checkMember(compiler, expectedMap, member); |
44 } | 44 } |
45 }); | 45 }); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 visitSend(Send node) { | 173 visitSend(Send node) { |
174 checkSend(node); | 174 checkSend(node); |
175 visitNode(node); | 175 visitNode(node); |
176 } | 176 } |
177 | 177 |
178 visitSendSet(SendSet node) { | 178 visitSendSet(SendSet node) { |
179 checkSend(node); | 179 checkSend(node); |
180 visitNode(node); | 180 visitNode(node); |
181 } | 181 } |
182 } | 182 } |
OLD | NEW |