Chromium Code Reviews| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 489 */ | 489 */ |
| 490 abstract class ClosureMirror implements InstanceMirror { | 490 abstract class ClosureMirror implements InstanceMirror { |
| 491 /** | 491 /** |
| 492 * A mirror on the function associated with this closure. | 492 * A mirror on the function associated with this closure. |
| 493 * | 493 * |
| 494 * The function associated with an implicit closure of a function is that | 494 * The function associated with an implicit closure of a function is that |
| 495 * function. | 495 * function. |
| 496 * | 496 * |
| 497 * The function associated with an instance of a class that has a [:call:] | 497 * The function associated with an instance of a class that has a [:call:] |
| 498 * method is that [:call:] method. | 498 * method is that [:call:] method. |
| 499 * | |
| 500 * A Dart implementation might choose to create a class for each closure | |
| 501 * expression, in which case [:function:] would be the same as | |
| 502 * [:type.declarations[#call]:]. But the Dart language model does not require | |
| 503 * this. A more typical implementation involves a single closure class or a | |
| 504 * closure class for each arity or type signature, where the call method | |
| 505 * dispatches to a function held in the closure rather the call method | |
| 506 * directly implementing the closure body. So one cannot rely on closures from | |
| 507 * distinct closure expressions having distinct classes ([:type:]), but one | |
| 508 * can rely on them having distinct functions ([:function:]). | |
| 499 */ | 509 */ |
| 500 MethodMirror get function; | 510 MethodMirror get function; |
|
rmacnak
2014/05/06 20:12:21
Actually, the accessors on FunctionTypeMirror woul
gbracha
2014/09/11 00:49:33
I don't think so today. Just as function could ret
| |
| 501 | 511 |
| 502 /** | 512 /** |
| 503 * Executes the closure and returns a mirror on the result. | 513 * Executes the closure and returns a mirror on the result. |
| 504 * Let *f* be the closure reflected by this mirror, | 514 * Let *f* be the closure reflected by this mirror, |
| 505 * let *a1, ..., an* be the elements of [positionalArguments] | 515 * let *a1, ..., an* be the elements of [positionalArguments] |
| 506 * let *k1, ..., km* be the identifiers denoted by the elements of | 516 * let *k1, ..., km* be the identifiers denoted by the elements of |
| 507 * [namedArguments.keys] | 517 * [namedArguments.keys] |
| 508 * and let *v1, ..., vm* be the elements of [namedArguments.values]. | 518 * and let *v1, ..., vm* be the elements of [namedArguments.values]. |
| 509 * Then this method will perform the method invocation | 519 * Then this method will perform the method invocation |
| 510 * *f(a1, ..., an, k1: v1, ..., km: vm)* | 520 * *f(a1, ..., an, k1: v1, ..., km: vm)* |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 TypeMirror get returnType; | 837 TypeMirror get returnType; |
| 828 | 838 |
| 829 /** | 839 /** |
| 830 * Returns a list of the parameter types of the reflectee. | 840 * Returns a list of the parameter types of the reflectee. |
| 831 */ | 841 */ |
| 832 List<ParameterMirror> get parameters; | 842 List<ParameterMirror> get parameters; |
| 833 | 843 |
| 834 /** | 844 /** |
| 835 * A mirror on the [:call:] method for the reflectee. | 845 * A mirror on the [:call:] method for the reflectee. |
| 836 */ | 846 */ |
| 837 MethodMirror get callMethod; | 847 MethodMirror get callMethod; |
|
rmacnak
2014/05/06 20:12:21
When might this be different than declarations[#ca
gbracha
2014/09/11 00:49:33
It wouldn't be but it's here.
| |
| 838 } | 848 } |
| 839 | 849 |
| 840 /** | 850 /** |
| 841 * A [TypeVariableMirror] represents a type parameter of a generic | 851 * A [TypeVariableMirror] represents a type parameter of a generic |
| 842 * type. | 852 * type. |
| 843 */ | 853 */ |
| 844 abstract class TypeVariableMirror extends TypeMirror { | 854 abstract class TypeVariableMirror extends TypeMirror { |
| 845 /** | 855 /** |
| 846 * A mirror on the type that is the upper bound of this type variable. | 856 * A mirror on the type that is the upper bound of this type variable. |
| 847 */ | 857 */ |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1219 * | 1229 * |
| 1220 * When used as metadata on an import of "dart:mirrors", this metadata does | 1230 * When used as metadata on an import of "dart:mirrors", this metadata does |
| 1221 * not apply to the library in which the annotation is used, but instead | 1231 * not apply to the library in which the annotation is used, but instead |
| 1222 * applies to the other libraries (all libraries if "*" is used). | 1232 * applies to the other libraries (all libraries if "*" is used). |
| 1223 */ | 1233 */ |
| 1224 final override; | 1234 final override; |
| 1225 | 1235 |
| 1226 const MirrorsUsed( | 1236 const MirrorsUsed( |
| 1227 {this.symbols, this.targets, this.metaTargets, this.override}); | 1237 {this.symbols, this.targets, this.metaTargets, this.override}); |
| 1228 } | 1238 } |
| OLD | NEW |