Chromium Code Reviews| Index: runtime/lib/mirrors_impl.dart |
| diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart |
| index 0a839fbd68df7229e85528e19b61b53ba26c558e..37fbc78c238e13c134f318f6214028343eb2d237 100644 |
| --- a/runtime/lib/mirrors_impl.dart |
| +++ b/runtime/lib/mirrors_impl.dart |
| @@ -945,7 +945,8 @@ class _LocalClassMirror extends _LocalObjectMirror |
| class _LocalFunctionTypeMirror extends _LocalClassMirror |
| implements FunctionTypeMirror { |
| - _LocalFunctionTypeMirror(reflectee, reflectedType) |
| + final _functionReflectee; |
| + _LocalFunctionTypeMirror(reflectee, this._functionReflectee, reflectedType) |
| : super(reflectee, reflectedType, null, null, false, false, false, false, false); |
| bool get _isAnonymousMixinApplication => false; |
| @@ -962,7 +963,7 @@ class _LocalFunctionTypeMirror extends _LocalClassMirror |
| MethodMirror _callMethod; |
| MethodMirror get callMethod { |
|
rmacnak
2016/01/19 19:27:11
return declarations[#call];
and delete last line
rmacnak
2016/01/19 22:00:10
Nevermind, sorry. Keep your original change. I thi
regis
2016/01/19 23:15:29
Acknowledged.
|
| if (_callMethod == null) { |
| - _callMethod = this._FunctionTypeMirror_call_method(_reflectee); |
| + _callMethod = _FunctionTypeMirror_call_method(_functionReflectee); |
| } |
| return _callMethod; |
| } |
| @@ -971,7 +972,7 @@ class _LocalFunctionTypeMirror extends _LocalClassMirror |
| TypeMirror get returnType { |
| if (_returnType == null) { |
| _returnType = reflectType( |
| - _FunctionTypeMirror_return_type(_reflectee, _instantiator)); |
| + _FunctionTypeMirror_return_type(_functionReflectee, _instantiator)); |
| } |
| return _returnType; |
| } |
| @@ -979,7 +980,7 @@ class _LocalFunctionTypeMirror extends _LocalClassMirror |
| List<ParameterMirror> _parameters = null; |
| List<ParameterMirror> get parameters { |
| if (_parameters == null) { |
| - _parameters = _FunctionTypeMirror_parameters(_reflectee); |
| + _parameters = _FunctionTypeMirror_parameters(_functionReflectee); |
| _parameters = new UnmodifiableListView(_parameters); |
| } |
| return _parameters; |
| @@ -990,16 +991,17 @@ class _LocalFunctionTypeMirror extends _LocalClassMirror |
| get typeVariables => emptyList; |
| get typeArguments => emptyList; |
| get metadata => emptyList; |
| + get location => null; |
| String toString() => "FunctionTypeMirror on '${_n(simpleName)}'"; |
| - MethodMirror _FunctionTypeMirror_call_method(reflectee) |
| + MethodMirror _FunctionTypeMirror_call_method(functionReflectee) |
| native "FunctionTypeMirror_call_method"; |
| - static Type _FunctionTypeMirror_return_type(reflectee, instantiator) |
| + static Type _FunctionTypeMirror_return_type(functionReflectee, instantiator) |
| native "FunctionTypeMirror_return_type"; |
| - List<ParameterMirror> _FunctionTypeMirror_parameters(reflectee) |
| + List<ParameterMirror> _FunctionTypeMirror_parameters(functionReflectee) |
| native "FunctionTypeMirror_parameters"; |
| } |
| @@ -1554,7 +1556,7 @@ class _LocalParameterMirror extends _LocalVariableMirror |
| bool get hasDefaultValue => _defaultValueReflectee != null; |
| SourceLocation get location { |
| - throw new UnsupportedError("ParameterMirror.location unimplemented"); |
| + return _location(_reflectee); |
|
rmacnak
2016/01/19 19:27:11
This isn't right. It makes the location of every p
regis
2016/01/19 23:15:29
OK, I will leave it unimplemented, then.
|
| } |
| List<InstanceMirror> get metadata { |
| @@ -1648,7 +1650,7 @@ class _Mirrors { |
| native "Mirrors_makeLocalTypeMirror"; |
| static Expando<ClassMirror> _declarationCache = new Expando("ClassMirror"); |
| - static Expando<TypeMirror> _instanitationCache = new Expando("TypeMirror"); |
| + static Expando<TypeMirror> _instantiationCache = new Expando("TypeMirror"); |
| static ClassMirror reflectClass(Type key) { |
| var classMirror = _declarationCache[key]; |
| @@ -1656,17 +1658,17 @@ class _Mirrors { |
| classMirror = makeLocalClassMirror(key); |
| _declarationCache[key] = classMirror; |
| if (!classMirror._isGeneric) { |
| - _instanitationCache[key] = classMirror; |
| + _instantiationCache[key] = classMirror; |
| } |
| } |
| return classMirror; |
| } |
| static TypeMirror reflectType(Type key) { |
| - var typeMirror = _instanitationCache[key]; |
| + var typeMirror = _instantiationCache[key]; |
| if (typeMirror == null) { |
| typeMirror = makeLocalTypeMirror(key); |
| - _instanitationCache[key] = typeMirror; |
| + _instantiationCache[key] = typeMirror; |
| if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| _declarationCache[key] = typeMirror; |
| } |