Chromium Code Reviews| Index: runtime/lib/mirrors_impl.dart |
| =================================================================== |
| --- runtime/lib/mirrors_impl.dart (revision 23928) |
| +++ runtime/lib/mirrors_impl.dart (working copy) |
| @@ -70,6 +70,10 @@ |
| return result; |
| } |
| +List<InstanceMirror> _metadata(mirror) |
| + native 'Mirrors_metadata'; |
| + |
| + |
| class _LocalMirrorSystemImpl extends MirrorSystem { |
| // Change parameter back to "this.libraries" when native code is changed. |
| _LocalMirrorSystemImpl(Map<String, LibraryMirror> libraries, this.isolate) |
| @@ -163,6 +167,7 @@ |
| // language objects (except for objects of type VMReference, of |
| // course). |
| VMReference _reference; |
| + |
|
Ivan Posva
2013/06/14 15:16:48
Extra line?
gbracha
2013/06/14 20:42:46
Done.
|
| } |
| abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl |
| @@ -602,6 +607,8 @@ |
| } |
| } |
| + List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList(); |
|
Ivan Posva
2013/06/14 15:16:48
You might want to explain what you are using refle
gbracha
2013/06/14 20:42:46
Done.
|
| + |
| static _invokeConstructor(ref, constructorName, positionalArguments, async) |
| native 'LocalClassMirrorImpl_invokeConstructor'; |
| } |
| @@ -704,6 +711,8 @@ |
| return _upperBound; |
| } |
| + List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList(); |
| + |
| String toString() => "TypeVariableMirror on '$simpleName'"; |
| } |
| @@ -843,6 +852,9 @@ |
| return _variables; |
| } |
| + |
| + List<InstanceMirror> get metadata => _metadata(this).map(reflect).toList(); |
| + |
| String toString() => "LibraryMirror on '$simpleName'"; |
| } |
| @@ -943,6 +955,11 @@ |
| final bool isRedirectingConstructor; |
| final bool isFactoryConstructor; |
| + List<InstanceMirror> get metadata { |
| + owner; // ensure owner is computed |
| + return _metadata(this).map(reflect).toList(); |
| + } |
| + |
| String toString() => "MethodMirror on '$simpleName'"; |
| } |
| @@ -997,6 +1014,11 @@ |
| final bool isStatic; |
| final bool isFinal; |
| + List<InstanceMirror> get metadata { |
| + owner; // ensure owner is computed |
| + return _metadata(this).map(reflect).toList(); |
| + } |
| + |
| String toString() => "VariableMirror on '$simpleName'"; |
| } |