| 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 // The dart:mirrors library provides reflective access for Dart program. | 5 // The dart:mirrors library provides reflective access for Dart program. |
| 6 // | 6 // |
| 7 // For the purposes of the mirrors library, we adopt a naming | 7 // For the purposes of the mirrors library, we adopt a naming |
| 8 // convention with respect to getters and setters. Specifically, for | 8 // convention with respect to getters and setters. Specifically, for |
| 9 // some variable or field... | 9 // some variable or field... |
| 10 // | 10 // |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * A mirror on the [:void:] type. | 50 * A mirror on the [:void:] type. |
| 51 */ | 51 */ |
| 52 TypeMirror get voidType; | 52 TypeMirror get voidType; |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Returns a [MirrorSystem] for the current isolate. | 56 * Returns a [MirrorSystem] for the current isolate. |
| 57 */ | 57 */ |
| 58 // TODO(johnniwinther): Implement this as an external function. |
| 58 MirrorSystem currentMirrorSystem() { | 59 MirrorSystem currentMirrorSystem() { |
| 59 return _Mirrors.currentMirrorSystem(); | 60 return _Mirrors.currentMirrorSystem(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 /** | 63 /** |
| 63 * Creates a [MirrorSystem] for the isolate which is listening on | 64 * Creates a [MirrorSystem] for the isolate which is listening on |
| 64 * the [SendPort]. | 65 * the [SendPort]. |
| 65 */ | 66 */ |
| 67 // TODO(johnniwinther): Implement this as an external function. |
| 66 Future<MirrorSystem> mirrorSystemOf(SendPort port) { | 68 Future<MirrorSystem> mirrorSystemOf(SendPort port) { |
| 67 return _Mirrors.mirrorSystemOf(port); | 69 return _Mirrors.mirrorSystemOf(port); |
| 68 } | 70 } |
| 69 | 71 |
| 70 /** | 72 /** |
| 71 * Returns an [InstanceMirror] for some Dart language object. | 73 * Returns an [InstanceMirror] for some Dart language object. |
| 72 * | 74 * |
| 73 * This only works if this mirror system is associated with the | 75 * This only works if this mirror system is associated with the |
| 74 * current running isolate. | 76 * current running isolate. |
| 75 */ | 77 */ |
| 78 // TODO(johnniwinther): Implement this as an external function. |
| 76 InstanceMirror reflect(Object reflectee) { | 79 InstanceMirror reflect(Object reflectee) { |
| 77 return _Mirrors.reflect(reflectee); | 80 return _Mirrors.reflect(reflectee); |
| 78 } | 81 } |
| 79 | 82 |
| 80 /** | 83 /** |
| 81 * A [Mirror] reflects some Dart language entity. | 84 * A [Mirror] reflects some Dart language entity. |
| 82 * | 85 * |
| 83 * Every [Mirror] originates from some [MirrorSystem]. | 86 * Every [Mirror] originates from some [MirrorSystem]. |
| 84 */ | 87 */ |
| 85 abstract class Mirror { | 88 abstract class Mirror { |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 739 |
| 737 /** | 740 /** |
| 738 * A [MirrorException] is used to indicate errors within the mirrors | 741 * A [MirrorException] is used to indicate errors within the mirrors |
| 739 * framework. | 742 * framework. |
| 740 */ | 743 */ |
| 741 class MirrorException implements Exception { | 744 class MirrorException implements Exception { |
| 742 const MirrorException(String this._message); | 745 const MirrorException(String this._message); |
| 743 String toString() => "MirrorException: '$_message'"; | 746 String toString() => "MirrorException: '$_message'"; |
| 744 final String _message; | 747 final String _message; |
| 745 } | 748 } |
| OLD | NEW |