Chromium Code Reviews| Index: runtime/lib/mirrors_impl.dart |
| =================================================================== |
| --- runtime/lib/mirrors_impl.dart (revision 25132) |
| +++ runtime/lib/mirrors_impl.dart (working copy) |
| @@ -628,7 +628,18 @@ |
| String toString() => "FunctionTypeMirror on '${_n(simpleName)}'"; |
| } |
| +abstract class _LocalDeclarationMirrorImpl extends _LocalMirrorImpl |
| + implements DeclarationMirror { |
| + _LocalDeclarationMirrorImpl(this._reflectee); |
| + final _MirrorReference _reflectee; |
| + List<InstanceMirror> get metadata { |
| + // get the metadata objects, convert them into InstanceMirrors using |
|
siva
2013/07/18 20:46:15
"Get"
|
| + // reflect() and then make them into a Dart list |
|
siva
2013/07/18 20:46:15
missing "."
|
| + return _metadata(_reflectee).map(reflect).toList(); |
|
siva
2013/07/18 20:46:15
toList(false) here? does it need to be a growable
rmacnak
2013/07/18 21:04:50
Switched to fixed size.
|
| + } |
| +} |
| + |
| class _LazyTypeVariableMirror { |
| _LazyTypeVariableMirror(String variableName, this._owner) |
| : this._variableName = _s(variableName); |
| @@ -642,12 +653,14 @@ |
| final _LazyTypeMirror _owner; |
| } |
| -class _LocalTypeVariableMirrorImpl extends _LocalMirrorImpl |
| +class _LocalTypeVariableMirrorImpl extends _LocalDeclarationMirrorImpl |
| implements TypeVariableMirror { |
| - _LocalTypeVariableMirrorImpl(String simpleName, |
| + _LocalTypeVariableMirrorImpl(reflectee, |
| + String simpleName, |
| this._owner, |
| this._upperBound) |
| - : this.simpleName = _s(simpleName); |
| + : this.simpleName = _s(simpleName), |
| + super(reflectee); |
| final Symbol simpleName; |
| @@ -693,12 +706,14 @@ |
| } |
| -class _LocalTypedefMirrorImpl extends _LocalMirrorImpl |
| +class _LocalTypedefMirrorImpl extends _LocalDeclarationMirrorImpl |
| implements TypedefMirror { |
| - _LocalTypedefMirrorImpl(String simpleName, |
| + _LocalTypedefMirrorImpl(reflectee, |
| + String simpleName, |
| this._owner, |
| this._referent) |
| - : this.simpleName = _s(simpleName); |
| + : this.simpleName = _s(simpleName), |
| + super(reflectee); |
| final Symbol simpleName; |
| @@ -846,9 +861,9 @@ |
| native 'LibraryMirror_invokeSetter'; |
| } |
| -class _LocalMethodMirrorImpl extends _LocalMirrorImpl |
| +class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl |
| implements MethodMirror { |
| - _LocalMethodMirrorImpl(this._reflectee, |
| + _LocalMethodMirrorImpl(reflectee, |
| this._owner, |
| this.parameters, |
| this._returnType, |
| @@ -860,10 +875,8 @@ |
| this.isConstConstructor, |
| this.isGenerativeConstructor, |
| this.isRedirectingConstructor, |
| - this.isFactoryConstructor); |
| + this.isFactoryConstructor) : super(reflectee); |
| - final _MirrorReference _reflectee; |
| - |
| Symbol _simpleName = null; |
| Symbol get simpleName { |
| if (_simpleName == null) { |
| @@ -950,30 +963,23 @@ |
| final bool isRedirectingConstructor; |
| final bool isFactoryConstructor; |
| - List<InstanceMirror> get metadata { |
| - owner; // ensure owner is computed |
| - // get the metadata objects, convert them into InstanceMirrors using |
| - // reflect() and then make them into a Dart list |
| - return _metadata(_reflectee).map(reflect).toList(); |
| - } |
| - |
| String toString() => "MethodMirror on '${_n(simpleName)}'"; |
| static String _MethodMirror_name(reflectee) |
| native "MethodMirror_name"; |
| } |
| -class _LocalVariableMirrorImpl extends _LocalMirrorImpl |
| +class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl |
| implements VariableMirror { |
| - _LocalVariableMirrorImpl(this._reflectee, |
| + _LocalVariableMirrorImpl(reflectee, |
| String simpleName, |
| this._owner, |
| this._type, |
| this.isStatic, |
| this.isFinal) |
| - : this.simpleName = _s(simpleName); |
| + : this.simpleName = _s(simpleName), |
| + super(reflectee); |
| - final _MirrorReference _reflectee; |
| final Symbol simpleName; |
| Symbol _qualifiedName = null; |
| @@ -1016,12 +1022,6 @@ |
| final bool isStatic; |
| final bool isFinal; |
| - List<InstanceMirror> get metadata { |
| - // get the metadata objects, convert them into InstanceMirrors using |
| - // reflect() and then make them into a Dart list |
| - return _metadata(_reflectee).map(reflect).toList(); |
| - } |
| - |
| String toString() => "VariableMirror on '${_n(simpleName)}'"; |
| } |