Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1250)

Unified Diff: runtime/lib/mirrors.cc

Issue 20465002: Implement ClassMirror.superclass with internal code for ordinary (but not function type) classes. R… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 25507)
+++ runtime/lib/mirrors.cc (working copy)
@@ -511,12 +511,7 @@
return type;
}
- // TODO(turnidge): Why am I getting Null when I expect Object?
- // TODO(gbracha): this is probably the root of bug 7868
- Dart_Handle super_class = Dart_GetSuperclass(intf);
- if (Dart_IsNull(super_class)) {
- super_class = Dart_GetClass(CoreLib(), NewString("Object"));
- }
+ Dart_Handle super_class = Dart_Null();
// TODO(turnidge): Simplify code, now that default classes have been removed.
Dart_Handle default_class = Dart_Null();
@@ -538,7 +533,7 @@
Dart_Null(), // "name"
Dart_NewBoolean(Dart_IsClass(intf)),
lib_mirror,
- CreateLazyMirror(super_class),
+ super_class,
CreateImplementsList(intf),
CreateLazyMirror(default_class),
constructor_map,
@@ -1037,6 +1032,12 @@
}
+DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
+ const Class& klass = Class::Handle(ref.GetClassReferent());
+ return klass.super_type();
+}
+
DEFINE_NATIVE_ENTRY(ClassMirror_members, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance,
owner_mirror,
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698