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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 10778005: Add a limited version of ParameterMirrors that can only tell whether they are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 9677)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -183,7 +183,6 @@
implements InstanceMirror {
_LocalInstanceMirrorImpl(ref,
this._class,
- this._hasSimpleValue,
this._reflectee) : super(ref) {}
var _class;
@@ -197,12 +196,11 @@
// LocalInstanceMirrors always reflect local instances
bool hasReflectee = true;
- var _hasSimpleValue;
var _reflectee;
get reflectee() => _reflectee;
String toString() {
- if (_hasSimpleValue) {
+ if (isSimpleValue(_reflectee)) {
if (_reflectee is String) {
return "InstanceMirror on <'${_dartEscape(_reflectee)}'>";
} else {
@@ -372,6 +370,7 @@
implements MethodMirror {
_LocalMethodMirrorImpl(this.simpleName,
this._owner,
+ this._parameters,
this.isStatic,
this.isAbstract,
this.isGetter,
@@ -412,11 +411,27 @@
final bool isRedirectingConstructor;
final bool isFactoryConstructor;
+ List<ParameterMirror> _parameters;
+ List<ParameterMirror> parameters() => _parameters;
+
String toString() {
return "MethodMirror on '$simpleName'";
}
}
+class _LocalParameterMirrorImpl extends _LocalVariableMirrorImpl
+ implements ParameterMirror {
+ // TODO(rmacnak): Fill these mirrors will real information
+ _LocalParameterMirrorImpl(this.isOptional)
+ : super(null, null, false, false) {}
+
+ final bool isOptional;
+
+ TypeMirror get type() => null;
+ String get defaultValue() => null;
+ bool get hasDefaultValue() => null;
+}
+
class _LocalVariableMirrorImpl extends _LocalMirrorImpl
implements VariableMirror {
_LocalVariableMirrorImpl(this.simpleName,
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698