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

Unified Diff: runtime/lib/mirrors_impl.dart

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 | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 25507)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -450,6 +450,14 @@
var _superclass;
ClassMirror get superclass {
+ if (_superclass == null) {
+ Type supertype = _supertype(_reflectee);
+ if (supertype == null) {
+ // Object has no superclass.
+ return null;
+ }
+ _superclass = reflectClass(supertype);
+ }
if (_superclass is! Mirror) {
_superclass = _superclass.resolve(mirrors);
}
@@ -592,6 +600,9 @@
static _library(reflectee)
native "ClassMirror_library";
+ static _supertype(reflectee)
+ native "ClassMirror_supertype";
+
_computeMembers(reflectee)
native "ClassMirror_members";
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698