| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 * | 48 * |
| 49 * ## Status: Unstable | 49 * ## Status: Unstable |
| 50 * | 50 * |
| 51 * The dart:mirrors library is unstable and its API might change slightly as a | 51 * The dart:mirrors library is unstable and its API might change slightly as a |
| 52 * result of user feedback. This library is platform dependent and therefore it | 52 * result of user feedback. This library is platform dependent and therefore it |
| 53 * has implementations for both dart2js and the Dart VM. Both are under | 53 * has implementations for both dart2js and the Dart VM. Both are under |
| 54 * development and may not support all operations yet. | 54 * development and may not support all operations yet. |
| 55 */ | 55 */ |
| 56 library dart.mirrors; | 56 library dart.mirrors; |
| 57 | 57 |
| 58 import 'dart:async'; | |
| 59 import 'dart:isolate'; | |
| 60 | |
| 61 /** | 58 /** |
| 62 * A [MirrorSystem] is the main interface used to reflect on a set of | 59 * A [MirrorSystem] is the main interface used to reflect on a set of |
| 63 * associated libraries. | 60 * associated libraries. |
| 64 * | 61 * |
| 65 * At runtime each running isolate has a distinct [MirrorSystem]. | 62 * At runtime each running isolate has a distinct [MirrorSystem]. |
| 66 * | 63 * |
| 67 * It is also possible to have a [MirrorSystem] which represents a set | 64 * It is also possible to have a [MirrorSystem] which represents a set |
| 68 * of libraries which are not running -- perhaps at compile-time. In | 65 * of libraries which are not running -- perhaps at compile-time. In |
| 69 * this case, all available reflective functionality would be | 66 * this case, all available reflective functionality would be |
| 70 * supported, but runtime functionality (such as invoking a function | 67 * supported, but runtime functionality (such as invoking a function |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 */ | 559 */ |
| 563 bool operator ==(other); | 560 bool operator ==(other); |
| 564 | 561 |
| 565 /** | 562 /** |
| 566 * Returns a list of the imports and exports in this library; | 563 * Returns a list of the imports and exports in this library; |
| 567 */ | 564 */ |
| 568 List<LibraryDependencyMirror> get libraryDependencies; | 565 List<LibraryDependencyMirror> get libraryDependencies; |
| 569 } | 566 } |
| 570 | 567 |
| 571 /// A mirror on an import or export declaration. | 568 /// A mirror on an import or export declaration. |
| 572 abstract class LibraryDependencyMirror { | 569 abstract class LibraryDependencyMirror implements Mirror { |
| 573 /// Is `true` if this dependency is an import. | 570 /// Is `true` if this dependency is an import. |
| 574 bool get isImport; | 571 bool get isImport; |
| 575 | 572 |
| 576 /// Is `true` if this dependency is an export. | 573 /// Is `true` if this dependency is an export. |
| 577 bool get isExport; | 574 bool get isExport; |
| 578 | 575 |
| 579 /// Returns the library mirror of the library that imports or exports the | 576 /// Returns the library mirror of the library that imports or exports the |
| 580 /// [targetLibrary]. | 577 /// [targetLibrary]. |
| 581 LibraryMirror get sourceLibrary; | 578 LibraryMirror get sourceLibrary; |
| 582 | 579 |
| 583 /// Returns the library mirror of the library that is imported or exported. | 580 /// Returns the library mirror of the library that is imported or exported. |
| 584 LibraryMirror get targetLibrary; | 581 LibraryMirror get targetLibrary; |
| 585 | 582 |
| 586 /// Returns the prefix if this is a prefixed import and `null` otherwise. | 583 /// Returns the prefix if this is a prefixed import and `null` otherwise. |
| 587 Symbol get prefix; | 584 Symbol get prefix; |
| 588 | 585 |
| 589 /// Returns the list of show/hide combinators on the import/export | 586 /// Returns the list of show/hide combinators on the import/export |
| 590 /// declaration. | 587 /// declaration. |
| 591 List<CombinatorMirror> get combinators; | 588 List<CombinatorMirror> get combinators; |
| 592 | 589 |
| 593 /// Returns the source location for this import/export declaration. | 590 /// Returns the source location for this import/export declaration. |
| 594 SourceLocation get location; | 591 SourceLocation get location; |
| 595 | 592 |
| 596 List<InstanceMirror> get metadata; | 593 List<InstanceMirror> get metadata; |
| 597 } | 594 } |
| 598 | 595 |
| 599 /// A mirror on a show/hide combinator declared on a library dependency. | 596 /// A mirror on a show/hide combinator declared on a library dependency. |
| 600 abstract class CombinatorMirror { | 597 abstract class CombinatorMirror implements Mirror { |
| 601 /// The list of identifiers on the combinator. | 598 /// The list of identifiers on the combinator. |
| 602 List<Symbol> get identifiers; | 599 List<Symbol> get identifiers; |
| 603 | 600 |
| 604 /// Is `true` if this is a 'show' combinator. | 601 /// Is `true` if this is a 'show' combinator. |
| 605 bool get isShow; | 602 bool get isShow; |
| 606 | 603 |
| 607 /// Is `true` if this is a 'hide' combinator. | 604 /// Is `true` if this is a 'hide' combinator. |
| 608 bool get isHide; | 605 bool get isHide; |
| 609 } | 606 } |
| 610 | 607 |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 * | 1219 * |
| 1223 * When used as metadata on an import of "dart:mirrors", this metadata does | 1220 * When used as metadata on an import of "dart:mirrors", this metadata does |
| 1224 * not apply to the library in which the annotation is used, but instead | 1221 * not apply to the library in which the annotation is used, but instead |
| 1225 * applies to the other libraries (all libraries if "*" is used). | 1222 * applies to the other libraries (all libraries if "*" is used). |
| 1226 */ | 1223 */ |
| 1227 final override; | 1224 final override; |
| 1228 | 1225 |
| 1229 const MirrorsUsed( | 1226 const MirrorsUsed( |
| 1230 {this.symbols, this.targets, this.metaTargets, this.override}); | 1227 {this.symbols, this.targets, this.metaTargets, this.override}); |
| 1231 } | 1228 } |
| OLD | NEW |