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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 19983003: Create ParameterMirror.type lazily. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 7809bfb779c99b32360d09dbf9aa0b3cddacab37..9dd7efa2736fa347741a8b8bb7adafba49418539 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -1051,9 +1051,13 @@ class _LocalVariableMirrorImpl extends _LocalDeclarationMirrorImpl
class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
implements ParameterMirror {
- _LocalParameterMirrorImpl(type, this.isOptional)
- : super(null, '<TODO:unnamed>', null, type, false, false) {}
+ _LocalParameterMirrorImpl(this._reflectee,
+ this._position,
+ this.isOptional)
+ : super(null, '<TODO:unnamed>', null, null, false, false) {}
+ final _reflectee;
rmacnak 2013/07/22 20:42:32 Add type annotations: final _MirrorReference _refl
Michael Lippautz (Google) 2013/07/22 20:53:34 Done.
+ final _position;
final bool isOptional;
String get defaultValue {
@@ -1071,6 +1075,17 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
throw new UnimplementedError(
'ParameterMirror.metadata is not implemented');
}
+
+ TypeMirror _type = null;
+ TypeMirror get type {
+ if (_type == null) {
+ _type = _ParameterMirror_type(_reflectee, _position);
+ }
+ return _type;
+ }
+
+ static TypeMirror _ParameterMirror_type(_reflectee, _position)
+ native "ParameterMirror_type";
}
class _SpecialTypeMirrorImpl extends _LocalMirrorImpl
« 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