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

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
Index: runtime/lib/mirrors_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 9669)
+++ 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,29 @@
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) {}
+
+
+ bool _isOptional;
+
+ TypeMirror type() => null;
+ String defaultValue() => null;
+ bool hasDefaultValue() => null;
+ bool isOptional() => _isOptional;
+}
+
class _LocalVariableMirrorImpl extends _LocalMirrorImpl
implements VariableMirror {
_LocalVariableMirrorImpl(this.simpleName,

Powered by Google App Engine
This is Rietveld 408576698