Chromium Code Reviews| Index: runtime/lib/mirrors_impl.dart |
| diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart |
| index 450aa2dfc20f450b9c668e33bf0944ed473ef239..af03910617ecc8cd35d051be06dfdfc052a45bf6 100644 |
| --- a/runtime/lib/mirrors_impl.dart |
| +++ b/runtime/lib/mirrors_impl.dart |
| @@ -103,7 +103,7 @@ class _LocalMirrorSystemImpl extends MirrorSystem { |
| TypeMirror get dynamicType { |
| if (_dynamicType == null) { |
| - _dynamicType = new _SpecialTypeMirrorImpl(_s('dynamic')); |
| + _dynamicType = new _SpecialTypeMirrorImpl('dynamic'); |
| } |
| return _dynamicType; |
| } |
| @@ -112,7 +112,7 @@ class _LocalMirrorSystemImpl extends MirrorSystem { |
| TypeMirror get voidType { |
| if (_voidType == null) { |
| - _voidType = new _SpecialTypeMirrorImpl(_s('void')); |
| + _voidType = new _SpecialTypeMirrorImpl('void'); |
| } |
| return _voidType; |
| } |
| @@ -872,7 +872,6 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl |
| _LocalMethodMirrorImpl(reflectee, |
| this._owner, |
| this.parameters, |
| - this._returnType, |
| this.isStatic, |
| this.isAbstract, |
| this.isGetter, |
| @@ -925,10 +924,12 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl |
| 'MethodMirror.location is not implemented'); |
| } |
| - var _returnType; |
| + TypeMirror _returnType = null; |
| TypeMirror get returnType { |
| - if (_returnType is! Mirror) { |
| - _returnType = _returnType.resolve(mirrors); |
| + if (isConstructor) { |
|
rmacnak
2013/07/19 20:37:22
What if _returnType isn't null? This will fetch it
Michael Lippautz (Google)
2013/07/19 20:53:01
Fixed.
|
| + _returnType = _owner; |
| + } else { |
| + _returnType = _MethodMirror_return_type(_reflectee); |
| } |
| return _returnType; |
| } |
| @@ -982,6 +983,9 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl |
| static dynamic _MethodMirror_owner(reflectee) |
| native "MethodMirror_owner"; |
| + |
| + static dynamic _MethodMirror_return_type(reflectee) |
| + native "MethodMirror_return_type"; |
| } |
| class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl |
| @@ -1066,7 +1070,7 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl |
| class _SpecialTypeMirrorImpl extends _LocalMirrorImpl |
| implements TypeMirror, DeclarationMirror { |
| - _SpecialTypeMirrorImpl(this.simpleName); |
| + _SpecialTypeMirrorImpl(String name) : simpleName = _s(name); |
| final bool isPrivate = false; |
| final bool isTopLevel = true; |