| Index: runtime/lib/mirrors_impl.dart
|
| ===================================================================
|
| --- runtime/lib/mirrors_impl.dart (revision 21243)
|
| +++ runtime/lib/mirrors_impl.dart (working copy)
|
| @@ -139,10 +139,30 @@
|
| abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl
|
| implements ObjectMirror {
|
| _LocalObjectMirrorImpl(ref) : super(ref) {}
|
| +
|
| + InstanceMirror invoke(String memberName,
|
| + List positionalArguments,
|
| + [Map<String,dynamic> namedArguments]) {
|
| + if (namedArguments != null) {
|
| + throw new UnimplementedError(
|
| + 'named argument support is not implemented');
|
| + }
|
| + return _invoke(this, memberName, positionalArguments, false);
|
| + }
|
| +
|
| + InstanceMirror getField(String fieldName) {
|
| + return _getField(this, fieldName);
|
| + }
|
| +
|
| + InstanceMirror setField(String fieldName, Object arg) {
|
| + return _setField(this, fieldName, arg, false);
|
| + }
|
| +
|
| +
|
|
|
| -Future<InstanceMirror> invokeAsync(String memberName,
|
| - List positionalArguments,
|
| - [Map<String,dynamic> namedArguments]) {
|
| + Future<InstanceMirror> invokeAsync(String memberName,
|
| + List positionalArguments,
|
| + [Map<String,dynamic> namedArguments]) {
|
| if (namedArguments != null) {
|
| throw new UnimplementedError(
|
| 'named argument support is not implemented');
|
| @@ -155,7 +175,7 @@
|
| Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
|
| try {
|
| completer.complete(
|
| - _invoke(this, memberName, positionalArguments));
|
| + _invoke(this, memberName, positionalArguments, true));
|
| } catch (exception, s) {
|
| completer.completeError(exception, s);
|
| }
|
| @@ -177,7 +197,7 @@
|
|
|
| Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
|
| try {
|
| - completer.complete(_setField(this, fieldName, arg));
|
| + completer.complete(_setField(this, fieldName, arg, true));
|
| } catch (exception, s) {
|
| completer.completeError(exception, s);
|
| }
|
| @@ -197,13 +217,13 @@
|
| }
|
| }
|
|
|
| - static _invoke(ref, memberName, positionalArguments)
|
| + static _invoke(ref, memberName, positionalArguments, async)
|
| native 'LocalObjectMirrorImpl_invoke';
|
|
|
| - static _getField(ref, fieldName)
|
| + static _getField(ref, fieldName) // same for sync and async versions
|
| native 'LocalObjectMirrorImpl_getField';
|
|
|
| - static _setField(ref, fieldName, value)
|
| + static _setField(ref, fieldName, value, async)
|
| native 'LocalObjectMirrorImpl_setField';
|
| }
|
|
|
| @@ -303,6 +323,15 @@
|
| 'ClosureMirror.source is not implemented');
|
| }
|
|
|
| + InstanceMirror apply(List<Object> positionalArguments,
|
| + [Map<String,Object> namedArguments]) {
|
| + if (namedArguments != null) {
|
| + throw new UnimplementedError(
|
| + 'named argument support is not implemented');
|
| + }
|
| + return _apply(this, positionalArguments, false);
|
| + }
|
| +
|
| Future<InstanceMirror> applyAsync(List<Object> positionalArguments,
|
| [Map<String,Object> namedArguments]) {
|
| if (namedArguments != null) {
|
| @@ -317,7 +346,7 @@
|
| Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
|
| try {
|
| completer.complete(
|
| - _apply(this, positionalArguments));
|
| + _apply(this, positionalArguments, true));
|
| } catch (exception) {
|
| completer.completeError(exception);
|
| }
|
| @@ -329,7 +358,7 @@
|
| 'ClosureMirror.findInContext() is not implemented');
|
| }
|
|
|
| - static _apply(ref, positionalArguments)
|
| + static _apply(ref, positionalArguments, async)
|
| native 'LocalClosureMirrorImpl_apply';
|
| }
|
|
|
| @@ -499,6 +528,25 @@
|
|
|
| String toString() => "ClassMirror on '$simpleName'";
|
|
|
| + InstanceMirror apply(List<Object> positionalArguments,
|
| + [Map<String,Object> namedArguments]) {
|
| + if (namedArguments != null) {
|
| + throw new UnimplementedError(
|
| + 'named argument support is not implemented');
|
| + }
|
| + return _apply(this, positionalArguments);
|
| + }
|
| +
|
| + InstanceMirror newInstance(String constructorName,
|
| + List positionalArguments,
|
| + [Map<String,dynamic> namedArguments]) {
|
| + if (namedArguments != null) {
|
| + throw new UnimplementedError(
|
| + 'named argument support is not implemented');
|
| + }
|
| + return _invokeConstructor(this, constructorName, positionalArguments, false);
|
| + }
|
| +
|
| Future<InstanceMirror> newInstanceAsync(String constructorName,
|
| List positionalArguments,
|
| [Map<String,dynamic> namedArguments]) {
|
| @@ -514,14 +562,14 @@
|
| Completer<InstanceMirror> completer = new Completer<InstanceMirror>();
|
| try {
|
| completer.complete(
|
| - _invokeConstructor(this, constructorName, positionalArguments));
|
| + _invokeConstructor(this, constructorName, positionalArguments, true));
|
| } catch (exception) {
|
| completer.completeError(exception);
|
| }
|
| return completer.future;
|
| }
|
|
|
| - static _invokeConstructor(ref, constructorName, positionalArguments)
|
| + static _invokeConstructor(ref, constructorName, positionalArguments, async)
|
| native 'LocalClassMirrorImpl_invokeConstructor';
|
| }
|
|
|
|
|