Chromium Code Reviews| Index: sdk/lib/mirrors/mirrors.dart |
| diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart |
| index 313026f26ee74379a00199a0e78258661820fd51..136507e24de3af1f70648e8509abaef4ce20b929 100644 |
| --- a/sdk/lib/mirrors/mirrors.dart |
| +++ b/sdk/lib/mirrors/mirrors.dart |
| @@ -135,8 +135,8 @@ external InstanceMirror reflect(Object reflectee); |
| * This function returns a [ClassMirror] reflecting *C*. |
| * |
| * If [key] is not an instance of [Type] then this function |
| - * throws an [ArgumentError]. If [key] is the Type dynamic, |
| - * throws an [ArgumentError] because dynamic is not a class. |
| + * throws an [ArgumentError]. If [key] is the Type for dynamic |
| + * or a function typedef, throws an [ArgumentError]. |
| * |
| * Note that since one cannot obtain a [Type] object from |
| * another isolate, this function can only be used to |
| @@ -145,6 +145,19 @@ external InstanceMirror reflect(Object reflectee); |
| external ClassMirror reflectClass(Type key); |
| /** |
| + * This function returns a [TypeMirror] reflecting the type |
| + * represented by [key]. |
| + * |
| + * If [key] is not an instance of [Type] then this function |
| + * throws an [ArgumentError]. |
| + * |
| + * Note that since one cannot obtain a [Type] object from |
| + * another isolate, this function can only be used to |
| + * obtain type mirrors on types of the current isolate. |
| + */ |
| +external TypeMirror reflectType(Type key); |
| + |
| +/** |
| * A [Mirror] reflects some Dart language entity. |
| * |
| * Every [Mirror] originates from some [MirrorSystem]. |
| @@ -630,6 +643,12 @@ abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { |
| Map<Symbol, ClassMirror> get classes; |
| /** |
| + * An immutable map from names to mirrors for all type |
| + * declarations in this library. |
| + */ |
| + Map<Symbol, TypeMirror> get types; |
|
ahe
2013/09/05 20:48:26
I assume this goes away again after the "mirrors o
rmacnak
2013/09/05 22:43:29
Right, this would be covered by LibraryMirror.decl
|
| + |
| + /** |
| * An immutable map from names to mirrors for all function, getter, |
| * and setter declarations in this library. |
| */ |
| @@ -694,8 +713,7 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror { |
| /** |
| * A mirror on the superclass on the reflectee. |
| * |
| - * If this type is [:Object:] or a typedef, the superClass will be |
| - * null. |
| + * If this type is [:Object:], the superClass will be null. |
| */ |
| ClassMirror get superclass; |
| @@ -930,13 +948,13 @@ abstract class TypeVariableMirror extends TypeMirror { |
| /** |
| * A [TypedefMirror] represents a typedef in a Dart language program. |
| */ |
| -abstract class TypedefMirror implements ClassMirror { |
| +abstract class TypedefMirror implements TypeMirror { |
| /** |
| * The defining type for this typedef. |
| * |
| - * For instance [:void f(int):] is the value for [:typedef void f(int):]. |
| + * For instance [:void f(int):] is the referent for [:typedef void f(int):]. |
| */ |
| - TypeMirror get value; |
| + TypeMirror get referent; |
| } |
| /** |