Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: sdk/lib/mirrors/mirrors_impl.dart

Issue 11624011: Mirrors implemented via patches. 2nd try. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/mirrors/mirrors.dart ('k') | sdk/lib/mirrors/mirrors_sources.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // For the purposes of the mirrors library, we adopt a naming
6 // convention with respect to getters and setters. Specifically, for
7 // some variable or field...
8 //
9 // var myField;
10 //
11 // ...the getter is named 'myField' and the setter is named
12 // 'myField='. This allows us to assign unique names to getters and
13 // setters for the purposes of member lookup.
14
15 // library dart.mirrors;
16
17 /** 5 /**
18 * A [MirrorSystem] is the main interface used to reflect on a set of 6 * A [MirrorSystem] is the main interface used to reflect on a set of
19 * associated libraries. 7 * associated libraries.
20 * 8 *
21 * At runtime each running isolate has a distinct [MirrorSystem]. 9 * At runtime each running isolate has a distinct [MirrorSystem].
22 * 10 *
23 * It is also possible to have a [MirrorSystem] which represents a set 11 * It is also possible to have a [MirrorSystem] which represents a set
24 * of libraries which are not running -- perhaps at compile-time. In 12 * of libraries which are not running -- perhaps at compile-time. In
25 * this case, all available reflective functionality would be 13 * this case, all available reflective functionality would be
26 * supported, but runtime functionality (such as invoking a function 14 * supported, but runtime functionality (such as invoking a function
(...skipping 19 matching lines...) Expand all
46 34
47 /** 35 /**
48 * A mirror on the [:void:] type. 36 * A mirror on the [:void:] type.
49 */ 37 */
50 TypeMirror get voidType; 38 TypeMirror get voidType;
51 } 39 }
52 40
53 /** 41 /**
54 * Returns a [MirrorSystem] for the current isolate. 42 * Returns a [MirrorSystem] for the current isolate.
55 */ 43 */
56 MirrorSystem currentMirrorSystem() { 44 external MirrorSystem currentMirrorSystem();
57 return _Mirrors.currentMirrorSystem();
58 }
59 45
60 /** 46 /**
61 * Creates a [MirrorSystem] for the isolate which is listening on 47 * Creates a [MirrorSystem] for the isolate which is listening on
62 * the [SendPort]. 48 * the [SendPort].
63 */ 49 */
64 Future<MirrorSystem> mirrorSystemOf(SendPort port) { 50 external Future<MirrorSystem> mirrorSystemOf(SendPort port);
65 return _Mirrors.mirrorSystemOf(port);
66 }
67 51
68 /** 52 /**
69 * Returns an [InstanceMirror] for some Dart language object. 53 * Returns an [InstanceMirror] for some Dart language object.
70 * 54 *
71 * This only works if this mirror system is associated with the 55 * This only works if this mirror system is associated with the
72 * current running isolate. 56 * current running isolate.
73 */ 57 */
74 InstanceMirror reflect(Object reflectee) { 58 external InstanceMirror reflect(Object reflectee);
75 return _Mirrors.reflect(reflectee);
76 }
77 59
78 /** 60 /**
79 * A [Mirror] reflects some Dart language entity. 61 * A [Mirror] reflects some Dart language entity.
80 * 62 *
81 * Every [Mirror] originates from some [MirrorSystem]. 63 * Every [Mirror] originates from some [MirrorSystem].
82 */ 64 */
83 abstract class Mirror { 65 abstract class Mirror {
84 /** 66 /**
85 * The [MirrorSystem] that contains this mirror. 67 * The [MirrorSystem] that contains this mirror.
86 */ 68 */
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 716
735 /** 717 /**
736 * A [MirrorException] is used to indicate errors within the mirrors 718 * A [MirrorException] is used to indicate errors within the mirrors
737 * framework. 719 * framework.
738 */ 720 */
739 class MirrorException implements Exception { 721 class MirrorException implements Exception {
740 const MirrorException(String this._message); 722 const MirrorException(String this._message);
741 String toString() => "MirrorException: '$_message'"; 723 String toString() => "MirrorException: '$_message'";
742 final String _message; 724 final String _message;
743 } 725 }
OLDNEW
« no previous file with comments | « sdk/lib/mirrors/mirrors.dart ('k') | sdk/lib/mirrors/mirrors_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698