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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 24005002: Make TypedefMirror a direct descendant of TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 858b2eef12ed0be2d6b87b3f3156476ac63068f8..d494de434959983938218fb9455e7a17e993b7f8 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -269,7 +269,7 @@ class _LocalInstanceMirrorImpl extends _LocalObjectMirrorImpl
if (_type == null) {
// Note it not safe to use reflectee.runtimeType because runtimeType may
// be overridden.
- _type = _Mirrors._reflectType(_computeType(reflectee));
+ _type = reflectType(_computeType(reflectee));
}
return _type;
}
@@ -488,7 +488,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
// Object has no superclass.
return null;
}
- _trueSuperclassField = _Mirrors._reflectType(supertype);
+ _trueSuperclassField = reflectType(supertype);
}
return _trueSuperclassField;
}
@@ -500,7 +500,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
List<ClassMirror> get superinterfaces {
if (_superinterfaces == null) {
_superinterfaces = _interfaces(_reflectee)
- .map((i) => _Mirrors._reflectType(i)).toList(growable:false);
+ .map((i) => reflectType(i)).toList(growable:false);
}
return _superinterfaces;
}
@@ -529,7 +529,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
// The reflectee is not a mixin application.
_mixin = this;
} else {
- _mixin = _Mirrors._reflectType(mixinType);
+ _mixin = reflectType(mixinType);
}
}
}
@@ -751,7 +751,7 @@ class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl
TypeMirror get returnType {
if (_returnType == null) {
_returnType =
- _Mirrors._reflectType(_FunctionTypeMirror_return_type(_reflectee));
+ reflectType(_FunctionTypeMirror_return_type(_reflectee));
}
return _returnType;
}
@@ -837,8 +837,7 @@ class _LocalTypeVariableMirrorImpl extends _LocalDeclarationMirrorImpl
TypeMirror _upperBound = null;
TypeMirror get upperBound {
if (_upperBound == null) {
- _upperBound =
- _Mirrors._reflectType(_TypeVariableMirror_upper_bound(_reflectee));
+ _upperBound = reflectType(_TypeVariableMirror_upper_bound(_reflectee));
}
return _upperBound;
}
@@ -935,6 +934,14 @@ class _LocalLibraryMirrorImpl extends _LocalObjectMirrorImpl
return _members;
}
+ Map<Symbol, ClassMirror> _types;
+ Map<Symbol, TypeMirror> get types {
+ if (_types == null) {
+ _types = _filterMap(members, (key, value) => (value is TypeMirror));
+ }
+ return _types;
+ }
+
Map<Symbol, ClassMirror> _classes;
Map<Symbol, ClassMirror> get classes {
if (_classes == null) {
@@ -1061,8 +1068,7 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl
if (isConstructor) {
_returnType = owner;
} else {
- _returnType =
- _Mirrors._reflectType(_MethodMirror_return_type(_reflectee));
+ _returnType = reflectType(_MethodMirror_return_type(_reflectee));
}
}
return _returnType;
@@ -1157,7 +1163,7 @@ class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl
TypeMirror _type;
TypeMirror get type {
if (_type == null) {
- _type = _Mirrors._reflectType(_VariableMirror_type(_reflectee));
+ _type = reflectType(_VariableMirror_type(_reflectee));
}
return _type;
}
@@ -1213,8 +1219,7 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
TypeMirror _type = null;
TypeMirror get type {
if (_type == null) {
- _type =
- _Mirrors._reflectType(_ParameterMirror_type(_reflectee, _position));
+ _type = reflectType(_ParameterMirror_type(_reflectee, _position));
}
return _type;
}
@@ -1302,7 +1307,7 @@ class _Mirrors {
native "Mirrors_makeLocalTypeMirror";
static Expando<ClassMirror> _declarationCache = new Expando("ClassMirror");
- static Expando<ClassMirror> _instanitationCache = new Expando("TypeMirror");
+ static Expando<TypeMirror> _instanitationCache = new Expando("TypeMirror");
static ClassMirror reflectClass(Type key) {
var classMirror = _declarationCache[key];
@@ -1316,7 +1321,7 @@ class _Mirrors {
return classMirror;
}
- static TypeMirror _reflectType(Type key) {
+ static TypeMirror reflectType(Type key) {
var typeMirror = _instanitationCache[key];
if (typeMirror == null) {
typeMirror = makeLocalTypeMirror(key);

Powered by Google App Engine
This is Rietveld 408576698