OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 5 // For the purposes of the mirrors library, we adopt a naming |
6 // convention with respect to getters and setters. Specifically, for | 6 // convention with respect to getters and setters. Specifically, for |
7 // some variable or field... | 7 // some variable or field... |
8 // | 8 // |
9 // var myField; | 9 // var myField; |
10 // | 10 // |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1097 * | 1097 * |
1098 * That is, that the comment is either enclosed in [: /** ... */ :] or starts | 1098 * That is, that the comment is either enclosed in [: /** ... */ :] or starts |
1099 * with [: /// :]. | 1099 * with [: /// :]. |
1100 */ | 1100 */ |
1101 final bool isDocComment; | 1101 final bool isDocComment; |
1102 | 1102 |
1103 const Comment(this.text, this.trimmedText, this.isDocComment); | 1103 const Comment(this.text, this.trimmedText, this.isDocComment); |
1104 } | 1104 } |
1105 | 1105 |
1106 /** | 1106 /** |
1107 * EXPERIMENTAL API: Description of how "dart:mirrors" is used. | 1107 * Annotation describing how "dart:mirrors" is used (EXPERIMENTAL). |
1108 * | 1108 * |
1109 * When used as metadata on an import of "dart:mirrors" in library *L*, this | 1109 * When used as metadata on an import of "dart:mirrors" in library *L*, this |
1110 * class describes how "dart:mirrors" is used by library *L* unless overridden. | 1110 * class describes how "dart:mirrors" is used by library *L* unless overridden. |
1111 * See [override]. | 1111 * See [override]. |
1112 * | 1112 * |
1113 * The following text is non-normative: | 1113 * The following text is non-normative: |
Kathy Walrath
2013/12/03 17:28:30
I'd probably just delete this paragraph. Our API d
| |
1114 * | 1114 * |
1115 * In some scenarios, for example, when minifying Dart code, or when generating | 1115 * In some scenarios, for example, when minifying Dart code, or when generating |
1116 * JavaScript code from a Dart program, the size and performance of the output | 1116 * JavaScript code from a Dart program, the size and performance of the output |
1117 * can suffer from use of reflection. In those cases, telling the compiler | 1117 * can suffer from use of reflection. In those cases, telling the compiler |
1118 * what is used, can have a significant impact. | 1118 * what is used, can have a significant impact. |
1119 * | 1119 * |
1120 * Example usage: | 1120 * Example usage: |
1121 * | 1121 * |
1122 * @MirrorsUsed(symbols: 'foo', override: '*') | 1122 * @MirrorsUsed(symbols: 'foo', override: '*') |
1123 * import 'dart:mirrors'; | 1123 * import 'dart:mirrors'; |
1124 * | 1124 * |
1125 * class Foo { | 1125 * class Foo { |
1126 * noSuchMethod(Invocation invocation) { | 1126 * noSuchMethod(Invocation invocation) { |
1127 * print(Mirrors.getName(invocation.memberName)); | 1127 * print(MirrorSystem.getName(invocation.memberName)); |
1128 * } | 1128 * } |
1129 * } | 1129 * } |
1130 * | 1130 * |
1131 * main() { | 1131 * main() { |
1132 * new Foo().foo(); // Prints "foo". | 1132 * new Foo().foo(); // Prints "foo". |
1133 * new Foo().bar(); // Might print an arbitrary (mangled) name, "bar". | 1133 * new Foo().bar(); // Might print an arbitrary (mangled) name, "bar". |
1134 * } | 1134 * } |
1135 */ | 1135 */ |
1136 // TODO(ahe): Remove ", override: '*'" when it isn't necessary anymore. | 1136 // TODO(ahe): Remove ", override: '*'" when it isn't necessary anymore. |
1137 class MirrorsUsed { | 1137 class MirrorsUsed { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 * | 1194 * |
1195 * When used as metadata on an import of "dart:mirrors", this metadata does | 1195 * When used as metadata on an import of "dart:mirrors", this metadata does |
1196 * not apply to the library in which the annotation is used, but instead | 1196 * not apply to the library in which the annotation is used, but instead |
1197 * applies to the other libraries (all libraries if "*" is used). | 1197 * applies to the other libraries (all libraries if "*" is used). |
1198 */ | 1198 */ |
1199 final override; | 1199 final override; |
1200 | 1200 |
1201 const MirrorsUsed( | 1201 const MirrorsUsed( |
1202 {this.symbols, this.targets, this.metaTargets, this.override}); | 1202 {this.symbols, this.targets, this.metaTargets, this.override}); |
1203 } | 1203 } |
OLD | NEW |