Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
| 6 | 6 |
| 7 import "dart:collection"; | 7 import "dart:collection"; |
| 8 | 8 |
| 9 // These values are allowed to be passed directly over the wire. | 9 // These values are allowed to be passed directly over the wire. |
| 10 bool _isSimpleValue(var value) { | 10 bool _isSimpleValue(var value) { |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1002 } | 1002 } |
| 1003 } | 1003 } |
| 1004 return _constructorName; | 1004 return _constructorName; |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 final bool isConstConstructor; | 1007 final bool isConstConstructor; |
| 1008 final bool isGenerativeConstructor; | 1008 final bool isGenerativeConstructor; |
| 1009 final bool isRedirectingConstructor; | 1009 final bool isRedirectingConstructor; |
| 1010 final bool isFactoryConstructor; | 1010 final bool isFactoryConstructor; |
| 1011 | 1011 |
| 1012 String _source = null; | |
| 1013 String get source { | |
| 1014 if (_source == null) { | |
| 1015 _source = _MethodMirror_source(_reflectee); | |
|
siva
2013/08/21 22:21:05
assert(_source != null);
Michael Lippautz (Google)
2013/08/21 23:19:20
Done.
| |
| 1016 } | |
| 1017 return _source; | |
| 1018 } | |
| 1019 | |
| 1012 String toString() => "MethodMirror on '${_n(simpleName)}'"; | 1020 String toString() => "MethodMirror on '${_n(simpleName)}'"; |
| 1013 | 1021 |
| 1014 static dynamic _MethodMirror_owner(reflectee) | 1022 static dynamic _MethodMirror_owner(reflectee) |
| 1015 native "MethodMirror_owner"; | 1023 native "MethodMirror_owner"; |
| 1016 | 1024 |
| 1017 static dynamic _MethodMirror_return_type(reflectee) | 1025 static dynamic _MethodMirror_return_type(reflectee) |
| 1018 native "MethodMirror_return_type"; | 1026 native "MethodMirror_return_type"; |
| 1019 | 1027 |
| 1020 List<ParameterMirror> _MethodMirror_parameters(reflectee) | 1028 List<ParameterMirror> _MethodMirror_parameters(reflectee) |
| 1021 native "MethodMirror_parameters"; | 1029 native "MethodMirror_parameters"; |
| 1030 | |
| 1031 static String _MethodMirror_source(reflectee) | |
| 1032 native "MethodMirror_source"; | |
| 1022 } | 1033 } |
| 1023 | 1034 |
| 1024 class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl | 1035 class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl |
| 1025 implements VariableMirror { | 1036 implements VariableMirror { |
| 1026 _LocalVariableMirrorImpl(reflectee, | 1037 _LocalVariableMirrorImpl(reflectee, |
| 1027 String simpleName, | 1038 String simpleName, |
| 1028 this.owner, | 1039 this.owner, |
| 1029 this._type, | 1040 this._type, |
| 1030 this.isStatic, | 1041 this.isStatic, |
| 1031 this.isFinal) | 1042 this.isFinal) |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1212 if (typeMirror == null) { | 1223 if (typeMirror == null) { |
| 1213 typeMirror = makeLocalTypeMirror(key); | 1224 typeMirror = makeLocalTypeMirror(key); |
| 1214 _instanitationCache[key] = typeMirror; | 1225 _instanitationCache[key] = typeMirror; |
| 1215 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1226 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1216 _declarationCache[key] = typeMirror; | 1227 _declarationCache[key] = typeMirror; |
| 1217 } | 1228 } |
| 1218 } | 1229 } |
| 1219 return typeMirror; | 1230 return typeMirror; |
| 1220 } | 1231 } |
| 1221 } | 1232 } |
| OLD | NEW |