| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
| 6 | 6 |
| 7 // These values are allowed to be passed directly over the wire. | 7 // These values are allowed to be passed directly over the wire. |
| 8 bool _isSimpleValue(var value) { | 8 bool _isSimpleValue(var value) { |
| 9 return (value == null || value is num || value is String || value is bool); | 9 return (value == null || value is num || value is String || value is bool); |
| 10 } | 10 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 'named argument support is not implemented'); | 188 'named argument support is not implemented'); |
| 189 } | 189 } |
| 190 // Walk the arguments and make sure they are legal. | 190 // Walk the arguments and make sure they are legal. |
| 191 for (int i = 0; i < positionalArguments.length; i++) { | 191 for (int i = 0; i < positionalArguments.length; i++) { |
| 192 var arg = positionalArguments[i]; | 192 var arg = positionalArguments[i]; |
| 193 _validateArgument(i, arg); | 193 _validateArgument(i, arg); |
| 194 } | 194 } |
| 195 Completer<InstanceMirror> completer = new Completer<InstanceMirror>(); | 195 Completer<InstanceMirror> completer = new Completer<InstanceMirror>(); |
| 196 try { | 196 try { |
| 197 completer.complete( | 197 completer.complete( |
| 198 _invoke(this, _n(memberName), positionalArguments), true); | 198 _invoke(this, _n(memberName), positionalArguments, true)); |
| 199 } catch (exception, s) { | 199 } catch (exception, s) { |
| 200 completer.completeError(exception, s); | 200 completer.completeError(exception, s); |
| 201 } | 201 } |
| 202 return completer.future; | 202 return completer.future; |
| 203 } | 203 } |
| 204 | 204 |
| 205 Future<InstanceMirror> getFieldAsync(Symbol fieldName) { | 205 Future<InstanceMirror> getFieldAsync(Symbol fieldName) { |
| 206 Completer<InstanceMirror> completer = new Completer<InstanceMirror>(); | 206 Completer<InstanceMirror> completer = new Completer<InstanceMirror>(); |
| 207 try { | 207 try { |
| 208 completer.complete(_getField(this, _n(fieldName))); | 208 completer.complete(_getField(this, _n(fieldName))); |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 | 1044 |
| 1045 // Creates a new local mirror for some Object. | 1045 // Creates a new local mirror for some Object. |
| 1046 static InstanceMirror reflect(Object reflectee) { | 1046 static InstanceMirror reflect(Object reflectee) { |
| 1047 return makeLocalInstanceMirror(reflectee); | 1047 return makeLocalInstanceMirror(reflectee); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 static ClassMirror reflectClass(Type reflectee) { | 1050 static ClassMirror reflectClass(Type reflectee) { |
| 1051 throw new UnimplementedError('reflectClass is not implemented'); | 1051 throw new UnimplementedError('reflectClass is not implemented'); |
| 1052 } | 1052 } |
| 1053 } | 1053 } |
| OLD | NEW |