Index: runtime/lib/mirrors_impl.dart |
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart |
index 2cbb083de8c9753b2449fce7319ce445dae20c75..63b9c597651810bc3b6e16c326a80705755c3917 100644 |
--- a/runtime/lib/mirrors_impl.dart |
+++ b/runtime/lib/mirrors_impl.dart |
@@ -1357,6 +1357,7 @@ class _LocalCombinatorMirror extends _LocalMirror implements CombinatorMirror { |
class _LocalMethodMirror extends _LocalDeclarationMirror |
implements MethodMirror { |
+ final _instantiatorForLocal; |
regis
2015/04/08 20:58:06
I do not understand the meaning of "ForLocal".
rmacnak
2015/04/08 21:35:05
I was only setting this for local functions, then
|
final bool isStatic; |
final bool isAbstract; |
final bool isGetter; |
@@ -1374,6 +1375,7 @@ class _LocalMethodMirror extends _LocalDeclarationMirror |
_LocalMethodMirror(reflectee, |
String simpleName, |
this._owner, |
+ this._instantiatorForLocal, |
this.isStatic, |
this.isAbstract, |
this.isGetter, |
@@ -1391,7 +1393,7 @@ class _LocalMethodMirror extends _LocalDeclarationMirror |
// For nested closures it is possible, that the mirror for the owner has not |
// been created yet. |
if (_owner == null) { |
- _owner = _MethodMirror_owner(_reflectee); |
+ _owner = _MethodMirror_owner(_reflectee, _instantiatorForLocal); |
} |
return _owner; |
} |
@@ -1403,6 +1405,9 @@ class _LocalMethodMirror extends _LocalDeclarationMirror |
bool get isSynthetic => false; |
Type get _instantiator { |
+ if (_instantiatorForLocal != null) { |
+ return _instantiatorForLocal; |
+ } |
var o = owner; |
while (o is MethodMirror) o = o.owner; |
return o._instantiator; |
@@ -1473,7 +1478,7 @@ class _LocalMethodMirror extends _LocalDeclarationMirror |
String toString() => "MethodMirror on '${MirrorSystem.getName(simpleName)}'"; |
- static dynamic _MethodMirror_owner(reflectee) |
+ static dynamic _MethodMirror_owner(reflectee, instantiator) |
native "MethodMirror_owner"; |
static dynamic _MethodMirror_return_type(reflectee, instantiator) |
@@ -1571,9 +1576,7 @@ class _LocalParameterMirror extends _LocalVariableMirror |
} |
Type get _instantiator { |
- var o = owner; |
- while (o is MethodMirror) o = o.owner; |
- return o._instantiator; |
+ return owner._instantiator; |
} |
TypeMirror _type = null; |