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

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
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 25478)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -450,6 +450,14 @@
var _superclass;
ClassMirror get superclass {
+ if (_superclass == null) {
+ Type supertype = _supertype(_reflectee);
siva 2013/07/25 21:54:12 var supertype?
+ 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";

Powered by Google App Engine
This is Rietveld 408576698