Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 1072443005: Deal with type arguments of generic local functions in VM mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698