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

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
Index: runtime/lib/mirrors_impl.dart
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 7809bfb779c99b32360d09dbf9aa0b3cddacab37..ea0480420d0583bc0200b5ae29ea8bb2f54e7415 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 _MirrorReference _reflectee;
+ final int _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

Powered by Google App Engine
This is Rietveld 408576698