Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sdk/lib/mirrors/mirrors.dart

Issue 27953002: Refine spec for TypedefMirror.value and for ClosureMirror.findInContext. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 function, that is, a
653 * user-defined class which implements [Function], this method
654 * returns null.
655 * Otherwise:
656 *
652 * Let *s* be the contents of the string used to construct the symbol [name]. 657 * Let *s* be the contents of the string used to construct the symbol [name].
653 * 658 *
654 * If the expression *s* occurs within the source code of the reflectee, 659 * If *s* is not an identifier or the name of an operator
660 * an ArgumentError is thrown.
661 *
662 * If *s* is an identifier and
663 * the expression *s* occurs within the source code of the reflectee,
655 * and if any such occurrence refers to a declaration outside the reflectee, 664 * 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 665 * then let *v* be the result of evaluating the expression *s* at such
657 * an occurrence. 666 * an occurrence.
667 * If *s* denotes a prefix defined by an import-as clause in the surrounding
668 * library an ArgumentError is thrown.
658 * If *s = this*, and the reflectee was defined within the instance scope of 669 * If *s = this*, and the reflectee was defined within the instance scope of
659 * an object *o*, then let *v* be *o*. 670 * an object *o*, then let *v* be *o*.
660 * 671 * If *s* is the name of an operator, let *v* be (x) => this s x.
ahe 2013/10/24 13:29:43 OK, now I understand this better, I'm concerned th
672 *
661 * The returned value is the result of invoking the method [reflect] on 673 * The returned value is the result of invoking the method [reflect] on
662 * *v*. 674 * *v*.
675 * In any other case, *v* is unbound and this method returns null.
663 */ 676 */
664 InstanceMirror findInContext(Symbol name, {ifAbsent: null}); 677 InstanceMirror findInContext(Symbol name, {ifAbsent: null});
665 } 678 }
666 679
667 /** 680 /**
668 * A [LibraryMirror] reflects a Dart language library, providing 681 * A [LibraryMirror] reflects a Dart language library, providing
669 * access to the variables, functions, and classes of the 682 * access to the variables, functions, and classes of the
670 * library. 683 * library.
671 */ 684 */
672 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { 685 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 */ 1012 */
1000 bool operator == (other); 1013 bool operator == (other);
1001 } 1014 }
1002 1015
1003 /** 1016 /**
1004 * A [TypedefMirror] represents a typedef in a Dart language program. 1017 * A [TypedefMirror] represents a typedef in a Dart language program.
1005 */ 1018 */
1006 abstract class TypedefMirror implements TypeMirror { 1019 abstract class TypedefMirror implements TypeMirror {
1007 /** 1020 /**
1008 * The defining type for this typedef. 1021 * The defining type for this typedef.
1022 * If the the type referred to by the reflectee is a function type
1023 * *F*, the result will be [:FunctionTypeMirror:] reflecting *F*
1024 * which is abstract and has an abstract method [:call:] whose
1025 * signature corresponds to *F*.
1009 * 1026 *
1010 * For instance [:void f(int):] is the referent for [:typedef void f(int):]. 1027 * For instance [:void f(int):] is the referent for [:typedef void f(int):].
1011 */ 1028 */
1012 TypeMirror get referent; 1029 TypeMirror get referent;
1013 } 1030 }
1014 1031
1015 /** 1032 /**
1016 * A [MethodMirror] reflects a Dart language function, method, 1033 * A [MethodMirror] reflects a Dart language function, method,
1017 * constructor, getter, or setter. 1034 * constructor, getter, or setter.
1018 */ 1035 */
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 * 1419 *
1403 * When used as metadata on an import of "dart:mirrors", this metadata does 1420 * 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 1421 * not apply to the library in which the annotation is used, but instead
1405 * applies to the other libraries (all libraries if "*" is used). 1422 * applies to the other libraries (all libraries if "*" is used).
1406 */ 1423 */
1407 final override; 1424 final override;
1408 1425
1409 const MirrorsUsed( 1426 const MirrorsUsed(
1410 {this.symbols, this.targets, this.metaTargets, this.override}); 1427 {this.symbols, this.targets, this.metaTargets, this.override});
1411 } 1428 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698