Chromium Code Reviews| Index: sdk/lib/mirrors/mirrors.dart |
| diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart |
| index 0b9ebe52901ad6e493209ce56976a73721e9e9c7..ddf175bf1033491371ddf94188cd8a74f4305d54 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]. |
| @@ -656,6 +669,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/10/11 10:30:21
This is temporary, right?
rmacnak
2013/10/11 18:06:08
Right, this should also be subsumed by declaration
|
| + |
| + /** |
| * An immutable map from names to mirrors for all function, getter, |
| * and setter declarations in this library. |
| */ |
| @@ -720,8 +739,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; |
| @@ -954,13 +972,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; |
| } |
| /** |