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

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: rebase 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 e20aa8874d603d414c29eaca193a54e8a4bcd9d7..8ebba3127eaf75aff814b8cbb11cdb233c8164a0 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;
}
@@ -498,7 +498,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
// Object has no superclass.
return null;
}
- _trueSuperclassField = _Mirrors._reflectType(supertype);
+ _trueSuperclassField = reflectType(supertype);
}
return _trueSuperclassField;
}
@@ -510,7 +510,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;
}
@@ -539,7 +539,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
// The reflectee is not a mixin application.
_mixin = this;
} else {
- _mixin = _Mirrors._reflectType(mixinType);
+ _mixin = reflectType(mixinType);
}
}
}
@@ -761,7 +761,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;
}
@@ -847,8 +847,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;
}
@@ -945,6 +944,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) {
@@ -1071,8 +1078,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;
@@ -1167,7 +1173,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;
}
@@ -1223,8 +1229,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;
}
@@ -1312,7 +1317,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];
@@ -1326,7 +1331,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