Chromium Code Reviews| Index: runtime/lib/mirrors.cc |
| diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc |
| index ed78b7bbfe150d5073e390c1a46cc88800bbbff1..a6386ca22e2a78ea23f01bb65562ee81ee6db973 100644 |
| --- a/runtime/lib/mirrors.cc |
| +++ b/runtime/lib/mirrors.cc |
| @@ -201,12 +201,20 @@ static RawInstance* CreateClassMirror(const Class& cls, |
| const Bool& is_generic = |
| (cls.NumTypeParameters() == 0) ? Bool::False() : Bool::True(); |
| + const Bool& is_mixin_typedef = |
| + cls.is_mixin_typedef() ? Bool::True() : Bool::False(); |
| - const Array& args = Array::Handle(Array::New(4)); |
| + const Array& args = Array::Handle(Array::New(5)); |
| args.SetAt(0, MirrorReference::Handle(MirrorReference::New(cls))); |
| args.SetAt(1, type); |
| - args.SetAt(2, String::Handle(cls.UserVisibleName())); |
| + // We do not set the names of anonymous mixin applications because the mirrors |
| + // use a different naming convention than the VM (lib.S with lib.M and S&M |
| + // respectively). |
| + if (Type::Handle(cls.mixin()).IsNull() || cls.is_mixin_typedef()) { |
|
siva
2013/08/26 04:30:27
if ((cls.mixin() == Type::null()) || cls.is_mixin_
rmacnak
2013/08/26 18:24:37
Done.
|
| + args.SetAt(2, String::Handle(cls.UserVisibleName())); |
| + } |
| args.SetAt(3, is_generic); |
| + args.SetAt(4, is_mixin_typedef); |
| return CreateMirror(Symbols::_LocalClassMirrorImpl(), args); |
| } |
| @@ -474,6 +482,13 @@ DEFINE_NATIVE_ENTRY(ClassMirror_interfaces, 1) { |
| } |
| +DEFINE_NATIVE_ENTRY(ClassMirror_mixin, 1) { |
| + GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| + const Class& klass = Class::Handle(ref.GetClassReferent()); |
| + return klass.mixin(); |
| +} |
| + |
| + |
| DEFINE_NATIVE_ENTRY(ClassMirror_members, 2) { |
| GET_NON_NULL_NATIVE_ARGUMENT(Instance, |
| owner_mirror, |