| Index: dart/tests/compiler/dart2js/mirrors_used_test.dart
|
| diff --git a/dart/tests/compiler/dart2js/mirrors_used_test.dart b/dart/tests/compiler/dart2js/mirrors_used_test.dart
|
| index 09fdd29c9b883a28848d4f775b1914e9865e1c14..f3719a5cdc3353b294c976bc46c93e478eb3b18f 100644
|
| --- a/dart/tests/compiler/dart2js/mirrors_used_test.dart
|
| +++ b/dart/tests/compiler/dart2js/mirrors_used_test.dart
|
| @@ -48,7 +48,7 @@ void main() {
|
| // 2. Some code was refactored, and there are more methods.
|
| // Either situation could be problematic, but in situation 2, it is often
|
| // acceptable to increase [expectedMethodCount] a little.
|
| - int expectedMethodCount = 315;
|
| + int expectedMethodCount = 317;
|
| Expect.isTrue(
|
| generatedCode.length <= expectedMethodCount,
|
| 'Too many compiled methods: '
|
| @@ -56,11 +56,15 @@ void main() {
|
|
|
| for (var library in compiler.libraries.values) {
|
| library.forEachLocalMember((member) {
|
| - if (library == compiler.mainApp) {
|
| - // TODO(ahe): We currently retain the entire library. Update this test
|
| - // to test that only Foo is retained.
|
| + if (library == compiler.mainApp
|
| + && member.name == const SourceString('Foo')) {
|
| Expect.isTrue(
|
| compiler.backend.isNeededForReflection(member), '$member');
|
| + member.forEachLocalMember((classMember) {
|
| + Expect.isTrue(
|
| + compiler.backend.isNeededForReflection(classMember),
|
| + '$classMember');
|
| + });
|
| } else {
|
| Expect.isFalse(
|
| compiler.backend.isNeededForReflection(member), '$member');
|
| @@ -76,7 +80,14 @@ import 'dart:mirrors';
|
|
|
| import 'library.dart';
|
|
|
| -class Foo {}
|
| +class Foo {
|
| + int field;
|
| + instanceMethod() {}
|
| + static staticMethod() {}
|
| +}
|
| +
|
| +unusedFunction() {
|
| +}
|
|
|
| main() {
|
| useReflect(Foo);
|
|
|