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 10702186: Replaced simpleValue with more general reflectee. hasSimpleValue is retained internally for the sak… (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/tests/vm/dart/isolate_mirror_local_test.dart » ('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 9607)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -168,8 +168,8 @@
implements InstanceMirror {
_LocalInstanceMirrorImpl(ref,
this._class,
- this.hasSimpleValue,
- this._simpleValue) : super(ref) {}
+ this._hasSimpleValue,
+ this._reflectee) : super(ref) {}
var _class;
InterfaceMirror getClass() {
@@ -179,24 +179,19 @@
return _class;
}
- bool hasSimpleValue;
+ // LocalInstanceMirrors always reflect local instances
+ bool hasReflectee = true;
- var _simpleValue;
- get simpleValue() {
- if (!hasSimpleValue) {
- throw new MirrorException(
- "Before accesing simpleValue you must check that hasSimpleValue "
- "is true");
- }
- return _simpleValue;
- }
+ var _hasSimpleValue;
+ var _reflectee;
+ get reflectee() => _reflectee;
String toString() {
- if (hasSimpleValue) {
- if (simpleValue is String) {
- return "InstanceMirror on <'${_dartEscape(simpleValue)}'>";
+ if (_hasSimpleValue) {
+ if (_reflectee is String) {
+ return "InstanceMirror on <'${_dartEscape(_reflectee)}'>";
} else {
- return "InstanceMirror on <$simpleValue>";
+ return "InstanceMirror on <$_reflectee>";
}
} else {
return "InstanceMirror on instance of '${getClass().simpleName}'";
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698