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

Side by Side Diff: runtime/lib/mirrors_impl.dart

Issue 23038010: Fix Function.end_token_pos() and implement MethodMirror.source getter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 } else if (parts.length == 2) { 1009 } else if (parts.length == 2) {
1010 _constructorName = _s(parts[1]); 1010 _constructorName = _s(parts[1]);
1011 } else { 1011 } else {
1012 _constructorName = _s(''); 1012 _constructorName = _s('');
1013 } 1013 }
1014 } 1014 }
1015 } 1015 }
1016 return _constructorName; 1016 return _constructorName;
1017 } 1017 }
1018 1018
1019 String _source = null;
1020 String get source {
1021 if (_source == null) {
1022 _source = _MethodMirror_source(_reflectee);
1023 assert(_source != null);
1024 }
1025 return _source;
1026 }
1027
1019 String toString() => "MethodMirror on '${_n(simpleName)}'"; 1028 String toString() => "MethodMirror on '${_n(simpleName)}'";
1020 1029
1021 static dynamic _MethodMirror_owner(reflectee) 1030 static dynamic _MethodMirror_owner(reflectee)
1022 native "MethodMirror_owner"; 1031 native "MethodMirror_owner";
1023 1032
1024 static dynamic _MethodMirror_return_type(reflectee) 1033 static dynamic _MethodMirror_return_type(reflectee)
1025 native "MethodMirror_return_type"; 1034 native "MethodMirror_return_type";
1026 1035
1027 List<ParameterMirror> _MethodMirror_parameters(reflectee) 1036 List<ParameterMirror> _MethodMirror_parameters(reflectee)
1028 native "MethodMirror_parameters"; 1037 native "MethodMirror_parameters";
1038
1039 static String _MethodMirror_source(reflectee)
1040 native "MethodMirror_source";
1029 } 1041 }
1030 1042
1031 class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl 1043 class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl
1032 implements VariableMirror { 1044 implements VariableMirror {
1033 _LocalVariableMirrorImpl(reflectee, 1045 _LocalVariableMirrorImpl(reflectee,
1034 String simpleName, 1046 String simpleName,
1035 this.owner, 1047 this.owner,
1036 this._type, 1048 this._type,
1037 this.isStatic, 1049 this.isStatic,
1038 this.isFinal) 1050 this.isFinal)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 if (typeMirror == null) { 1231 if (typeMirror == null) {
1220 typeMirror = makeLocalTypeMirror(key); 1232 typeMirror = makeLocalTypeMirror(key);
1221 _instanitationCache[key] = typeMirror; 1233 _instanitationCache[key] = typeMirror;
1222 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { 1234 if (typeMirror is ClassMirror && !typeMirror._isGeneric) {
1223 _declarationCache[key] = typeMirror; 1235 _declarationCache[key] = typeMirror;
1224 } 1236 }
1225 } 1237 }
1226 return typeMirror; 1238 return typeMirror;
1227 } 1239 }
1228 } 1240 }
OLDNEW
« 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