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 // |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
642 * a type that is serializable across isolates (currently [num], | 642 * a type that is serializable across isolates (currently [num], |
643 * [String], or [bool]). | 643 * [String], or [bool]). |
644 */ | 644 */ |
645 Future<InstanceMirror> applyAsync(List positionalArguments, | 645 Future<InstanceMirror> applyAsync(List positionalArguments, |
646 [Map<Symbol, dynamic> namedArguments]); | 646 [Map<Symbol, dynamic> namedArguments]); |
647 | 647 |
648 /** | 648 /** |
649 * Looks up the value of a name in the scope of the closure. The | 649 * Looks up the value of a name in the scope of the closure. The |
650 * result is a mirror on that value. | 650 * result is a mirror on that value. |
651 * | 651 * |
652 * If the reflectee is not an actual closure, returns null. | |
ahe
2013/10/23 17:58:59
I think "actual closure" could be made a little mo
| |
653 * Otherwise: | |
654 * | |
652 * Let *s* be the contents of the string used to construct the symbol [name]. | 655 * Let *s* be the contents of the string used to construct the symbol [name]. |
653 * | 656 * |
654 * If the expression *s* occurs within the source code of the reflectee, | 657 * If *s* is not an identifier or the name of an operator |
658 * an ArgumentError is thrown. | |
ahe
2013/10/23 17:58:59
Short-term, also throw an argument error if s is a
| |
659 * | |
660 * If *s* is an identifier and | |
661 * the expression *s* occurs within the source code of the reflectee, | |
655 * and if any such occurrence refers to a declaration outside the reflectee, | 662 * and if any such occurrence refers to a declaration outside the reflectee, |
656 * then let *v* be the result of evaluating the expression *s* at such | 663 * then let *v* be the result of evaluating the expression *s* at such |
657 * an occurrence. | 664 * an occurrence. |
658 * If *s = this*, and the reflectee was defined within the instance scope of | 665 * If *s = this*, and the reflectee was defined within the instance scope of |
659 * an object *o*, then let *v* be *o*. | 666 * an object *o*, then let *v* be *o*. |
667 * If *s* is the name of an operator, let *v* be (x) => this s x. | |
ahe
2013/10/23 17:58:59
I don't understand this part.
| |
660 * | 668 * |
661 * The returned value is the result of invoking the method [reflect] on | 669 * The returned value is the result of invoking the method [reflect] on |
662 * *v*. | 670 * *v*. |
663 */ | 671 */ |
664 InstanceMirror findInContext(Symbol name, {ifAbsent: null}); | 672 InstanceMirror findInContext(Symbol name, {ifAbsent: null}); |
665 } | 673 } |
666 | 674 |
667 /** | 675 /** |
668 * A [LibraryMirror] reflects a Dart language library, providing | 676 * A [LibraryMirror] reflects a Dart language library, providing |
669 * access to the variables, functions, and classes of the | 677 * access to the variables, functions, and classes of the |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
999 */ | 1007 */ |
1000 bool operator == (other); | 1008 bool operator == (other); |
1001 } | 1009 } |
1002 | 1010 |
1003 /** | 1011 /** |
1004 * A [TypedefMirror] represents a typedef in a Dart language program. | 1012 * A [TypedefMirror] represents a typedef in a Dart language program. |
1005 */ | 1013 */ |
1006 abstract class TypedefMirror implements TypeMirror { | 1014 abstract class TypedefMirror implements TypeMirror { |
1007 /** | 1015 /** |
1008 * The defining type for this typedef. | 1016 * The defining type for this typedef. |
1017 * If the the type referred to by the reflectee is a function type | |
1018 * *F*, the result will be [:FunctionTypeMirror:] reflecting *F* | |
1019 * which is abstract and has an abstract method [:call:] whose | |
1020 * signature corresponds to *F*. | |
1009 * | 1021 * |
1010 * For instance [:void f(int):] is the referent for [:typedef void f(int):]. | 1022 * For instance [:void f(int):] is the referent for [:typedef void f(int):]. |
1011 */ | 1023 */ |
1012 TypeMirror get referent; | 1024 TypeMirror get referent; |
1013 } | 1025 } |
1014 | 1026 |
1015 /** | 1027 /** |
1016 * A [MethodMirror] reflects a Dart language function, method, | 1028 * A [MethodMirror] reflects a Dart language function, method, |
1017 * constructor, getter, or setter. | 1029 * constructor, getter, or setter. |
1018 */ | 1030 */ |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 * | 1414 * |
1403 * When used as metadata on an import of "dart:mirrors", this metadata does | 1415 * When used as metadata on an import of "dart:mirrors", this metadata does |
1404 * not apply to the library in which the annotation is used, but instead | 1416 * not apply to the library in which the annotation is used, but instead |
1405 * applies to the other libraries (all libraries if "*" is used). | 1417 * applies to the other libraries (all libraries if "*" is used). |
1406 */ | 1418 */ |
1407 final override; | 1419 final override; |
1408 | 1420 |
1409 const MirrorsUsed( | 1421 const MirrorsUsed( |
1410 {this.symbols, this.targets, this.metaTargets, this.override}); | 1422 {this.symbols, this.targets, this.metaTargets, this.override}); |
1411 } | 1423 } |
OLD | NEW |