Deal with "classes" that don't belong to any library. Addresses issue 12231.

Review URL: https://codereview.chromium.org/22043005/



git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25785 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
rmacnak@google.com 2013-08-05 18:54:01 +00:00
parent 09bcdc6d6d
commit ce55909b63

View file

@ -362,7 +362,13 @@ DEFINE_NATIVE_ENTRY(ClassMirror_name, 1) {
DEFINE_NATIVE_ENTRY(ClassMirror_library, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
const Class& klass = Class::Handle(ref.GetClassReferent());
return CreateLibraryMirror(Library::Handle(klass.library()));
const Library& library = Library::Handle(klass.library());
// TODO(rmacnak): Revisit when we decide what to do about
// reflectClass(dynamic).
if (library.IsNull()) {
return Instance::null();
}
return CreateLibraryMirror(library);
}