| 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 // 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 // |
| 11 // ...the getter is named 'myField' and the setter is named | 11 // ...the getter is named 'myField' and the setter is named |
| 12 // 'myField='. This allows us to assign unique names to getters and | 12 // 'myField='. This allows us to assign unique names to getters and |
| 13 // setters for the purposes of member lookup. | 13 // setters for the purposes of member lookup. |
| 14 | 14 |
| 15 library dart.mirrors; | 15 library dart.mirrors; |
| 16 | 16 |
| 17 import 'dart:async'; | 17 import 'dart:async'; |
| 18 import 'dart:isolate'; | 18 import 'dart:isolate'; |
| 19 import 'dart:uri'; |
| 19 | 20 |
| 20 /** | 21 /** |
| 21 * A [MirrorSystem] is the main interface used to reflect on a set of | 22 * A [MirrorSystem] is the main interface used to reflect on a set of |
| 22 * associated libraries. | 23 * associated libraries. |
| 23 * | 24 * |
| 24 * At runtime each running isolate has a distinct [MirrorSystem]. | 25 * At runtime each running isolate has a distinct [MirrorSystem]. |
| 25 * | 26 * |
| 26 * It is also possible to have a [MirrorSystem] which represents a set | 27 * It is also possible to have a [MirrorSystem] which represents a set |
| 27 * of libraries which are not running -- perhaps at compile-time. In | 28 * of libraries which are not running -- perhaps at compile-time. In |
| 28 * this case, all available reflective functionality would be | 29 * this case, all available reflective functionality would be |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 Future<InstanceMirror> findInContext(Symbol name); | 276 Future<InstanceMirror> findInContext(Symbol name); |
| 276 } | 277 } |
| 277 | 278 |
| 278 /** | 279 /** |
| 279 * A [LibraryMirror] reflects a Dart language library, providing | 280 * A [LibraryMirror] reflects a Dart language library, providing |
| 280 * access to the variables, functions, and classes of the | 281 * access to the variables, functions, and classes of the |
| 281 * library. | 282 * library. |
| 282 */ | 283 */ |
| 283 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { | 284 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { |
| 284 /** | 285 /** |
| 285 * The url of the library. | 286 * The absolute uri of the library. |
| 286 * | |
| 287 * TODO(turnidge): Document where this url comes from. Will this | |
| 288 * value be sensible? | |
| 289 */ | 287 */ |
| 290 // TODO(ahe): Change type to [Uri], rename to "uri"? | 288 Uri get uri; |
| 291 String get url; | |
| 292 | 289 |
| 293 /** | 290 /** |
| 294 * An immutable map from from names to mirrors for all members in | 291 * An immutable map from from names to mirrors for all members in |
| 295 * this library. | 292 * this library. |
| 296 * | 293 * |
| 297 * The members of a library are its top-level classes, | 294 * The members of a library are its top-level classes, |
| 298 * functions, variables, getters, and setters. | 295 * functions, variables, getters, and setters. |
| 299 */ | 296 */ |
| 300 Map<Symbol, Mirror> get members; | 297 Map<Symbol, Mirror> get members; |
| 301 | 298 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 /** | 756 /** |
| 760 * Is [:true:] if this comment is a documentation comment. | 757 * Is [:true:] if this comment is a documentation comment. |
| 761 * | 758 * |
| 762 * That is, that the comment is either enclosed in [: /** ... */ :] or starts | 759 * That is, that the comment is either enclosed in [: /** ... */ :] or starts |
| 763 * with [: /// :]. | 760 * with [: /// :]. |
| 764 */ | 761 */ |
| 765 final bool isDocComment; | 762 final bool isDocComment; |
| 766 | 763 |
| 767 const Comment(this.text, this.trimmedText, this.isDocComment); | 764 const Comment(this.text, this.trimmedText, this.isDocComment); |
| 768 } | 765 } |
| OLD | NEW |