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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // language objects (except for objects of type VMReference, of | 43 // language objects (except for objects of type VMReference, of |
44 // course). | 44 // course). |
45 VMReference _reference; | 45 VMReference _reference; |
46 } | 46 } |
47 | 47 |
48 abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl | 48 abstract class _LocalObjectMirrorImpl extends _LocalVMObjectMirrorImpl |
49 implements ObjectMirror { | 49 implements ObjectMirror { |
50 _LocalObjectMirrorImpl(ref) : super(ref) {} | 50 _LocalObjectMirrorImpl(ref) : super(ref) {} |
51 | 51 |
52 Future<InstanceMirror> invoke(String memberName, | 52 Future<InstanceMirror> invoke(String memberName, |
53 List<Object> positionalArguments, | 53 List positionalArguments, |
54 [Map<String,Object> namedArguments]) { | 54 [Map<String,Dynamic> namedArguments]) { |
55 if (namedArguments !== null) { | 55 if (namedArguments !== null) { |
56 throw new NotImplementedException('named arguments not implemented'); | 56 throw new NotImplementedException('named arguments not implemented'); |
57 } | 57 } |
58 // Walk the arguments and make sure they are legal. | 58 // Walk the arguments and make sure they are legal. |
59 for (int i = 0; i < positionalArguments.length; i++) { | 59 for (int i = 0; i < positionalArguments.length; i++) { |
60 var arg = positionalArguments[i]; | 60 var arg = positionalArguments[i]; |
61 if (arg is Mirror) { | 61 if (arg is Mirror) { |
62 if (arg is! InstanceMirror) { | 62 if (arg is! InstanceMirror) { |
63 throw new MirrorException( | 63 throw new MirrorException( |
64 'positional argument $i ($arg) was not an InstanceMirror'); | 64 'positional argument $i ($arg) was not an InstanceMirror'); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 // Creates a new local InstanceMirror | 303 // Creates a new local InstanceMirror |
304 static InstanceMirror makeLocalInstanceMirror(Object reflectee) | 304 static InstanceMirror makeLocalInstanceMirror(Object reflectee) |
305 native 'Mirrors_makeLocalInstanceMirror'; | 305 native 'Mirrors_makeLocalInstanceMirror'; |
306 | 306 |
307 // The IsolateMirror for the current isolate. | 307 // The IsolateMirror for the current isolate. |
308 static InstanceMirror mirrorOf(Object reflectee) { | 308 static InstanceMirror mirrorOf(Object reflectee) { |
309 return makeLocalInstanceMirror(reflectee); | 309 return makeLocalInstanceMirror(reflectee); |
310 } | 310 } |
311 } | 311 } |
OLD | NEW |