| Index: runtime/lib/mirrors_impl.dart
|
| diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
|
| index e057fd223886d1cdbe22a722c0487d4c3a40d3a1..63f1828b32b894c76a6c78a0379e3c7e57590078 100644
|
| --- a/runtime/lib/mirrors_impl.dart
|
| +++ b/runtime/lib/mirrors_impl.dart
|
| @@ -283,17 +283,22 @@ class _LocalInstanceMirror extends _LocalObjectMirror
|
| get reflectee => _reflectee;
|
|
|
| delegate(Invocation invocation) {
|
| - if (_invokeOnClosure == null) {
|
| - // TODO(ahe): This is a total hack. We're using the mirror
|
| - // system to access a private field in a different library. For
|
| - // some reason, that works. On the other hand, calling a
|
| - // private method does not work.
|
| - ClassMirror invocationImplClass = reflect(invocation).type;
|
| - Symbol fieldName = MirrorSystem.getSymbol('_invokeOnClosure',
|
| - invocationImplClass.owner);
|
| - _invokeOnClosure = invocationImplClass.getField(fieldName).reflectee;
|
| - }
|
| - return _invokeOnClosure(reflectee, invocation);
|
| + if (invocation.isMethod) {
|
| + return this.invoke(invocation.memberName,
|
| + invocation.positionalArguments,
|
| + invocation.namedArguments).reflectee;
|
| + }
|
| + if (invocation.isGetter) {
|
| + return this.getField(invocation.memberName).reflectee;
|
| + }
|
| + if (invocation.isSetter) {
|
| + var unwrapped = _n(invocation.memberName);
|
| + var withoutEqual = _s(unwrapped.substring(0, unwrapped.length - 1));
|
| + var arg = invocation.positionalArguments[0];
|
| + this.setField(withoutEqual, arg).reflectee;
|
| + return arg;
|
| + }
|
| + throw "UNREACHABLE";
|
| }
|
|
|
| String toString() => 'InstanceMirror on ${Error.safeToString(_reflectee)}';
|
|
|