Skip to content

Commit e928812

Browse files
committed
Format doc comments in mirrors, lines 480 through 1160
BUG=#24505 Review URL: https://codereview.chromium.org/1390813002 .
1 parent 89b6d8e commit e928812

File tree

1 file changed

+110
-104
lines changed

1 file changed

+110
-104
lines changed

sdk/lib/mirrors/mirrors.dart

Lines changed: 110 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,18 @@ abstract class InstanceMirror implements ObjectMirror {
480480
ClassMirror get type;
481481

482482
/**
483-
* Does [reflectee] contain the instance reflected by this mirror?
484-
* This will always be true in the local case (reflecting instances
485-
* in the same isolate), but only true in the remote case if this
486-
* mirror reflects a simple value.
483+
* Whether [reflectee] will return the instance reflected by this mirror.
484+
*
485+
* This will always be true in the local case (reflecting instances in the
486+
* same isolate), but only true in the remote case if this mirror reflects a
487+
* simple value.
487488
*
488489
* A value is simple if one of the following holds:
489-
* - the value is [:null:]
490-
* - the value is of type [num]
491-
* - the value is of type [bool]
492-
* - the value is of type [String]
490+
*
491+
* * the value is [:null:]
492+
* * the value is of type [num]
493+
* * the value is of type [bool]
494+
* * the value is of type [String]
493495
*/
494496
bool get hasReflectee;
495497

@@ -504,16 +506,18 @@ abstract class InstanceMirror implements ObjectMirror {
504506
get reflectee;
505507

506508
/**
507-
* Returns true if this mirror is equal to [other].
509+
* Whether this mirror is equal to [other].
510+
*
508511
* The equality holds if and only if
509-
* (1) [other] is a mirror of the same kind
510-
* and
511-
* (2) either
512-
* (a) [hasReflectee] is true and so is
513-
* [:identical(reflectee, other.reflectee):]
514-
* or
515-
* (b) the remote objects reflected by this mirror and
516-
* by [other] are identical.
512+
*
513+
* 1. [other] is a mirror of the same kind, and
514+
* 2. either
515+
*
516+
* a. [hasReflectee] is true and so is
517+
* [:identical(reflectee, other.reflectee):], or
518+
*
519+
* b. the remote objects reflected by this mirror and by [other] are
520+
* identical.
517521
*/
518522
bool operator == (other);
519523
}
@@ -548,20 +552,24 @@ abstract class ClosureMirror implements InstanceMirror {
548552

549553
/**
550554
* Executes the closure and returns a mirror on the result.
555+
*
551556
* Let *f* be the closure reflected by this mirror,
552-
* let *a1, ..., an* be the elements of [positionalArguments]
557+
* let *a1, ..., an* be the elements of [positionalArguments],
553558
* let *k1, ..., km* be the identifiers denoted by the elements of
554-
* [namedArguments.keys]
559+
* [namedArguments.keys],
555560
* and let *v1, ..., vm* be the elements of [namedArguments.values].
561+
*
556562
* Then this method will perform the method invocation
557-
* *f(a1, ..., an, k1: v1, ..., km: vm)*
558-
* If the invocation returns a result *r*, this method returns
559-
* the result of calling [reflect]\(*r*\).
560-
* If the invocation causes a compilation error
561-
* the effect is the same as if a non-reflective compilation error
562-
* had been encountered.
563-
* If the invocation throws an exception *e* (that it does not catch)
564-
* this method throws *e*.
563+
* *f(a1, ..., an, k1: v1, ..., km: vm)*.
564+
*
565+
* If the invocation returns a result *r*, this method returns the result of
566+
* calling [reflect]\(*r*\).
567+
*
568+
* If the invocation causes a compilation error, the effect is the same as if
569+
* a non-reflective compilation error had been encountered.
570+
*
571+
* If the invocation throws an exception *e* (that it does not catch), this
572+
* method throws *e*.
565573
*/
566574
InstanceMirror apply(List positionalArguments,
567575
[Map<Symbol, dynamic> namedArguments]);
@@ -588,18 +596,15 @@ abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
588596
Map<Symbol, DeclarationMirror> get declarations;
589597

590598
/**
591-
* Returns [:true:] if this mirror is equal to [other].
592-
* Otherwise returns [:false:].
599+
* Whether this mirror is equal to [other].
593600
*
594601
* The equality holds if and only if
595-
* (1) [other] is a mirror of the same kind
596-
* and
597-
* (2) The library being reflected by this mirror
598-
* and the library being reflected by [other]
599-
* are
600-
* the same library in the same isolate.
602+
*
603+
* 1. [other] is a mirror of the same kind, and
604+
* 2. The library being reflected by this mirror and the library being
605+
* reflected by [other] are the same library in the same isolate.
601606
*/
602-
bool operator ==(other);
607+
bool operator ==(other);
603608

604609
/**
605610
* Returns a list of the imports and exports in this library;
@@ -726,15 +731,18 @@ abstract class TypeMirror implements DeclarationMirror {
726731

727732

728733
/**
729-
* Checks the subtype relationship, denoted by [:<::] in the language
730-
* specification. This is the type relationship used in [:is:] test checks.
734+
* Checks the subtype relationship, denoted by `<:` in the language
735+
* specification.
736+
*
737+
* This is the type relationship used in `is` test checks.
731738
*/
732739
bool isSubtypeOf(TypeMirror other);
733740

734741
/**
735-
* Checks the assignability relationship, denoted by [:<=>:] in the language
736-
* specification. This is the type relationship tested on assignment in
737-
* checked mode.
742+
* Checks the assignability relationship, denoted by `<=>` in the language
743+
* specification.
744+
*
745+
* This is the type relationship tested on assignment in checked mode.
738746
*/
739747
bool isAssignableTo(TypeMirror other);
740748
}
@@ -806,9 +814,10 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
806814

807815
/**
808816
* The mixin of this class.
809-
* If this class is the result of a mixin application of the
810-
* form S with M, returns a class mirror on M.
811-
* Otherwise returns a class mirror on [reflectee].
817+
*
818+
* If this class is the result of a mixin application of the form S with M,
819+
* returns a class mirror on M. Otherwise returns a class mirror on
820+
* [reflectee].
812821
*/
813822
ClassMirror get mixin;
814823

@@ -817,52 +826,50 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
817826
// /// reflected class.
818827
// DeclarationMirror instanceLookup(Symbol name);
819828

820-
/**
829+
/**
821830
* Invokes the named constructor and returns a mirror on the result.
822831
*
823-
* Let *c* be the class reflected by this mirror
824-
* let *a1, ..., an* be the elements of [positionalArguments]
832+
* Let *c* be the class reflected by this mirror,
833+
* let *a1, ..., an* be the elements of [positionalArguments],
825834
* let *k1, ..., km* be the identifiers denoted by the elements of
826-
* [namedArguments.keys]
835+
* [namedArguments.keys],
827836
* and let *v1, ..., vm* be the elements of [namedArguments.values].
828-
* If [constructorName] was created from the empty string
829-
* Then this method will execute the instance creation expression
830-
* *new c(a1, ..., an, k1: v1, ..., km: vm)*
831-
* in a scope that has access to the private members
832-
* of *c*. Otherwise, let
833-
* *f* be the simple name of the constructor denoted by [constructorName]
834-
* Then this method will execute the instance creation expression
835-
* *new c.f(a1, ..., an, k1: v1, ..., km: vm)*
836-
* in a scope that has access to the private members
837-
* of *c*.
837+
*
838+
* If [constructorName] was created from the empty string, then this method
839+
* will execute the instance creation expression
840+
* *new c(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has access to
841+
* the private members of *c*.
842+
*
843+
* Otherwise, let *f* be the simple name of the constructor denoted by
844+
* [constructorName]. Then this method will execute the instance creation
845+
* expression *new c.f(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has
846+
* access to the private members of *c*.
847+
*
838848
* In either case:
839-
* If the expression evaluates to a result *r*, this method returns
840-
* the result of calling [reflect]\(*r*\).
841-
* If evaluating the expression causes a compilation error
842-
* the effect is the same as if a non-reflective compilation error
843-
* had been encountered.
844-
* If evaluating the expression throws an exception *e*
845-
* (that it does not catch)
846-
* this method throws *e*.
849+
*
850+
* * If the expression evaluates to a result *r*, this method returns the
851+
* result of calling [reflect]\(*r*\).
852+
* * If evaluating the expression causes a compilation error, the effect is
853+
* the same as if a non-reflective compilation error had been encountered.
854+
* * If evaluating the expression throws an exception *e* (that it does not
855+
* catch), this method throws *e*.
847856
*/
848857
InstanceMirror newInstance(Symbol constructorName,
849858
List positionalArguments,
850859
[Map<Symbol,dynamic> namedArguments]);
851860

852861
/**
853-
* Returns [:true:] if this mirror is equal to [other].
854-
* Otherwise returns [:false:].
862+
* Whether this mirror is equal to [other].
855863
*
856864
* The equality holds if and only if
857-
* (1) [other] is a mirror of the same kind
858-
* and
859-
* (2) This mirror and [other] reflect the same class.
860865
*
861-
* Note that if the reflected class is an invocation of
862-
* a generic class,(2) implies that the reflected class
863-
* and [other] have equal type arguments.
866+
* 1. [other] is a mirror of the same kind, and
867+
* 2. This mirror and [other] reflect the same class.
868+
*
869+
* Note that if the reflected class is an invocation of a generic class, 2.
870+
* implies that the reflected class and [other] have equal type arguments.
864871
*/
865-
bool operator == (other);
872+
bool operator == (other);
866873

867874
/**
868875
* Returns whether the class denoted by the receiver is a subclass of the
@@ -897,8 +904,7 @@ abstract class FunctionTypeMirror implements ClassMirror {
897904
}
898905

899906
/**
900-
* A [TypeVariableMirror] represents a type parameter of a generic
901-
* type.
907+
* A [TypeVariableMirror] represents a type parameter of a generic type.
902908
*/
903909
abstract class TypeVariableMirror extends TypeMirror {
904910
/**
@@ -915,16 +921,15 @@ abstract class TypeVariableMirror extends TypeMirror {
915921
bool get isStatic;
916922

917923
/**
918-
* Returns [:true:] if this mirror is equal to [other].
919-
* Otherwise returns [:false:].
924+
* Whether [other] is a [TypeVariableMirror] on the same type variable as this
925+
* mirror.
920926
*
921927
* The equality holds if and only if
922-
* (1) [other] is a mirror of the same kind
923-
* and
924-
* (2) [:simpleName == other.simpleName:] and
925-
* [:owner == other.owner:].
928+
*
929+
* 1. [other] is a mirror of the same kind, and
930+
* 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
926931
*/
927-
bool operator == (other);
932+
bool operator == (other);
928933
}
929934

930935
/**
@@ -933,11 +938,10 @@ abstract class TypeVariableMirror extends TypeMirror {
933938
abstract class TypedefMirror implements TypeMirror {
934939
/**
935940
* The defining type for this typedef.
936-
* If the the type referred to by the reflectee is a function type
937-
* *F*, the result will be [:FunctionTypeMirror:] reflecting *F*
938-
* which is abstract and has an abstract method [:call:] whose
939-
* signature corresponds to *F*.
940941
*
942+
* If the the type referred to by the reflectee is a function type *F*, the
943+
* result will be [:FunctionTypeMirror:] reflecting *F* which is abstract
944+
* and has an abstract method [:call:] whose signature corresponds to *F*.
941945
* For instance [:void f(int):] is the referent for [:typedef void f(int):].
942946
*/
943947
FunctionTypeMirror get referent;
@@ -1046,15 +1050,14 @@ abstract class MethodMirror implements DeclarationMirror {
10461050
bool get isFactoryConstructor;
10471051

10481052
/**
1049-
* Returns true if this mirror is equal to [other].
1053+
* Whether this mirror is equal to [other].
10501054
*
10511055
* The equality holds if and only if
1052-
* (1) [other] is a mirror of the same kind
1053-
* and
1054-
* (2) [:simpleName == other.simpleName:] and
1055-
* [:owner == other.owner:].
1056+
*
1057+
* 1. [other] is a mirror of the same kind, and
1058+
* 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
10561059
*/
1057-
bool operator == (other);
1060+
bool operator == (other);
10581061
}
10591062

10601063
/**
@@ -1088,15 +1091,14 @@ abstract class VariableMirror implements DeclarationMirror {
10881091
bool get isConst;
10891092

10901093
/**
1091-
* Returns true if this mirror is equal to [other].
1094+
* Whether this mirror is equal to [other].
10921095
*
10931096
* The equality holds if and only if
1094-
* (1) [other] is a mirror of the same kind
1095-
* and
1096-
* (2) [:simpleName == other.simpleName:] and
1097-
* [:owner == other.owner:].
1097+
*
1098+
* 1. [other] is a mirror of the same kind, and
1099+
* 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
10981100
*/
1099-
bool operator == (other);
1101+
bool operator == (other);
11001102
}
11011103

11021104
/**
@@ -1127,10 +1129,14 @@ abstract class ParameterMirror implements VariableMirror {
11271129
bool get hasDefaultValue;
11281130

11291131
/**
1130-
* If this is a required parameter, returns [:null:]. Otherwise returns a
1131-
* mirror on the default value for this parameter. If no default is declared
1132-
* for an optional parameter, the default is [:null:] and a mirror on [:null:]
1133-
* is returned.
1132+
* Returns the default value of an optional parameter.
1133+
*
1134+
* Returns an [InstanceMirror] on the (compile-time constant)
1135+
* default value for an optional parameter.
1136+
* If no default value is declared, it defaults to `null`
1137+
* and a mirror of `null` is returned.
1138+
*
1139+
* Returns `null` for a required parameter.
11341140
*/
11351141
InstanceMirror get defaultValue;
11361142
}

0 commit comments

Comments
 (0)