| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 TypeMirror get voidType() { | 41 TypeMirror get voidType() { |
| 42 if (_voidType === null) { | 42 if (_voidType === null) { |
| 43 _voidType = | 43 _voidType = |
| 44 new _LocalClassMirrorImpl( | 44 new _LocalClassMirrorImpl( |
| 45 null, 'void', false, null, null, [], null, const {}); | 45 null, 'void', false, null, null, [], null, const {}); |
| 46 } | 46 } |
| 47 return _voidType; | 47 return _voidType; |
| 48 } | 48 } |
| 49 | 49 |
| 50 String toString() => "MirrorSystem for isolate '$debugName'"; | 50 String toString() => "MirrorSystem for isolate '${isolate.debugName}'"; |
| 51 } | 51 } |
| 52 | 52 |
| 53 abstract class _LocalMirrorImpl implements Mirror { | 53 abstract class _LocalMirrorImpl implements Mirror { |
| 54 int hashCode() { | 54 int hashCode() { |
| 55 throw new NotImplementedException('Mirror.hashCode() not yet implemented'); | 55 throw new NotImplementedException('Mirror.hashCode() not yet implemented'); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Local mirrors always return the same MirrorSystem. This field | 58 // Local mirrors always return the same MirrorSystem. This field |
| 59 // is more interesting once we implement remote mirrors. | 59 // is more interesting once we implement remote mirrors. |
| 60 MirrorSystem get mirrors() => _Mirrors.currentMirrorSystem(); | 60 MirrorSystem get mirrors() => _Mirrors.currentMirrorSystem(); |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 764 |
| 765 // Creates a new local InstanceMirror | 765 // Creates a new local InstanceMirror |
| 766 static InstanceMirror makeLocalInstanceMirror(Object reflectee) | 766 static InstanceMirror makeLocalInstanceMirror(Object reflectee) |
| 767 native 'Mirrors_makeLocalInstanceMirror'; | 767 native 'Mirrors_makeLocalInstanceMirror'; |
| 768 | 768 |
| 769 // Creates a new local mirror for some Object. | 769 // Creates a new local mirror for some Object. |
| 770 static InstanceMirror reflect(Object reflectee) { | 770 static InstanceMirror reflect(Object reflectee) { |
| 771 return makeLocalInstanceMirror(reflectee); | 771 return makeLocalInstanceMirror(reflectee); |
| 772 } | 772 } |
| 773 } | 773 } |
| OLD | NEW |