Index: test/codegen/lib/mirrors/invocation_cache_test.dart |
diff --git a/test/codegen/language/enum_mirror_test.dart b/test/codegen/lib/mirrors/invocation_cache_test.dart |
similarity index 50% |
copy from test/codegen/language/enum_mirror_test.dart |
copy to test/codegen/lib/mirrors/invocation_cache_test.dart |
index e85f121a01980d01bcf1b4a23f7b8db85a95a903..0d9624a8327b42bb4e049a388b92e7177291bf17 100644 |
--- a/test/codegen/language/enum_mirror_test.dart |
+++ b/test/codegen/lib/mirrors/invocation_cache_test.dart |
@@ -2,16 +2,18 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-// SharedOptions=--enable-enum |
- |
+@MirrorsUsed(targets: const ["A"]) |
import 'dart:mirrors'; |
import 'package:expect/expect.dart'; |
-enum Foo { BAR, BAZ } |
+class A { |
+ toString() => "A"; |
+} |
main() { |
- Expect.equals('Foo.BAR', Foo.BAR.toString()); |
- var name = reflect(Foo.BAR).invoke(#toString, []).reflectee; |
- Expect.equals('Foo.BAR', name); |
+ // The invocation cache must not find the 'toString' from JavaScript's |
+ // Object.prototype. |
+ var toString = reflect(new A()).getField(#toString).reflectee; |
+ Expect.equals("A", Function.apply(toString, [], {})); |
} |