| Index: runtime/lib/mirrors.cc
|
| diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
|
| index e0c8b2327c4e75efe5ff64fc4e49c3e10a4ee74f..7fa930bfa2acd843712c018aecaa477bff3662f3 100644
|
| --- a/runtime/lib/mirrors.cc
|
| +++ b/runtime/lib/mirrors.cc
|
| @@ -199,12 +199,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()) {
|
| + args.SetAt(2, String::Handle(cls.UserVisibleName()));
|
| + }
|
| args.SetAt(3, is_generic);
|
| + args.SetAt(4, is_mixin_typedef);
|
| return CreateMirror(Symbols::_LocalClassMirrorImpl(), args);
|
| }
|
|
|
| @@ -466,6 +474,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,
|
|
|