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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 23224016: Implement ParameterMirror.metadata. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/parser.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 304b0a863fdca617e53e3cf7dae52d3ea39bb459..b2bd353f66e6cfdf6a9a8266f62cc71fefc4acfe 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -1162,7 +1162,8 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
this.isOptional,
this.isNamed,
bool isFinal,
- this._defaultValueReflectee)
+ this._defaultValueReflectee,
+ this._unmirroredMetadata)
: super(reflectee,
simpleName,
owner,
@@ -1173,6 +1174,7 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
final int _position;
final bool isOptional;
final bool isNamed;
+ final List _unmirroredMetadata;
Object _defaultValueReflectee;
InstanceMirror _defaultValue;
@@ -1188,10 +1190,9 @@ class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
bool get hasDefaultValue => _defaultValueReflectee != null;
- // TODO(11418): Implement.
List<InstanceMirror> get metadata {
- throw new UnimplementedError(
- 'ParameterMirror.metadata is not implemented');
+ if ( _unmirroredMetadata == null) return const [];
+ return _unmirroredMetadata.map(reflect).toList(growable:false);
}
TypeMirror _type = null;
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698