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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
629 * a type that is serializable across isolates (currently [num], | 629 * a type that is serializable across isolates (currently [num], |
630 * [String], or [bool]). | 630 * [String], or [bool]). |
631 */ | 631 */ |
632 Future<InstanceMirror> applyAsync(List positionalArguments, | 632 Future<InstanceMirror> applyAsync(List positionalArguments, |
633 [Map<Symbol, dynamic> namedArguments]); | 633 [Map<Symbol, dynamic> namedArguments]); |
634 | 634 |
635 /** | 635 /** |
636 * Looks up the value of a name in the scope of the closure. The | 636 * Looks up the value of a name in the scope of the closure. The |
637 * result is a mirror on that value. | 637 * result is a mirror on that value. |
638 * | 638 * |
639 * If the reflectee is not an actual closure, returns null. | |
ahe
2013/10/22 12:47:18
How can that happen?
gbracha
2013/10/22 23:40:29
We generate a closure mirror for anything that eit
rmacnak
2013/10/22 23:50:18
See also https://codereview.chromium.org/26777002/
| |
640 * Otherwise: | |
641 * | |
639 * Let *s* be the contents of the string used to construct the symbol [name]. | 642 * Let *s* be the contents of the string used to construct the symbol [name]. |
640 * | 643 * |
644 * If *s* is not an identifier or a library prefix followed by an identifier | |
645 * an ArgumentError is thrown. | |
ahe
2013/10/22 12:47:18
Long term, I like this. What about operators?
Sho
gbracha
2013/10/22 23:40:29
Operators do not have a meaning as an expression.
| |
646 * | |
641 * If the expression *s* occurs within the source code of the reflectee, | 647 * If the expression *s* occurs within the source code of the reflectee, |
642 * and if any such occurrence refers to a declaration outside the reflectee, | 648 * and if any such occurrence refers to a declaration outside the reflectee, |
643 * then let *v* be the result of evaluating the expression *s* at such | 649 * then let *v* be the result of evaluating the expression *s* at such |
644 * an occurrence. | 650 * an occurrence. |
645 * If *s = this*, and the reflectee was defined within the instance scope of | 651 * If *s = this*, and the reflectee was defined within the instance scope of |
646 * an object *o*, then let *v* be *o*. | 652 * an object *o*, then let *v* be *o*. |
647 * | 653 * |
648 * The returned value is the result of invoking the method [reflect] on | 654 * The returned value is the result of invoking the method [reflect] on |
649 * *v*. | 655 * *v*. |
650 */ | 656 */ |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
981 */ | 987 */ |
982 bool operator == (other); | 988 bool operator == (other); |
983 } | 989 } |
984 | 990 |
985 /** | 991 /** |
986 * A [TypedefMirror] represents a typedef in a Dart language program. | 992 * A [TypedefMirror] represents a typedef in a Dart language program. |
987 */ | 993 */ |
988 abstract class TypedefMirror implements ClassMirror { | 994 abstract class TypedefMirror implements ClassMirror { |
989 /** | 995 /** |
990 * The defining type for this typedef. | 996 * The defining type for this typedef. |
997 * If the the type referred to by the reflectee is a function type | |
998 * *F*, the result will be [:FunctionTypeMirror:] reflecting *F* | |
999 * which is abstract and has an abstract method [:call:] whose | |
1000 * signature corresponds to *F*. | |
991 * | 1001 * |
992 * For instance [:void f(int):] is the value for [:typedef void f(int):]. | 1002 * As an example: |
1003 * [:void f(int):] is the value for [:typedef void f(int):]. | |
993 */ | 1004 */ |
994 TypeMirror get value; | 1005 TypeMirror get value; |
995 } | 1006 } |
996 | 1007 |
997 /** | 1008 /** |
998 * A [MethodMirror] reflects a Dart language function, method, | 1009 * A [MethodMirror] reflects a Dart language function, method, |
999 * constructor, getter, or setter. | 1010 * constructor, getter, or setter. |
1000 */ | 1011 */ |
1001 abstract class MethodMirror implements DeclarationMirror { | 1012 abstract class MethodMirror implements DeclarationMirror { |
1002 /** | 1013 /** |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1384 * | 1395 * |
1385 * When used as metadata on an import of "dart:mirrors", this metadata does | 1396 * When used as metadata on an import of "dart:mirrors", this metadata does |
1386 * not apply to the library in which the annotation is used, but instead | 1397 * not apply to the library in which the annotation is used, but instead |
1387 * applies to the other libraries (all libraries if "*" is used). | 1398 * applies to the other libraries (all libraries if "*" is used). |
1388 */ | 1399 */ |
1389 final override; | 1400 final override; |
1390 | 1401 |
1391 const MirrorsUsed( | 1402 const MirrorsUsed( |
1392 {this.symbols, this.targets, this.metaTargets, this.override}); | 1403 {this.symbols, this.targets, this.metaTargets, this.override}); |
1393 } | 1404 } |
OLD | NEW |