| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.element; | 3 library engine.element; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'source.dart'; | 7 import 'source.dart'; |
| 8 import 'scanner.dart' show Keyword; | 8 import 'scanner.dart' show Keyword; |
| 9 import 'ast.dart' show Identifier, LibraryIdentifier; | 9 import 'ast.dart' show Identifier, LibraryIdentifier; |
| 10 import 'sdk.dart' show DartSdk; | 10 import 'sdk.dart' show DartSdk; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 * mixin). | 155 * mixin). |
| 156 * @return `true` if this class has reference to super | 156 * @return `true` if this class has reference to super |
| 157 */ | 157 */ |
| 158 bool hasReferenceToSuper(); | 158 bool hasReferenceToSuper(); |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * Return `true` if this class is abstract. A class is abstract if it has an e
xplicit`abstract` modifier. Note, that this definition of <i>abstract</i> is dif
ferent from | 161 * Return `true` if this class is abstract. A class is abstract if it has an e
xplicit`abstract` modifier. Note, that this definition of <i>abstract</i> is dif
ferent from |
| 162 * <i>has unimplemented members</i>. | 162 * <i>has unimplemented members</i>. |
| 163 * @return `true` if this class is abstract | 163 * @return `true` if this class is abstract |
| 164 */ | 164 */ |
| 165 bool isAbstract(); | 165 bool get isAbstract; |
| 166 | 166 |
| 167 /** | 167 /** |
| 168 * Return `true` if this class is defined by a typedef construct. | 168 * Return `true` if this class is defined by a typedef construct. |
| 169 * @return `true` if this class is defined by a typedef construct | 169 * @return `true` if this class is defined by a typedef construct |
| 170 */ | 170 */ |
| 171 bool isTypedef(); | 171 bool get isTypedef; |
| 172 | 172 |
| 173 /** | 173 /** |
| 174 * Return `true` if this class can validly be used as a mixin when defining an
other class. | 174 * Return `true` if this class can validly be used as a mixin when defining an
other class. |
| 175 * The behavior of this method is defined by the Dart Language Specification i
n section 9: | 175 * The behavior of this method is defined by the Dart Language Specification i
n section 9: |
| 176 * <blockquote>It is a compile-time error if a declared or derived mixin refer
s to super. It is a | 176 * <blockquote>It is a compile-time error if a declared or derived mixin refer
s to super. It is a |
| 177 * compile-time error if a declared or derived mixin explicitly declares a con
structor. It is a | 177 * compile-time error if a declared or derived mixin explicitly declares a con
structor. It is a |
| 178 * compile-time error if a mixin is derived from a class whose superclass is n
ot | 178 * compile-time error if a mixin is derived from a class whose superclass is n
ot |
| 179 * Object.</blockquote> | 179 * Object.</blockquote> |
| 180 * @return `true` if this class can validly be used as a mixin | 180 * @return `true` if this class can validly be used as a mixin |
| 181 */ | 181 */ |
| 182 bool isValidMixin(); | 182 bool get isValidMixin; |
| 183 | 183 |
| 184 /** | 184 /** |
| 185 * Return the element representing the getter that results from looking up the
given getter in | 185 * Return the element representing the getter that results from looking up the
given getter in |
| 186 * this class with respect to the given library, or `null` if the look up fail
s. The | 186 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 187 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: | 187 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: |
| 188 * <blockquote>The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> | 188 * <blockquote>The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> |
| 189 * with respect to library <i>L</i> is: | 189 * with respect to library <i>L</i> is: |
| 190 * | 190 * |
| 191 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is | 191 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 192 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 192 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 /** | 317 /** |
| 318 * Return the constructor to which this constructor is redirecting. | 318 * Return the constructor to which this constructor is redirecting. |
| 319 * @return the constructor to which this constructor is redirecting | 319 * @return the constructor to which this constructor is redirecting |
| 320 */ | 320 */ |
| 321 ConstructorElement get redirectedConstructor; | 321 ConstructorElement get redirectedConstructor; |
| 322 | 322 |
| 323 /** | 323 /** |
| 324 * Return `true` if this constructor is a const constructor. | 324 * Return `true` if this constructor is a const constructor. |
| 325 * @return `true` if this constructor is a const constructor | 325 * @return `true` if this constructor is a const constructor |
| 326 */ | 326 */ |
| 327 bool isConst(); | 327 bool get isConst; |
| 328 | 328 |
| 329 /** | 329 /** |
| 330 * Return `true` if this constructor can be used as a default constructor - un
named and has | 330 * Return `true` if this constructor can be used as a default constructor - un
named and has |
| 331 * no required parameters. | 331 * no required parameters. |
| 332 * @return `true` if this constructor can be used as a default constructor. | 332 * @return `true` if this constructor can be used as a default constructor. |
| 333 */ | 333 */ |
| 334 bool isDefaultConstructor(); | 334 bool get isDefaultConstructor; |
| 335 | 335 |
| 336 /** | 336 /** |
| 337 * Return `true` if this constructor represents a factory constructor. | 337 * Return `true` if this constructor represents a factory constructor. |
| 338 * @return `true` if this constructor represents a factory constructor | 338 * @return `true` if this constructor represents a factory constructor |
| 339 */ | 339 */ |
| 340 bool isFactory(); | 340 bool get isFactory; |
| 341 } | 341 } |
| 342 /** | 342 /** |
| 343 * The interface `Element` defines the behavior common to all of the elements in
the element | 343 * The interface `Element` defines the behavior common to all of the elements in
the element |
| 344 * model. Generally speaking, the element model is a semantic model of the progr
am that represents | 344 * model. Generally speaking, the element model is a semantic model of the progr
am that represents |
| 345 * things that are declared with a name and hence can be referenced elsewhere in
the code. | 345 * things that are declared with a name and hence can be referenced elsewhere in
the code. |
| 346 * | 346 * |
| 347 * There are two exceptions to the general case. First, there are elements in th
e element model that | 347 * There are two exceptions to the general case. First, there are elements in th
e element model that |
| 348 * are created for the convenience of various kinds of analysis but that do not
have any | 348 * are created for the convenience of various kinds of analysis but that do not
have any |
| 349 * corresponding declaration within the source code. Such elements are marked as
being | 349 * corresponding declaration within the source code. Such elements are marked as
being |
| 350 * <i>synthetic</i>. Examples of synthetic elements include | 350 * <i>synthetic</i>. Examples of synthetic elements include |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 * @return `true` if this element is accessible to code in the given library | 472 * @return `true` if this element is accessible to code in the given library |
| 473 */ | 473 */ |
| 474 bool isAccessibleIn(LibraryElement library); | 474 bool isAccessibleIn(LibraryElement library); |
| 475 | 475 |
| 476 /** | 476 /** |
| 477 * Return `true` if this element is synthetic. A synthetic element is an eleme
nt that is not | 477 * Return `true` if this element is synthetic. A synthetic element is an eleme
nt that is not |
| 478 * represented in the source code explicitly, but is implied by the source cod
e, such as the | 478 * represented in the source code explicitly, but is implied by the source cod
e, such as the |
| 479 * default constructor for a class that does not explicitly define any constru
ctors. | 479 * default constructor for a class that does not explicitly define any constru
ctors. |
| 480 * @return `true` if this element is synthetic | 480 * @return `true` if this element is synthetic |
| 481 */ | 481 */ |
| 482 bool isSynthetic(); | 482 bool get isSynthetic; |
| 483 | 483 |
| 484 /** | 484 /** |
| 485 * Use the given visitor to visit all of the children of this element. There i
s no guarantee of | 485 * Use the given visitor to visit all of the children of this element. There i
s no guarantee of |
| 486 * the order in which the children will be visited. | 486 * the order in which the children will be visited. |
| 487 * @param visitor the visitor that will be used to visit the children of this
element | 487 * @param visitor the visitor that will be used to visit the children of this
element |
| 488 */ | 488 */ |
| 489 void visitChildren(ElementVisitor<Object> visitor); | 489 void visitChildren(ElementVisitor<Object> visitor); |
| 490 } | 490 } |
| 491 /** | 491 /** |
| 492 * The interface `ElementAnnotation` defines the behavior of objects representin
g a single | 492 * The interface `ElementAnnotation` defines the behavior of objects representin
g a single |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 * @return the type of function defined by this executable element | 673 * @return the type of function defined by this executable element |
| 674 */ | 674 */ |
| 675 FunctionType get type; | 675 FunctionType get type; |
| 676 | 676 |
| 677 /** | 677 /** |
| 678 * Return `true` if this executable element is an operator. The test may be ba
sed on the | 678 * Return `true` if this executable element is an operator. The test may be ba
sed on the |
| 679 * name of the executable element, in which case the result will be correct wh
en the name is | 679 * name of the executable element, in which case the result will be correct wh
en the name is |
| 680 * legal. | 680 * legal. |
| 681 * @return `true` if this executable element is an operator | 681 * @return `true` if this executable element is an operator |
| 682 */ | 682 */ |
| 683 bool isOperator(); | 683 bool get isOperator; |
| 684 | 684 |
| 685 /** | 685 /** |
| 686 * Return `true` if this element is a static element. A static element is an e
lement that is | 686 * Return `true` if this element is a static element. A static element is an e
lement that is |
| 687 * not associated with a particular instance, but rather with an entire librar
y or class. | 687 * not associated with a particular instance, but rather with an entire librar
y or class. |
| 688 * @return `true` if this executable element is a static element | 688 * @return `true` if this executable element is a static element |
| 689 */ | 689 */ |
| 690 bool isStatic(); | 690 bool get isStatic; |
| 691 } | 691 } |
| 692 /** | 692 /** |
| 693 * The interface `ExportElement` defines the behavior of objects representing in
formation | 693 * The interface `ExportElement` defines the behavior of objects representing in
formation |
| 694 * about a single export directive within a library. | 694 * about a single export directive within a library. |
| 695 * @coverage dart.engine.element | 695 * @coverage dart.engine.element |
| 696 */ | 696 */ |
| 697 abstract class ExportElement implements Element, UriReferencedElement { | 697 abstract class ExportElement implements Element, UriReferencedElement { |
| 698 | 698 |
| 699 /** | 699 /** |
| 700 * An empty array of export elements. | 700 * An empty array of export elements. |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 * library does not define a class with the given name. | 938 * library does not define a class with the given name. |
| 939 * @param className the name of the class to be returned | 939 * @param className the name of the class to be returned |
| 940 * @return the class with the given name that is defined in this library | 940 * @return the class with the given name that is defined in this library |
| 941 */ | 941 */ |
| 942 ClassElement getType(String className); | 942 ClassElement getType(String className); |
| 943 | 943 |
| 944 /** | 944 /** |
| 945 * Answer `true` if this library is an application that can be run in the brow
ser. | 945 * Answer `true` if this library is an application that can be run in the brow
ser. |
| 946 * @return `true` if this library is an application that can be run in the bro
wser | 946 * @return `true` if this library is an application that can be run in the bro
wser |
| 947 */ | 947 */ |
| 948 bool isBrowserApplication(); | 948 bool get isBrowserApplication; |
| 949 | 949 |
| 950 /** | 950 /** |
| 951 * Return `true` if this library is the dart:core library. | 951 * Return `true` if this library is the dart:core library. |
| 952 * @return `true` if this library is the dart:core library | 952 * @return `true` if this library is the dart:core library |
| 953 */ | 953 */ |
| 954 bool isDartCore(); | 954 bool get isDartCore; |
| 955 | 955 |
| 956 /** | 956 /** |
| 957 * Return `true` if this library is up to date with respect to the given time
stamp. If any | 957 * Return `true` if this library is up to date with respect to the given time
stamp. If any |
| 958 * transitively referenced Source is newer than the time stamp, this method re
turns false. | 958 * transitively referenced Source is newer than the time stamp, this method re
turns false. |
| 959 * @param timeStamp the time stamp to compare against | 959 * @param timeStamp the time stamp to compare against |
| 960 * @return `true` if this library is up to date with respect to the given time
stamp | 960 * @return `true` if this library is up to date with respect to the given time
stamp |
| 961 */ | 961 */ |
| 962 bool isUpToDate2(int timeStamp); | 962 bool isUpToDate2(int timeStamp); |
| 963 } | 963 } |
| 964 /** | 964 /** |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 * defined within a type. | 998 * defined within a type. |
| 999 * @coverage dart.engine.element | 999 * @coverage dart.engine.element |
| 1000 */ | 1000 */ |
| 1001 abstract class MethodElement implements ClassMemberElement, ExecutableElement { | 1001 abstract class MethodElement implements ClassMemberElement, ExecutableElement { |
| 1002 | 1002 |
| 1003 /** | 1003 /** |
| 1004 * Return `true` if this method is abstract. Methods are abstract if they are
not external | 1004 * Return `true` if this method is abstract. Methods are abstract if they are
not external |
| 1005 * and have no body. | 1005 * and have no body. |
| 1006 * @return `true` if this method is abstract | 1006 * @return `true` if this method is abstract |
| 1007 */ | 1007 */ |
| 1008 bool isAbstract(); | 1008 bool get isAbstract; |
| 1009 } | 1009 } |
| 1010 /** | 1010 /** |
| 1011 * The interface `MultiplyDefinedElement` defines the behavior of pseudo-element
s that | 1011 * The interface `MultiplyDefinedElement` defines the behavior of pseudo-element
s that |
| 1012 * represent multiple elements defined within a single scope that have the same
name. This situation | 1012 * represent multiple elements defined within a single scope that have the same
name. This situation |
| 1013 * is not allowed by the language, so objects implementing this interface always
represent an error. | 1013 * is not allowed by the language, so objects implementing this interface always
represent an error. |
| 1014 * As a result, most of the normal operations on elements do not make sense and
will return useless | 1014 * As a result, most of the normal operations on elements do not make sense and
will return useless |
| 1015 * results. | 1015 * results. |
| 1016 * @coverage dart.engine.element | 1016 * @coverage dart.engine.element |
| 1017 */ | 1017 */ |
| 1018 abstract class MultiplyDefinedElement implements Element { | 1018 abstract class MultiplyDefinedElement implements Element { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 * Return an array containing all of the parameters defined by this parameter.
A parameter will | 1060 * Return an array containing all of the parameters defined by this parameter.
A parameter will |
| 1061 * only define other parameters if it is a function typed parameter. | 1061 * only define other parameters if it is a function typed parameter. |
| 1062 * @return the parameters defined by this parameter element | 1062 * @return the parameters defined by this parameter element |
| 1063 */ | 1063 */ |
| 1064 List<ParameterElement> get parameters; | 1064 List<ParameterElement> get parameters; |
| 1065 | 1065 |
| 1066 /** | 1066 /** |
| 1067 * Return `true` if this parameter is an initializing formal parameter. | 1067 * Return `true` if this parameter is an initializing formal parameter. |
| 1068 * @return `true` if this parameter is an initializing formal parameter | 1068 * @return `true` if this parameter is an initializing formal parameter |
| 1069 */ | 1069 */ |
| 1070 bool isInitializingFormal(); | 1070 bool get isInitializingFormal; |
| 1071 } | 1071 } |
| 1072 /** | 1072 /** |
| 1073 * The interface `PrefixElement` defines the behavior common to elements that re
present a | 1073 * The interface `PrefixElement` defines the behavior common to elements that re
present a |
| 1074 * prefix used to import one or more libraries into another library. | 1074 * prefix used to import one or more libraries into another library. |
| 1075 * @coverage dart.engine.element | 1075 * @coverage dart.engine.element |
| 1076 */ | 1076 */ |
| 1077 abstract class PrefixElement implements Element { | 1077 abstract class PrefixElement implements Element { |
| 1078 | 1078 |
| 1079 /** | 1079 /** |
| 1080 * Return the library into which other libraries are imported using this prefi
x. | 1080 * Return the library into which other libraries are imported using this prefi
x. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 * explicitly defined (is not synthetic) then the variable associated with it
will be synthetic. | 1126 * explicitly defined (is not synthetic) then the variable associated with it
will be synthetic. |
| 1127 * @return the variable associated with this accessor | 1127 * @return the variable associated with this accessor |
| 1128 */ | 1128 */ |
| 1129 PropertyInducingElement get variable; | 1129 PropertyInducingElement get variable; |
| 1130 | 1130 |
| 1131 /** | 1131 /** |
| 1132 * Return `true` if this accessor is abstract. Accessors are abstract if they
are not | 1132 * Return `true` if this accessor is abstract. Accessors are abstract if they
are not |
| 1133 * external and have no body. | 1133 * external and have no body. |
| 1134 * @return `true` if this accessor is abstract | 1134 * @return `true` if this accessor is abstract |
| 1135 */ | 1135 */ |
| 1136 bool isAbstract(); | 1136 bool get isAbstract; |
| 1137 | 1137 |
| 1138 /** | 1138 /** |
| 1139 * Return `true` if this accessor represents a getter. | 1139 * Return `true` if this accessor represents a getter. |
| 1140 * @return `true` if this accessor represents a getter | 1140 * @return `true` if this accessor represents a getter |
| 1141 */ | 1141 */ |
| 1142 bool isGetter(); | 1142 bool get isGetter; |
| 1143 | 1143 |
| 1144 /** | 1144 /** |
| 1145 * Return `true` if this accessor represents a setter. | 1145 * Return `true` if this accessor represents a setter. |
| 1146 * @return `true` if this accessor represents a setter | 1146 * @return `true` if this accessor represents a setter |
| 1147 */ | 1147 */ |
| 1148 bool isSetter(); | 1148 bool get isSetter; |
| 1149 } | 1149 } |
| 1150 /** | 1150 /** |
| 1151 * The interface `PropertyInducingElement` defines the behavior of elements repr
esenting a | 1151 * The interface `PropertyInducingElement` defines the behavior of elements repr
esenting a |
| 1152 * variable that has an associated getter and possibly a setter. Note that expli
citly defined | 1152 * variable that has an associated getter and possibly a setter. Note that expli
citly defined |
| 1153 * variables implicitly define a synthetic getter and that non-`final` explicitl
y defined | 1153 * variables implicitly define a synthetic getter and that non-`final` explicitl
y defined |
| 1154 * variables implicitly define a synthetic setter. Symmetrically, synthetic fiel
ds are implicitly | 1154 * variables implicitly define a synthetic setter. Symmetrically, synthetic fiel
ds are implicitly |
| 1155 * created for explicitly defined getters and setters. The following rules apply
: | 1155 * created for explicitly defined getters and setters. The following rules apply
: |
| 1156 * | 1156 * |
| 1157 * * Every explicit variable is represented by a non-synthetic [PropertyInducing
Element]. | 1157 * * Every explicit variable is represented by a non-synthetic [PropertyInducing
Element]. |
| 1158 * * Every explicit variable induces a getter and possibly a setter, both of whi
ch are represented | 1158 * * Every explicit variable induces a getter and possibly a setter, both of whi
ch are represented |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1179 * explicitly defined (is not synthetic) then the setter associated with it wi
ll be synthetic. | 1179 * explicitly defined (is not synthetic) then the setter associated with it wi
ll be synthetic. |
| 1180 * @return the setter associated with this variable | 1180 * @return the setter associated with this variable |
| 1181 */ | 1181 */ |
| 1182 PropertyAccessorElement get setter; | 1182 PropertyAccessorElement get setter; |
| 1183 | 1183 |
| 1184 /** | 1184 /** |
| 1185 * Return `true` if this element is a static element. A static element is an e
lement that is | 1185 * Return `true` if this element is a static element. A static element is an e
lement that is |
| 1186 * not associated with a particular instance, but rather with an entire librar
y or class. | 1186 * not associated with a particular instance, but rather with an entire librar
y or class. |
| 1187 * @return `true` if this executable element is a static element | 1187 * @return `true` if this executable element is a static element |
| 1188 */ | 1188 */ |
| 1189 bool isStatic(); | 1189 bool get isStatic; |
| 1190 } | 1190 } |
| 1191 /** | 1191 /** |
| 1192 * The interface `ShowElementCombinator` defines the behavior of combinators tha
t cause some | 1192 * The interface `ShowElementCombinator` defines the behavior of combinators tha
t cause some |
| 1193 * of the names in a namespace to be visible (and the rest hidden) when being im
ported. | 1193 * of the names in a namespace to be visible (and the rest hidden) when being im
ported. |
| 1194 * @coverage dart.engine.element | 1194 * @coverage dart.engine.element |
| 1195 */ | 1195 */ |
| 1196 abstract class ShowElementCombinator implements NamespaceCombinator { | 1196 abstract class ShowElementCombinator implements NamespaceCombinator { |
| 1197 | 1197 |
| 1198 /** | 1198 /** |
| 1199 * Return an array containing the names that are to be made visible in the imp
orting library if | 1199 * Return an array containing the names that are to be made visible in the imp
orting library if |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 * Return the declared type of this variable, or `null` if the variable did no
t have a | 1270 * Return the declared type of this variable, or `null` if the variable did no
t have a |
| 1271 * declared type (such as if it was declared using the keyword 'var'). | 1271 * declared type (such as if it was declared using the keyword 'var'). |
| 1272 * @return the declared type of this variable | 1272 * @return the declared type of this variable |
| 1273 */ | 1273 */ |
| 1274 Type2 get type; | 1274 Type2 get type; |
| 1275 | 1275 |
| 1276 /** | 1276 /** |
| 1277 * Return `true` if this variable was declared with the 'const' modifier. | 1277 * Return `true` if this variable was declared with the 'const' modifier. |
| 1278 * @return `true` if this variable was declared with the 'const' modifier | 1278 * @return `true` if this variable was declared with the 'const' modifier |
| 1279 */ | 1279 */ |
| 1280 bool isConst(); | 1280 bool get isConst; |
| 1281 | 1281 |
| 1282 /** | 1282 /** |
| 1283 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are | 1283 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are |
| 1284 * declared with the 'const' modifier will return `false` even though they are
implicitly | 1284 * declared with the 'const' modifier will return `false` even though they are
implicitly |
| 1285 * final. | 1285 * final. |
| 1286 * @return `true` if this variable was declared with the 'final' modifier | 1286 * @return `true` if this variable was declared with the 'final' modifier |
| 1287 */ | 1287 */ |
| 1288 bool isFinal(); | 1288 bool get isFinal; |
| 1289 } | 1289 } |
| 1290 /** | 1290 /** |
| 1291 * Instances of the class `GeneralizingElementVisitor` implement an element visi
tor that will | 1291 * Instances of the class `GeneralizingElementVisitor` implement an element visi
tor that will |
| 1292 * recursively visit all of the elements in an element model (like instances of
the class[RecursiveElementVisitor]). In addition, when an element of a specific
type is visited not | 1292 * recursively visit all of the elements in an element model (like instances of
the class[RecursiveElementVisitor]). In addition, when an element of a specific
type is visited not |
| 1293 * only will the visit method for that specific type of element be invoked, but
additional methods | 1293 * only will the visit method for that specific type of element be invoked, but
additional methods |
| 1294 * for the supertypes of that element will also be invoked. For example, using a
n instance of this | 1294 * for the supertypes of that element will also be invoked. For example, using a
n instance of this |
| 1295 * class to visit a [MethodElement] will cause the method[visitMethodElement] to
be invoked but will also cause the methods[visitExecutableElement] and [visitEl
ement] to be | 1295 * class to visit a [MethodElement] will cause the method[visitMethodElement] to
be invoked but will also cause the methods[visitExecutableElement] and [visitEl
ement] to be |
| 1296 * subsequently invoked. This allows visitors to be written that visit all execu
table elements | 1296 * subsequently invoked. This allows visitors to be written that visit all execu
table elements |
| 1297 * without needing to override the visit method for each of the specific subclas
ses of[ExecutableElement]. | 1297 * without needing to override the visit method for each of the specific subclas
ses of[ExecutableElement]. |
| 1298 * | 1298 * |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 for (FieldElement fieldElement in _fields) { | 1622 for (FieldElement fieldElement in _fields) { |
| 1623 if (name2 == fieldElement.name) { | 1623 if (name2 == fieldElement.name) { |
| 1624 return fieldElement; | 1624 return fieldElement; |
| 1625 } | 1625 } |
| 1626 } | 1626 } |
| 1627 return null; | 1627 return null; |
| 1628 } | 1628 } |
| 1629 List<FieldElement> get fields => _fields; | 1629 List<FieldElement> get fields => _fields; |
| 1630 PropertyAccessorElement getGetter(String getterName) { | 1630 PropertyAccessorElement getGetter(String getterName) { |
| 1631 for (PropertyAccessorElement accessor in _accessors) { | 1631 for (PropertyAccessorElement accessor in _accessors) { |
| 1632 if (accessor.isGetter() && accessor.name == getterName) { | 1632 if (accessor.isGetter && accessor.name == getterName) { |
| 1633 return accessor; | 1633 return accessor; |
| 1634 } | 1634 } |
| 1635 } | 1635 } |
| 1636 return null; | 1636 return null; |
| 1637 } | 1637 } |
| 1638 List<InterfaceType> get interfaces => _interfaces; | 1638 List<InterfaceType> get interfaces => _interfaces; |
| 1639 ElementKind get kind => ElementKind.CLASS; | 1639 ElementKind get kind => ElementKind.CLASS; |
| 1640 MethodElement getMethod(String methodName) { | 1640 MethodElement getMethod(String methodName) { |
| 1641 for (MethodElement method in _methods) { | 1641 for (MethodElement method in _methods) { |
| 1642 if (method.name == methodName) { | 1642 if (method.name == methodName) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1654 return element; | 1654 return element; |
| 1655 } | 1655 } |
| 1656 } | 1656 } |
| 1657 return null; | 1657 return null; |
| 1658 } | 1658 } |
| 1659 PropertyAccessorElement getSetter(String setterName) { | 1659 PropertyAccessorElement getSetter(String setterName) { |
| 1660 if (!setterName.endsWith("=")) { | 1660 if (!setterName.endsWith("=")) { |
| 1661 setterName += '='; | 1661 setterName += '='; |
| 1662 } | 1662 } |
| 1663 for (PropertyAccessorElement accessor in _accessors) { | 1663 for (PropertyAccessorElement accessor in _accessors) { |
| 1664 if (accessor.isSetter() && accessor.name == setterName) { | 1664 if (accessor.isSetter && accessor.name == setterName) { |
| 1665 return accessor; | 1665 return accessor; |
| 1666 } | 1666 } |
| 1667 } | 1667 } |
| 1668 return null; | 1668 return null; |
| 1669 } | 1669 } |
| 1670 InterfaceType get supertype => _supertype; | 1670 InterfaceType get supertype => _supertype; |
| 1671 InterfaceType get type => _type; | 1671 InterfaceType get type => _type; |
| 1672 List<TypeVariableElement> get typeVariables => _typeVariables; | 1672 List<TypeVariableElement> get typeVariables => _typeVariables; |
| 1673 ConstructorElement get unnamedConstructor { | 1673 ConstructorElement get unnamedConstructor { |
| 1674 for (ConstructorElement element in constructors) { | 1674 for (ConstructorElement element in constructors) { |
| 1675 String name = element.displayName; | 1675 String name = element.displayName; |
| 1676 if (name == null || name.isEmpty) { | 1676 if (name == null || name.isEmpty) { |
| 1677 return element; | 1677 return element; |
| 1678 } | 1678 } |
| 1679 } | 1679 } |
| 1680 return null; | 1680 return null; |
| 1681 } | 1681 } |
| 1682 bool hasDefaultConstructor() { | 1682 bool hasDefaultConstructor() { |
| 1683 for (ConstructorElement constructor in constructors) { | 1683 for (ConstructorElement constructor in constructors) { |
| 1684 if (constructor.isDefaultConstructor()) { | 1684 if (constructor.isDefaultConstructor) { |
| 1685 return true; | 1685 return true; |
| 1686 } | 1686 } |
| 1687 } | 1687 } |
| 1688 return false; | 1688 return false; |
| 1689 } | 1689 } |
| 1690 bool hasNonFinalField() { | 1690 bool hasNonFinalField() { |
| 1691 List<ClassElement> classesToVisit = new List<ClassElement>(); | 1691 List<ClassElement> classesToVisit = new List<ClassElement>(); |
| 1692 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 1692 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 1693 classesToVisit.add(this); | 1693 classesToVisit.add(this); |
| 1694 while (!classesToVisit.isEmpty) { | 1694 while (!classesToVisit.isEmpty) { |
| 1695 ClassElement currentElement = classesToVisit.removeAt(0); | 1695 ClassElement currentElement = classesToVisit.removeAt(0); |
| 1696 if (javaSetAdd(visitedClasses, currentElement)) { | 1696 if (javaSetAdd(visitedClasses, currentElement)) { |
| 1697 for (FieldElement field in currentElement.fields) { | 1697 for (FieldElement field in currentElement.fields) { |
| 1698 if (!field.isFinal() && !field.isConst() && !field.isStatic() && !fiel
d.isSynthetic()) { | 1698 if (!field.isFinal && !field.isConst && !field.isStatic && !field.isSy
nthetic) { |
| 1699 return true; | 1699 return true; |
| 1700 } | 1700 } |
| 1701 } | 1701 } |
| 1702 for (InterfaceType mixinType in currentElement.mixins) { | 1702 for (InterfaceType mixinType in currentElement.mixins) { |
| 1703 ClassElement mixinElement = mixinType.element; | 1703 ClassElement mixinElement = mixinType.element; |
| 1704 classesToVisit.add(mixinElement); | 1704 classesToVisit.add(mixinElement); |
| 1705 } | 1705 } |
| 1706 InterfaceType supertype = currentElement.supertype; | 1706 InterfaceType supertype = currentElement.supertype; |
| 1707 if (supertype != null) { | 1707 if (supertype != null) { |
| 1708 ClassElement superElement = supertype.element; | 1708 ClassElement superElement = supertype.element; |
| 1709 if (superElement != null) { | 1709 if (superElement != null) { |
| 1710 classesToVisit.add(superElement); | 1710 classesToVisit.add(superElement); |
| 1711 } | 1711 } |
| 1712 } | 1712 } |
| 1713 } | 1713 } |
| 1714 } | 1714 } |
| 1715 return false; | 1715 return false; |
| 1716 } | 1716 } |
| 1717 bool hasReferenceToSuper() => hasModifier(Modifier.REFERENCES_SUPER); | 1717 bool hasReferenceToSuper() => hasModifier(Modifier.REFERENCES_SUPER); |
| 1718 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 1718 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 1719 bool isTypedef() => hasModifier(Modifier.TYPEDEF); | 1719 bool get isTypedef => hasModifier(Modifier.TYPEDEF); |
| 1720 bool isValidMixin() => hasModifier(Modifier.MIXIN); | 1720 bool get isValidMixin => hasModifier(Modifier.MIXIN); |
| 1721 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { | 1721 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { |
| 1722 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 1722 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 1723 ClassElement currentElement = this; | 1723 ClassElement currentElement = this; |
| 1724 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 1724 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
| 1725 javaSetAdd(visitedClasses, currentElement); | 1725 javaSetAdd(visitedClasses, currentElement); |
| 1726 PropertyAccessorElement element = currentElement.getGetter(getterName); | 1726 PropertyAccessorElement element = currentElement.getGetter(getterName); |
| 1727 if (element != null && element.isAccessibleIn(library)) { | 1727 if (element != null && element.isAccessibleIn(library)) { |
| 1728 return element; | 1728 return element; |
| 1729 } | 1729 } |
| 1730 for (InterfaceType mixin in currentElement.mixins) { | 1730 for (InterfaceType mixin in currentElement.mixins) { |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 /** | 2247 /** |
| 2248 * Initialize a newly created constructor element to have the given name. | 2248 * Initialize a newly created constructor element to have the given name. |
| 2249 * @param name the name of this element | 2249 * @param name the name of this element |
| 2250 */ | 2250 */ |
| 2251 ConstructorElementImpl(Identifier name) : super.con1(name) { | 2251 ConstructorElementImpl(Identifier name) : super.con1(name) { |
| 2252 } | 2252 } |
| 2253 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 2253 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 2254 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 2254 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 2255 ElementKind get kind => ElementKind.CONSTRUCTOR; | 2255 ElementKind get kind => ElementKind.CONSTRUCTOR; |
| 2256 ConstructorElement get redirectedConstructor => _redirectedConstructor; | 2256 ConstructorElement get redirectedConstructor => _redirectedConstructor; |
| 2257 bool isConst() => hasModifier(Modifier.CONST); | 2257 bool get isConst => hasModifier(Modifier.CONST); |
| 2258 bool isDefaultConstructor() { | 2258 bool get isDefaultConstructor { |
| 2259 String name = this.name; | 2259 String name = this.name; |
| 2260 if (name != null && name.length != 0) { | 2260 if (name != null && name.length != 0) { |
| 2261 return false; | 2261 return false; |
| 2262 } | 2262 } |
| 2263 for (ParameterElement parameter in parameters) { | 2263 for (ParameterElement parameter in parameters) { |
| 2264 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { | 2264 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { |
| 2265 return false; | 2265 return false; |
| 2266 } | 2266 } |
| 2267 } | 2267 } |
| 2268 return true; | 2268 return true; |
| 2269 } | 2269 } |
| 2270 bool isFactory() => hasModifier(Modifier.FACTORY); | 2270 bool get isFactory => hasModifier(Modifier.FACTORY); |
| 2271 bool isStatic() => false; | 2271 bool get isStatic => false; |
| 2272 | 2272 |
| 2273 /** | 2273 /** |
| 2274 * Set whether this constructor represents a 'const' constructor to the given
value. | 2274 * Set whether this constructor represents a 'const' constructor to the given
value. |
| 2275 * @param isConst `true` if this constructor represents a 'const' constructor | 2275 * @param isConst `true` if this constructor represents a 'const' constructor |
| 2276 */ | 2276 */ |
| 2277 void set const2(bool isConst) { | 2277 void set const2(bool isConst) { |
| 2278 setModifier(Modifier.CONST, isConst); | 2278 setModifier(Modifier.CONST, isConst); |
| 2279 } | 2279 } |
| 2280 | 2280 |
| 2281 /** | 2281 /** |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 _cachedHashCode = location.hashCode; | 2526 _cachedHashCode = location.hashCode; |
| 2527 } | 2527 } |
| 2528 return _cachedHashCode; | 2528 return _cachedHashCode; |
| 2529 } | 2529 } |
| 2530 bool isAccessibleIn(LibraryElement library2) { | 2530 bool isAccessibleIn(LibraryElement library2) { |
| 2531 if (Identifier.isPrivateName(_name)) { | 2531 if (Identifier.isPrivateName(_name)) { |
| 2532 return library2 == library; | 2532 return library2 == library; |
| 2533 } | 2533 } |
| 2534 return true; | 2534 return true; |
| 2535 } | 2535 } |
| 2536 bool isSynthetic() => hasModifier(Modifier.SYNTHETIC); | 2536 bool get isSynthetic => hasModifier(Modifier.SYNTHETIC); |
| 2537 | 2537 |
| 2538 /** | 2538 /** |
| 2539 * Set the metadata associate with this element to the given array of annotati
ons. | 2539 * Set the metadata associate with this element to the given array of annotati
ons. |
| 2540 * @param metadata the metadata to be associated with this element | 2540 * @param metadata the metadata to be associated with this element |
| 2541 */ | 2541 */ |
| 2542 void set metadata(List<ElementAnnotation> metadata2) { | 2542 void set metadata(List<ElementAnnotation> metadata2) { |
| 2543 this._metadata = metadata2; | 2543 this._metadata = metadata2; |
| 2544 } | 2544 } |
| 2545 | 2545 |
| 2546 /** | 2546 /** |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2920 } | 2920 } |
| 2921 } | 2921 } |
| 2922 return null; | 2922 return null; |
| 2923 } | 2923 } |
| 2924 List<FunctionElement> get functions => _functions; | 2924 List<FunctionElement> get functions => _functions; |
| 2925 List<LabelElement> get labels => _labels; | 2925 List<LabelElement> get labels => _labels; |
| 2926 List<LocalVariableElement> get localVariables => _localVariables; | 2926 List<LocalVariableElement> get localVariables => _localVariables; |
| 2927 List<ParameterElement> get parameters => _parameters; | 2927 List<ParameterElement> get parameters => _parameters; |
| 2928 Type2 get returnType => _returnType; | 2928 Type2 get returnType => _returnType; |
| 2929 FunctionType get type => _type; | 2929 FunctionType get type => _type; |
| 2930 bool isOperator() => false; | 2930 bool get isOperator => false; |
| 2931 | 2931 |
| 2932 /** | 2932 /** |
| 2933 * Set the functions defined within this executable element to the given funct
ions. | 2933 * Set the functions defined within this executable element to the given funct
ions. |
| 2934 * @param functions the functions defined within this executable element | 2934 * @param functions the functions defined within this executable element |
| 2935 */ | 2935 */ |
| 2936 void set functions(List<FunctionElement> functions2) { | 2936 void set functions(List<FunctionElement> functions2) { |
| 2937 for (FunctionElement function in functions2) { | 2937 for (FunctionElement function in functions2) { |
| 2938 ((function as FunctionElementImpl)).enclosingElement = this; | 2938 ((function as FunctionElementImpl)).enclosingElement = this; |
| 2939 } | 2939 } |
| 2940 this._functions = functions2; | 2940 this._functions = functions2; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 * @param name the name of this element | 3130 * @param name the name of this element |
| 3131 */ | 3131 */ |
| 3132 FieldElementImpl.con2(String name) : super.con2(name) { | 3132 FieldElementImpl.con2(String name) : super.con2(name) { |
| 3133 _jtd_constructor_205_impl(name); | 3133 _jtd_constructor_205_impl(name); |
| 3134 } | 3134 } |
| 3135 _jtd_constructor_205_impl(String name) { | 3135 _jtd_constructor_205_impl(String name) { |
| 3136 } | 3136 } |
| 3137 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 3137 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 3138 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3138 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 3139 ElementKind get kind => ElementKind.FIELD; | 3139 ElementKind get kind => ElementKind.FIELD; |
| 3140 bool isStatic() => hasModifier(Modifier.STATIC); | 3140 bool get isStatic => hasModifier(Modifier.STATIC); |
| 3141 | 3141 |
| 3142 /** | 3142 /** |
| 3143 * Set whether this field is static to correspond to the given value. | 3143 * Set whether this field is static to correspond to the given value. |
| 3144 * @param isStatic `true` if the field is static | 3144 * @param isStatic `true` if the field is static |
| 3145 */ | 3145 */ |
| 3146 void set static(bool isStatic) { | 3146 void set static(bool isStatic) { |
| 3147 setModifier(Modifier.STATIC, isStatic); | 3147 setModifier(Modifier.STATIC, isStatic); |
| 3148 } | 3148 } |
| 3149 } | 3149 } |
| 3150 /** | 3150 /** |
| 3151 * Instances of the class `FieldFormalParameterElementImpl` extend[ParameterElem
entImpl] to provide the additional information of the [FieldElement]associated w
ith the parameter. | 3151 * Instances of the class `FieldFormalParameterElementImpl` extend[ParameterElem
entImpl] to provide the additional information of the [FieldElement]associated w
ith the parameter. |
| 3152 * @coverage dart.engine.element | 3152 * @coverage dart.engine.element |
| 3153 */ | 3153 */ |
| 3154 class FieldFormalParameterElementImpl extends ParameterElementImpl implements Fi
eldFormalParameterElement { | 3154 class FieldFormalParameterElementImpl extends ParameterElementImpl implements Fi
eldFormalParameterElement { |
| 3155 | 3155 |
| 3156 /** | 3156 /** |
| 3157 * The field associated with this field formal parameter. | 3157 * The field associated with this field formal parameter. |
| 3158 */ | 3158 */ |
| 3159 FieldElement _field; | 3159 FieldElement _field; |
| 3160 | 3160 |
| 3161 /** | 3161 /** |
| 3162 * Initialize a newly created parameter element to have the given name. | 3162 * Initialize a newly created parameter element to have the given name. |
| 3163 * @param name the name of this element | 3163 * @param name the name of this element |
| 3164 */ | 3164 */ |
| 3165 FieldFormalParameterElementImpl(Identifier name) : super(name) { | 3165 FieldFormalParameterElementImpl(Identifier name) : super(name) { |
| 3166 } | 3166 } |
| 3167 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); | 3167 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); |
| 3168 FieldElement get field => _field; | 3168 FieldElement get field => _field; |
| 3169 bool isInitializingFormal() => true; | 3169 bool get isInitializingFormal => true; |
| 3170 | 3170 |
| 3171 /** | 3171 /** |
| 3172 * Set the field element associated with this field formal parameter to the gi
ven element. | 3172 * Set the field element associated with this field formal parameter to the gi
ven element. |
| 3173 * @param field the new field element | 3173 * @param field the new field element |
| 3174 */ | 3174 */ |
| 3175 void set field(FieldElement field2) { | 3175 void set field(FieldElement field2) { |
| 3176 this._field = field2; | 3176 this._field = field2; |
| 3177 } | 3177 } |
| 3178 } | 3178 } |
| 3179 /** | 3179 /** |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 } | 3231 } |
| 3232 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); | 3232 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); |
| 3233 String get identifier => "${name}@${nameOffset}"; | 3233 String get identifier => "${name}@${nameOffset}"; |
| 3234 ElementKind get kind => ElementKind.FUNCTION; | 3234 ElementKind get kind => ElementKind.FUNCTION; |
| 3235 SourceRange get visibleRange { | 3235 SourceRange get visibleRange { |
| 3236 if (_visibleRangeLength < 0) { | 3236 if (_visibleRangeLength < 0) { |
| 3237 return null; | 3237 return null; |
| 3238 } | 3238 } |
| 3239 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 3239 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 3240 } | 3240 } |
| 3241 bool isStatic() => enclosingElement is CompilationUnitElement; | 3241 bool get isStatic => enclosingElement is CompilationUnitElement; |
| 3242 | 3242 |
| 3243 /** | 3243 /** |
| 3244 * Set the visible range for this element to the range starting at the given o
ffset with the given | 3244 * Set the visible range for this element to the range starting at the given o
ffset with the given |
| 3245 * length. | 3245 * length. |
| 3246 * @param offset the offset to the beginning of the visible range for this ele
ment | 3246 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 3247 * @param length the length of the visible range for this element, or `-1` if
this element | 3247 * @param length the length of the visible range for this element, or `-1` if
this element |
| 3248 * does not have a visible range | 3248 * does not have a visible range |
| 3249 */ | 3249 */ |
| 3250 void setVisibleRange(int offset, int length) { | 3250 void setVisibleRange(int offset, int length) { |
| 3251 _visibleRangeOffset = offset; | 3251 _visibleRangeOffset = offset; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3632 this._onSwitchMember = onSwitchMember; | 3632 this._onSwitchMember = onSwitchMember; |
| 3633 } | 3633 } |
| 3634 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); | 3634 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); |
| 3635 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; | 3635 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; |
| 3636 ElementKind get kind => ElementKind.LABEL; | 3636 ElementKind get kind => ElementKind.LABEL; |
| 3637 | 3637 |
| 3638 /** | 3638 /** |
| 3639 * Return `true` if this label is associated with a `switch` member (`case` or
`default`). | 3639 * Return `true` if this label is associated with a `switch` member (`case` or
`default`). |
| 3640 * @return `true` if this label is associated with a `switch` member | 3640 * @return `true` if this label is associated with a `switch` member |
| 3641 */ | 3641 */ |
| 3642 bool isOnSwitchMember() => _onSwitchMember; | 3642 bool get isOnSwitchMember => _onSwitchMember; |
| 3643 | 3643 |
| 3644 /** | 3644 /** |
| 3645 * Return `true` if this label is associated with a `switch` statement. | 3645 * Return `true` if this label is associated with a `switch` statement. |
| 3646 * @return `true` if this label is associated with a `switch` statement | 3646 * @return `true` if this label is associated with a `switch` statement |
| 3647 */ | 3647 */ |
| 3648 bool isOnSwitchStatement() => _onSwitchStatement; | 3648 bool get isOnSwitchStatement => _onSwitchStatement; |
| 3649 } | 3649 } |
| 3650 /** | 3650 /** |
| 3651 * Instances of the class `LibraryElementImpl` implement a `LibraryElement`. | 3651 * Instances of the class `LibraryElementImpl` implement a `LibraryElement`. |
| 3652 * @coverage dart.engine.element | 3652 * @coverage dart.engine.element |
| 3653 */ | 3653 */ |
| 3654 class LibraryElementImpl extends ElementImpl implements LibraryElement { | 3654 class LibraryElementImpl extends ElementImpl implements LibraryElement { |
| 3655 | 3655 |
| 3656 /** | 3656 /** |
| 3657 * An empty array of library elements. | 3657 * An empty array of library elements. |
| 3658 */ | 3658 */ |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3802 } | 3802 } |
| 3803 for (CompilationUnitElement part in _parts) { | 3803 for (CompilationUnitElement part in _parts) { |
| 3804 type = part.getType(className); | 3804 type = part.getType(className); |
| 3805 if (type != null) { | 3805 if (type != null) { |
| 3806 return type; | 3806 return type; |
| 3807 } | 3807 } |
| 3808 } | 3808 } |
| 3809 return null; | 3809 return null; |
| 3810 } | 3810 } |
| 3811 int get hashCode => _definingCompilationUnit.hashCode; | 3811 int get hashCode => _definingCompilationUnit.hashCode; |
| 3812 bool isBrowserApplication() => _entryPoint != null && isOrImportsBrowserLibrar
y(); | 3812 bool get isBrowserApplication => _entryPoint != null && isOrImportsBrowserLibr
ary; |
| 3813 bool isDartCore() => name == "dart.core"; | 3813 bool get isDartCore => name == "dart.core"; |
| 3814 bool isUpToDate2(int timeStamp) { | 3814 bool isUpToDate2(int timeStamp) { |
| 3815 Set<LibraryElement> visitedLibraries = new Set(); | 3815 Set<LibraryElement> visitedLibraries = new Set(); |
| 3816 return isUpToDate(this, timeStamp, visitedLibraries); | 3816 return isUpToDate(this, timeStamp, visitedLibraries); |
| 3817 } | 3817 } |
| 3818 | 3818 |
| 3819 /** | 3819 /** |
| 3820 * Set the compilation unit that defines this library to the given compilation
unit. | 3820 * Set the compilation unit that defines this library to the given compilation
unit. |
| 3821 * @param definingCompilationUnit the compilation unit that defines this libra
ry | 3821 * @param definingCompilationUnit the compilation unit that defines this libra
ry |
| 3822 */ | 3822 */ |
| 3823 void set definingCompilationUnit(CompilationUnitElement definingCompilationUni
t2) { | 3823 void set definingCompilationUnit(CompilationUnitElement definingCompilationUni
t2) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3874 safelyVisitChild(_definingCompilationUnit, visitor); | 3874 safelyVisitChild(_definingCompilationUnit, visitor); |
| 3875 safelyVisitChildren(_exports, visitor); | 3875 safelyVisitChildren(_exports, visitor); |
| 3876 safelyVisitChildren(_imports, visitor); | 3876 safelyVisitChildren(_imports, visitor); |
| 3877 safelyVisitChildren(_parts, visitor); | 3877 safelyVisitChildren(_parts, visitor); |
| 3878 } | 3878 } |
| 3879 | 3879 |
| 3880 /** | 3880 /** |
| 3881 * Answer `true` if the receiver directly or indirectly imports the dart:html
libraries. | 3881 * Answer `true` if the receiver directly or indirectly imports the dart:html
libraries. |
| 3882 * @return `true` if the receiver directly or indirectly imports the dart:html
libraries | 3882 * @return `true` if the receiver directly or indirectly imports the dart:html
libraries |
| 3883 */ | 3883 */ |
| 3884 bool isOrImportsBrowserLibrary() { | 3884 bool get isOrImportsBrowserLibrary { |
| 3885 List<LibraryElement> visited = new List<LibraryElement>(); | 3885 List<LibraryElement> visited = new List<LibraryElement>(); |
| 3886 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); | 3886 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); |
| 3887 visited.add(this); | 3887 visited.add(this); |
| 3888 for (int index = 0; index < visited.length; index++) { | 3888 for (int index = 0; index < visited.length; index++) { |
| 3889 LibraryElement library = visited[index]; | 3889 LibraryElement library = visited[index]; |
| 3890 Source source = library.definingCompilationUnit.source; | 3890 Source source = library.definingCompilationUnit.source; |
| 3891 if (source == htmlLibSource) { | 3891 if (source == htmlLibSource) { |
| 3892 return true; | 3892 return true; |
| 3893 } | 3893 } |
| 3894 for (LibraryElement importedLibrary in library.importedLibraries) { | 3894 for (LibraryElement importedLibrary in library.importedLibraries) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3990 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { | 3990 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { |
| 3991 _jtd_constructor_219_impl(name, nameOffset); | 3991 _jtd_constructor_219_impl(name, nameOffset); |
| 3992 } | 3992 } |
| 3993 _jtd_constructor_219_impl(String name, int nameOffset) { | 3993 _jtd_constructor_219_impl(String name, int nameOffset) { |
| 3994 } | 3994 } |
| 3995 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 3995 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
| 3996 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3996 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 3997 ElementKind get kind => ElementKind.METHOD; | 3997 ElementKind get kind => ElementKind.METHOD; |
| 3998 String get name { | 3998 String get name { |
| 3999 String name = super.name; | 3999 String name = super.name; |
| 4000 if (isOperator() && name == "-") { | 4000 if (isOperator && name == "-") { |
| 4001 if (parameters.length == 0) { | 4001 if (parameters.length == 0) { |
| 4002 return "unary-"; | 4002 return "unary-"; |
| 4003 } | 4003 } |
| 4004 } | 4004 } |
| 4005 return super.name; | 4005 return super.name; |
| 4006 } | 4006 } |
| 4007 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 4007 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 4008 bool isOperator() { | 4008 bool get isOperator { |
| 4009 String name = displayName; | 4009 String name = displayName; |
| 4010 if (name.isEmpty) { | 4010 if (name.isEmpty) { |
| 4011 return false; | 4011 return false; |
| 4012 } | 4012 } |
| 4013 int first = name.codeUnitAt(0); | 4013 int first = name.codeUnitAt(0); |
| 4014 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A
) || first == 0x5F || first == 0x24); | 4014 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A
) || first == 0x5F || first == 0x24); |
| 4015 } | 4015 } |
| 4016 bool isStatic() => hasModifier(Modifier.STATIC); | 4016 bool get isStatic => hasModifier(Modifier.STATIC); |
| 4017 | 4017 |
| 4018 /** | 4018 /** |
| 4019 * Set whether this method is abstract to correspond to the given value. | 4019 * Set whether this method is abstract to correspond to the given value. |
| 4020 * @param isAbstract `true` if the method is abstract | 4020 * @param isAbstract `true` if the method is abstract |
| 4021 */ | 4021 */ |
| 4022 void set abstract(bool isAbstract) { | 4022 void set abstract(bool isAbstract) { |
| 4023 setModifier(Modifier.ABSTRACT, isAbstract); | 4023 setModifier(Modifier.ABSTRACT, isAbstract); |
| 4024 } | 4024 } |
| 4025 | 4025 |
| 4026 /** | 4026 /** |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4114 int get nameOffset => -1; | 4114 int get nameOffset => -1; |
| 4115 Source get source => null; | 4115 Source get source => null; |
| 4116 bool isAccessibleIn(LibraryElement library) { | 4116 bool isAccessibleIn(LibraryElement library) { |
| 4117 for (Element element in _conflictingElements) { | 4117 for (Element element in _conflictingElements) { |
| 4118 if (element.isAccessibleIn(library)) { | 4118 if (element.isAccessibleIn(library)) { |
| 4119 return true; | 4119 return true; |
| 4120 } | 4120 } |
| 4121 } | 4121 } |
| 4122 return false; | 4122 return false; |
| 4123 } | 4123 } |
| 4124 bool isSynthetic() => true; | 4124 bool get isSynthetic => true; |
| 4125 String toString() { | 4125 String toString() { |
| 4126 JavaStringBuilder builder = new JavaStringBuilder(); | 4126 JavaStringBuilder builder = new JavaStringBuilder(); |
| 4127 builder.append("["); | 4127 builder.append("["); |
| 4128 int count = _conflictingElements.length; | 4128 int count = _conflictingElements.length; |
| 4129 for (int i = 0; i < count; i++) { | 4129 for (int i = 0; i < count; i++) { |
| 4130 if (i > 0) { | 4130 if (i > 0) { |
| 4131 builder.append(", "); | 4131 builder.append(", "); |
| 4132 } | 4132 } |
| 4133 ((_conflictingElements[i] as ElementImpl)).appendTo(builder); | 4133 ((_conflictingElements[i] as ElementImpl)).appendTo(builder); |
| 4134 } | 4134 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4228 } | 4228 } |
| 4229 ElementKind get kind => ElementKind.PARAMETER; | 4229 ElementKind get kind => ElementKind.PARAMETER; |
| 4230 ParameterKind get parameterKind => _parameterKind; | 4230 ParameterKind get parameterKind => _parameterKind; |
| 4231 List<ParameterElement> get parameters => _parameters; | 4231 List<ParameterElement> get parameters => _parameters; |
| 4232 SourceRange get visibleRange { | 4232 SourceRange get visibleRange { |
| 4233 if (_visibleRangeLength < 0) { | 4233 if (_visibleRangeLength < 0) { |
| 4234 return null; | 4234 return null; |
| 4235 } | 4235 } |
| 4236 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 4236 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 4237 } | 4237 } |
| 4238 bool isInitializingFormal() => false; | 4238 bool get isInitializingFormal => false; |
| 4239 | 4239 |
| 4240 /** | 4240 /** |
| 4241 * Set the range of the default value for this parameter to the range starting
at the given offset | 4241 * Set the range of the default value for this parameter to the range starting
at the given offset |
| 4242 * with the given length. | 4242 * with the given length. |
| 4243 * @param offset the offset to the beginning of the default value range for th
is element | 4243 * @param offset the offset to the beginning of the default value range for th
is element |
| 4244 * @param length the length of the default value range for this element, or `-
1` if this | 4244 * @param length the length of the default value range for this element, or `-
1` if this |
| 4245 * element does not have a default value | 4245 * element does not have a default value |
| 4246 */ | 4246 */ |
| 4247 void setDefaultValueRange(int offset, int length) { | 4247 void setDefaultValueRange(int offset, int length) { |
| 4248 _defaultValueRangeOffset = offset; | 4248 _defaultValueRangeOffset = offset; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4377 * @param variable the variable with which this access is associated | 4377 * @param variable the variable with which this access is associated |
| 4378 */ | 4378 */ |
| 4379 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe
r.con2(variable2.name, variable2.nameOffset) { | 4379 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe
r.con2(variable2.name, variable2.nameOffset) { |
| 4380 _jtd_constructor_225_impl(variable2); | 4380 _jtd_constructor_225_impl(variable2); |
| 4381 } | 4381 } |
| 4382 _jtd_constructor_225_impl(PropertyInducingElementImpl variable2) { | 4382 _jtd_constructor_225_impl(PropertyInducingElementImpl variable2) { |
| 4383 this._variable = variable2; | 4383 this._variable = variable2; |
| 4384 synthetic = true; | 4384 synthetic = true; |
| 4385 } | 4385 } |
| 4386 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 4386 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 4387 bool operator ==(Object object) => super == object && identical(isGetter(), ((
object as PropertyAccessorElement)).isGetter()); | 4387 bool operator ==(Object object) => super == object && identical(isGetter, ((ob
ject as PropertyAccessorElement)).isGetter); |
| 4388 PropertyAccessorElement get correspondingGetter { | 4388 PropertyAccessorElement get correspondingGetter { |
| 4389 if (isGetter() || _variable == null) { | 4389 if (isGetter || _variable == null) { |
| 4390 return null; | 4390 return null; |
| 4391 } | 4391 } |
| 4392 return _variable.getter; | 4392 return _variable.getter; |
| 4393 } | 4393 } |
| 4394 PropertyAccessorElement get correspondingSetter { | 4394 PropertyAccessorElement get correspondingSetter { |
| 4395 if (isSetter() || _variable == null) { | 4395 if (isSetter || _variable == null) { |
| 4396 return null; | 4396 return null; |
| 4397 } | 4397 } |
| 4398 return _variable.setter; | 4398 return _variable.setter; |
| 4399 } | 4399 } |
| 4400 ElementKind get kind { | 4400 ElementKind get kind { |
| 4401 if (isGetter()) { | 4401 if (isGetter) { |
| 4402 return ElementKind.GETTER; | 4402 return ElementKind.GETTER; |
| 4403 } | 4403 } |
| 4404 return ElementKind.SETTER; | 4404 return ElementKind.SETTER; |
| 4405 } | 4405 } |
| 4406 String get name { | 4406 String get name { |
| 4407 if (isSetter()) { | 4407 if (isSetter) { |
| 4408 return "${super.name}="; | 4408 return "${super.name}="; |
| 4409 } | 4409 } |
| 4410 return super.name; | 4410 return super.name; |
| 4411 } | 4411 } |
| 4412 PropertyInducingElement get variable => _variable; | 4412 PropertyInducingElement get variable => _variable; |
| 4413 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 4413 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 4414 bool isGetter() => hasModifier(Modifier.GETTER); | 4414 bool get isGetter => hasModifier(Modifier.GETTER); |
| 4415 bool isSetter() => hasModifier(Modifier.SETTER); | 4415 bool get isSetter => hasModifier(Modifier.SETTER); |
| 4416 bool isStatic() => hasModifier(Modifier.STATIC); | 4416 bool get isStatic => hasModifier(Modifier.STATIC); |
| 4417 | 4417 |
| 4418 /** | 4418 /** |
| 4419 * Set whether this accessor is abstract to correspond to the given value. | 4419 * Set whether this accessor is abstract to correspond to the given value. |
| 4420 * @param isAbstract `true` if the accessor is abstract | 4420 * @param isAbstract `true` if the accessor is abstract |
| 4421 */ | 4421 */ |
| 4422 void set abstract(bool isAbstract) { | 4422 void set abstract(bool isAbstract) { |
| 4423 setModifier(Modifier.ABSTRACT, isAbstract); | 4423 setModifier(Modifier.ABSTRACT, isAbstract); |
| 4424 } | 4424 } |
| 4425 | 4425 |
| 4426 /** | 4426 /** |
| (...skipping 21 matching lines...) Expand all Loading... |
| 4448 } | 4448 } |
| 4449 | 4449 |
| 4450 /** | 4450 /** |
| 4451 * Set the variable associated with this accessor to the given variable. | 4451 * Set the variable associated with this accessor to the given variable. |
| 4452 * @param variable the variable associated with this accessor | 4452 * @param variable the variable associated with this accessor |
| 4453 */ | 4453 */ |
| 4454 void set variable(PropertyInducingElement variable2) { | 4454 void set variable(PropertyInducingElement variable2) { |
| 4455 this._variable = variable2; | 4455 this._variable = variable2; |
| 4456 } | 4456 } |
| 4457 void appendTo(JavaStringBuilder builder) { | 4457 void appendTo(JavaStringBuilder builder) { |
| 4458 builder.append(isGetter() ? "get " : "set "); | 4458 builder.append(isGetter ? "get " : "set "); |
| 4459 builder.append(variable.displayName); | 4459 builder.append(variable.displayName); |
| 4460 super.appendTo(builder); | 4460 super.appendTo(builder); |
| 4461 } | 4461 } |
| 4462 } | 4462 } |
| 4463 /** | 4463 /** |
| 4464 * Instances of the class `PropertyInducingElementImpl` implement a`PropertyIndu
cingElement`. | 4464 * Instances of the class `PropertyInducingElementImpl` implement a`PropertyIndu
cingElement`. |
| 4465 * @coverage dart.engine.element | 4465 * @coverage dart.engine.element |
| 4466 */ | 4466 */ |
| 4467 abstract class PropertyInducingElementImpl extends VariableElementImpl implement
s PropertyInducingElement { | 4467 abstract class PropertyInducingElementImpl extends VariableElementImpl implement
s PropertyInducingElement { |
| 4468 | 4468 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4579 * Initialize a newly created synthetic top-level variable element to have the
given name. | 4579 * Initialize a newly created synthetic top-level variable element to have the
given name. |
| 4580 * @param name the name of this element | 4580 * @param name the name of this element |
| 4581 */ | 4581 */ |
| 4582 TopLevelVariableElementImpl.con2(String name) : super.con2(name) { | 4582 TopLevelVariableElementImpl.con2(String name) : super.con2(name) { |
| 4583 _jtd_constructor_230_impl(name); | 4583 _jtd_constructor_230_impl(name); |
| 4584 } | 4584 } |
| 4585 _jtd_constructor_230_impl(String name) { | 4585 _jtd_constructor_230_impl(String name) { |
| 4586 } | 4586 } |
| 4587 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); | 4587 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); |
| 4588 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; | 4588 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; |
| 4589 bool isStatic() => true; | 4589 bool get isStatic => true; |
| 4590 } | 4590 } |
| 4591 /** | 4591 /** |
| 4592 * Instances of the class `TypeVariableElementImpl` implement a `TypeVariableEle
ment`. | 4592 * Instances of the class `TypeVariableElementImpl` implement a `TypeVariableEle
ment`. |
| 4593 * @coverage dart.engine.element | 4593 * @coverage dart.engine.element |
| 4594 */ | 4594 */ |
| 4595 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement
{ | 4595 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement
{ |
| 4596 | 4596 |
| 4597 /** | 4597 /** |
| 4598 * The type defined by this type variable. | 4598 * The type defined by this type variable. |
| 4599 */ | 4599 */ |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4690 | 4690 |
| 4691 /** | 4691 /** |
| 4692 * Return the result of evaluating this variable's initializer as a compile-ti
me constant | 4692 * Return the result of evaluating this variable's initializer as a compile-ti
me constant |
| 4693 * expression, or `null` if this variable is not a 'const' variable or does no
t have an | 4693 * expression, or `null` if this variable is not a 'const' variable or does no
t have an |
| 4694 * initializer. | 4694 * initializer. |
| 4695 * @return the result of evaluating this variable's initializer | 4695 * @return the result of evaluating this variable's initializer |
| 4696 */ | 4696 */ |
| 4697 EvaluationResultImpl get evaluationResult => null; | 4697 EvaluationResultImpl get evaluationResult => null; |
| 4698 FunctionElement get initializer => _initializer; | 4698 FunctionElement get initializer => _initializer; |
| 4699 Type2 get type => _type; | 4699 Type2 get type => _type; |
| 4700 bool isConst() => hasModifier(Modifier.CONST); | 4700 bool get isConst => hasModifier(Modifier.CONST); |
| 4701 bool isFinal() => hasModifier(Modifier.FINAL); | 4701 bool get isFinal => hasModifier(Modifier.FINAL); |
| 4702 | 4702 |
| 4703 /** | 4703 /** |
| 4704 * Set whether this variable is const to correspond to the given value. | 4704 * Set whether this variable is const to correspond to the given value. |
| 4705 * @param isConst `true` if the variable is const | 4705 * @param isConst `true` if the variable is const |
| 4706 */ | 4706 */ |
| 4707 void set const3(bool isConst) { | 4707 void set const3(bool isConst) { |
| 4708 setModifier(Modifier.CONST, isConst); | 4708 setModifier(Modifier.CONST, isConst); |
| 4709 } | 4709 } |
| 4710 | 4710 |
| 4711 /** | 4711 /** |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4787 * Initialize a newly created element to represent a constructor of the given
parameterized type. | 4787 * Initialize a newly created element to represent a constructor of the given
parameterized type. |
| 4788 * @param baseElement the element on which the parameterized element was creat
ed | 4788 * @param baseElement the element on which the parameterized element was creat
ed |
| 4789 * @param definingType the type in which the element is defined | 4789 * @param definingType the type in which the element is defined |
| 4790 */ | 4790 */ |
| 4791 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { | 4791 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { |
| 4792 } | 4792 } |
| 4793 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 4793 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 4794 ConstructorElement get baseElement => super.baseElement as ConstructorElement; | 4794 ConstructorElement get baseElement => super.baseElement as ConstructorElement; |
| 4795 ClassElement get enclosingElement => baseElement.enclosingElement; | 4795 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 4796 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); | 4796 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); |
| 4797 bool isConst() => baseElement.isConst(); | 4797 bool get isConst => baseElement.isConst; |
| 4798 bool isDefaultConstructor() => baseElement.isDefaultConstructor(); | 4798 bool get isDefaultConstructor => baseElement.isDefaultConstructor; |
| 4799 bool isFactory() => baseElement.isFactory(); | 4799 bool get isFactory => baseElement.isFactory; |
| 4800 String toString() { | 4800 String toString() { |
| 4801 ConstructorElement baseElement = this.baseElement; | 4801 ConstructorElement baseElement = this.baseElement; |
| 4802 List<ParameterElement> parameters = this.parameters; | 4802 List<ParameterElement> parameters = this.parameters; |
| 4803 FunctionType type = this.type; | 4803 FunctionType type = this.type; |
| 4804 JavaStringBuilder builder = new JavaStringBuilder(); | 4804 JavaStringBuilder builder = new JavaStringBuilder(); |
| 4805 builder.append(baseElement.enclosingElement.displayName); | 4805 builder.append(baseElement.enclosingElement.displayName); |
| 4806 String name = displayName; | 4806 String name = displayName; |
| 4807 if (name != null && !name.isEmpty) { | 4807 if (name != null && !name.isEmpty) { |
| 4808 builder.append("."); | 4808 builder.append("."); |
| 4809 builder.append(name); | 4809 builder.append(name); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4855 return baseParameters; | 4855 return baseParameters; |
| 4856 } | 4856 } |
| 4857 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 4857 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 4858 for (int i = 0; i < parameterCount; i++) { | 4858 for (int i = 0; i < parameterCount; i++) { |
| 4859 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 4859 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
| 4860 } | 4860 } |
| 4861 return parameterizedParameters; | 4861 return parameterizedParameters; |
| 4862 } | 4862 } |
| 4863 Type2 get returnType => substituteFor(baseElement.returnType); | 4863 Type2 get returnType => substituteFor(baseElement.returnType); |
| 4864 FunctionType get type => substituteFor(baseElement.type); | 4864 FunctionType get type => substituteFor(baseElement.type); |
| 4865 bool isOperator() => baseElement.isOperator(); | 4865 bool get isOperator => baseElement.isOperator; |
| 4866 bool isStatic() => baseElement.isStatic(); | 4866 bool get isStatic => baseElement.isStatic; |
| 4867 void visitChildren(ElementVisitor<Object> visitor) { | 4867 void visitChildren(ElementVisitor<Object> visitor) { |
| 4868 super.visitChildren(visitor); | 4868 super.visitChildren(visitor); |
| 4869 safelyVisitChildren(baseElement.functions, visitor); | 4869 safelyVisitChildren(baseElement.functions, visitor); |
| 4870 safelyVisitChildren(labels, visitor); | 4870 safelyVisitChildren(labels, visitor); |
| 4871 safelyVisitChildren(baseElement.localVariables, visitor); | 4871 safelyVisitChildren(baseElement.localVariables, visitor); |
| 4872 safelyVisitChildren(parameters, visitor); | 4872 safelyVisitChildren(parameters, visitor); |
| 4873 } | 4873 } |
| 4874 } | 4874 } |
| 4875 /** | 4875 /** |
| 4876 * Instances of the class `FieldMember` represent a field element defined in a p
arameterized | 4876 * Instances of the class `FieldMember` represent a field element defined in a p
arameterized |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4910 * @param baseElement the element on which the parameterized element was creat
ed | 4910 * @param baseElement the element on which the parameterized element was creat
ed |
| 4911 * @param definingType the type in which the element is defined | 4911 * @param definingType the type in which the element is defined |
| 4912 */ | 4912 */ |
| 4913 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType) { | 4913 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType) { |
| 4914 } | 4914 } |
| 4915 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 4915 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 4916 FieldElement get baseElement => super.baseElement as FieldElement; | 4916 FieldElement get baseElement => super.baseElement as FieldElement; |
| 4917 ClassElement get enclosingElement => baseElement.enclosingElement; | 4917 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 4918 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); | 4918 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); |
| 4919 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); | 4919 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); |
| 4920 bool isStatic() => baseElement.isStatic(); | 4920 bool get isStatic => baseElement.isStatic; |
| 4921 InterfaceType get definingType => super.definingType as InterfaceType; | 4921 InterfaceType get definingType => super.definingType as InterfaceType; |
| 4922 } | 4922 } |
| 4923 /** | 4923 /** |
| 4924 * The abstract class `Member` defines the behavior common to elements that repr
esent members | 4924 * The abstract class `Member` defines the behavior common to elements that repr
esent members |
| 4925 * of parameterized types. | 4925 * of parameterized types. |
| 4926 */ | 4926 */ |
| 4927 abstract class Member implements Element { | 4927 abstract class Member implements Element { |
| 4928 | 4928 |
| 4929 /** | 4929 /** |
| 4930 * The element on which the parameterized element was created. | 4930 * The element on which the parameterized element was created. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4956 AnalysisContext get context => _baseElement.context; | 4956 AnalysisContext get context => _baseElement.context; |
| 4957 String get displayName => _baseElement.displayName; | 4957 String get displayName => _baseElement.displayName; |
| 4958 ElementKind get kind => _baseElement.kind; | 4958 ElementKind get kind => _baseElement.kind; |
| 4959 LibraryElement get library => _baseElement.library; | 4959 LibraryElement get library => _baseElement.library; |
| 4960 ElementLocation get location => _baseElement.location; | 4960 ElementLocation get location => _baseElement.location; |
| 4961 List<ElementAnnotation> get metadata => _baseElement.metadata; | 4961 List<ElementAnnotation> get metadata => _baseElement.metadata; |
| 4962 String get name => _baseElement.name; | 4962 String get name => _baseElement.name; |
| 4963 int get nameOffset => _baseElement.nameOffset; | 4963 int get nameOffset => _baseElement.nameOffset; |
| 4964 Source get source => _baseElement.source; | 4964 Source get source => _baseElement.source; |
| 4965 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); | 4965 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); |
| 4966 bool isSynthetic() => _baseElement.isSynthetic(); | 4966 bool get isSynthetic => _baseElement.isSynthetic; |
| 4967 void visitChildren(ElementVisitor<Object> visitor) { | 4967 void visitChildren(ElementVisitor<Object> visitor) { |
| 4968 } | 4968 } |
| 4969 | 4969 |
| 4970 /** | 4970 /** |
| 4971 * Return the type in which the element is defined. | 4971 * Return the type in which the element is defined. |
| 4972 * @return the type in which the element is defined | 4972 * @return the type in which the element is defined |
| 4973 */ | 4973 */ |
| 4974 ParameterizedType get definingType => _definingType; | 4974 ParameterizedType get definingType => _definingType; |
| 4975 | 4975 |
| 4976 /** | 4976 /** |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5057 /** | 5057 /** |
| 5058 * Initialize a newly created element to represent a method of the given param
eterized type. | 5058 * Initialize a newly created element to represent a method of the given param
eterized type. |
| 5059 * @param baseElement the element on which the parameterized element was creat
ed | 5059 * @param baseElement the element on which the parameterized element was creat
ed |
| 5060 * @param definingType the type in which the element is defined | 5060 * @param definingType the type in which the element is defined |
| 5061 */ | 5061 */ |
| 5062 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType) { | 5062 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType) { |
| 5063 } | 5063 } |
| 5064 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 5064 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
| 5065 MethodElement get baseElement => super.baseElement as MethodElement; | 5065 MethodElement get baseElement => super.baseElement as MethodElement; |
| 5066 ClassElement get enclosingElement => baseElement.enclosingElement; | 5066 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 5067 bool isAbstract() => baseElement.isAbstract(); | 5067 bool get isAbstract => baseElement.isAbstract; |
| 5068 String toString() { | 5068 String toString() { |
| 5069 MethodElement baseElement = this.baseElement; | 5069 MethodElement baseElement = this.baseElement; |
| 5070 List<ParameterElement> parameters = this.parameters; | 5070 List<ParameterElement> parameters = this.parameters; |
| 5071 FunctionType type = this.type; | 5071 FunctionType type = this.type; |
| 5072 JavaStringBuilder builder = new JavaStringBuilder(); | 5072 JavaStringBuilder builder = new JavaStringBuilder(); |
| 5073 builder.append(baseElement.enclosingElement.displayName); | 5073 builder.append(baseElement.enclosingElement.displayName); |
| 5074 builder.append("."); | 5074 builder.append("."); |
| 5075 builder.append(baseElement.displayName); | 5075 builder.append(baseElement.displayName); |
| 5076 builder.append("("); | 5076 builder.append("("); |
| 5077 int parameterCount = parameters.length; | 5077 int parameterCount = parameters.length; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5152 if (parameterCount == 0) { | 5152 if (parameterCount == 0) { |
| 5153 return baseParameters; | 5153 return baseParameters; |
| 5154 } | 5154 } |
| 5155 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 5155 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 5156 for (int i = 0; i < parameterCount; i++) { | 5156 for (int i = 0; i < parameterCount; i++) { |
| 5157 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 5157 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
| 5158 } | 5158 } |
| 5159 return parameterizedParameters; | 5159 return parameterizedParameters; |
| 5160 } | 5160 } |
| 5161 SourceRange get visibleRange => baseElement.visibleRange; | 5161 SourceRange get visibleRange => baseElement.visibleRange; |
| 5162 bool isInitializingFormal() => baseElement.isInitializingFormal(); | 5162 bool get isInitializingFormal => baseElement.isInitializingFormal; |
| 5163 String toString() { | 5163 String toString() { |
| 5164 ParameterElement baseElement = this.baseElement; | 5164 ParameterElement baseElement = this.baseElement; |
| 5165 String left = ""; | 5165 String left = ""; |
| 5166 String right = ""; | 5166 String right = ""; |
| 5167 while (true) { | 5167 while (true) { |
| 5168 if (baseElement.parameterKind == ParameterKind.NAMED) { | 5168 if (baseElement.parameterKind == ParameterKind.NAMED) { |
| 5169 left = "{"; | 5169 left = "{"; |
| 5170 right = "}"; | 5170 right = "}"; |
| 5171 } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) { | 5171 } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) { |
| 5172 left = "["; | 5172 left = "["; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5230 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); | 5230 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); |
| 5231 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); | 5231 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); |
| 5232 Element get enclosingElement => baseElement.enclosingElement; | 5232 Element get enclosingElement => baseElement.enclosingElement; |
| 5233 PropertyInducingElement get variable { | 5233 PropertyInducingElement get variable { |
| 5234 PropertyInducingElement variable = baseElement.variable; | 5234 PropertyInducingElement variable = baseElement.variable; |
| 5235 if (variable is FieldElement) { | 5235 if (variable is FieldElement) { |
| 5236 return FieldMember.from(((variable as FieldElement)), definingType); | 5236 return FieldMember.from(((variable as FieldElement)), definingType); |
| 5237 } | 5237 } |
| 5238 return variable; | 5238 return variable; |
| 5239 } | 5239 } |
| 5240 bool isAbstract() => baseElement.isAbstract(); | 5240 bool get isAbstract => baseElement.isAbstract; |
| 5241 bool isGetter() => baseElement.isGetter(); | 5241 bool get isGetter => baseElement.isGetter; |
| 5242 bool isSetter() => baseElement.isSetter(); | 5242 bool get isSetter => baseElement.isSetter; |
| 5243 InterfaceType get definingType => super.definingType as InterfaceType; | 5243 InterfaceType get definingType => super.definingType as InterfaceType; |
| 5244 } | 5244 } |
| 5245 /** | 5245 /** |
| 5246 * The abstract class `VariableMember` defines the behavior common to members th
at represent a | 5246 * The abstract class `VariableMember` defines the behavior common to members th
at represent a |
| 5247 * variable element defined in a parameterized type where the values of the type
parameters are | 5247 * variable element defined in a parameterized type where the values of the type
parameters are |
| 5248 * known. | 5248 * known. |
| 5249 */ | 5249 */ |
| 5250 abstract class VariableMember extends Member implements VariableElement { | 5250 abstract class VariableMember extends Member implements VariableElement { |
| 5251 | 5251 |
| 5252 /** | 5252 /** |
| 5253 * Initialize a newly created element to represent an executable element of th
e given | 5253 * Initialize a newly created element to represent an executable element of th
e given |
| 5254 * parameterized type. | 5254 * parameterized type. |
| 5255 * @param baseElement the element on which the parameterized element was creat
ed | 5255 * @param baseElement the element on which the parameterized element was creat
ed |
| 5256 * @param definingType the type in which the element is defined | 5256 * @param definingType the type in which the element is defined |
| 5257 */ | 5257 */ |
| 5258 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType) { | 5258 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType) { |
| 5259 } | 5259 } |
| 5260 VariableElement get baseElement => super.baseElement as VariableElement; | 5260 VariableElement get baseElement => super.baseElement as VariableElement; |
| 5261 FunctionElement get initializer { | 5261 FunctionElement get initializer { |
| 5262 throw new UnsupportedOperationException(); | 5262 throw new UnsupportedOperationException(); |
| 5263 } | 5263 } |
| 5264 Type2 get type => substituteFor(baseElement.type); | 5264 Type2 get type => substituteFor(baseElement.type); |
| 5265 bool isConst() => baseElement.isConst(); | 5265 bool get isConst => baseElement.isConst; |
| 5266 bool isFinal() => baseElement.isFinal(); | 5266 bool get isFinal => baseElement.isFinal; |
| 5267 void visitChildren(ElementVisitor<Object> visitor) { | 5267 void visitChildren(ElementVisitor<Object> visitor) { |
| 5268 super.visitChildren(visitor); | 5268 super.visitChildren(visitor); |
| 5269 safelyVisitChild(baseElement.initializer, visitor); | 5269 safelyVisitChild(baseElement.initializer, visitor); |
| 5270 } | 5270 } |
| 5271 } | 5271 } |
| 5272 /** | 5272 /** |
| 5273 * The unique instance of the class `BottomTypeImpl` implements the type `bottom
`. | 5273 * The unique instance of the class `BottomTypeImpl` implements the type `bottom
`. |
| 5274 * @coverage dart.engine.type | 5274 * @coverage dart.engine.type |
| 5275 */ | 5275 */ |
| 5276 class BottomTypeImpl extends TypeImpl { | 5276 class BottomTypeImpl extends TypeImpl { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5314 */ | 5314 */ |
| 5315 static DynamicTypeImpl get instance => _INSTANCE; | 5315 static DynamicTypeImpl get instance => _INSTANCE; |
| 5316 | 5316 |
| 5317 /** | 5317 /** |
| 5318 * Prevent the creation of instances of this class. | 5318 * Prevent the creation of instances of this class. |
| 5319 */ | 5319 */ |
| 5320 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { | 5320 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { |
| 5321 ((element as DynamicElementImpl)).type = this; | 5321 ((element as DynamicElementImpl)).type = this; |
| 5322 } | 5322 } |
| 5323 bool operator ==(Object object) => object is DynamicTypeImpl; | 5323 bool operator ==(Object object) => object is DynamicTypeImpl; |
| 5324 bool isDynamic() => true; | 5324 bool get isDynamic => true; |
| 5325 bool isMoreSpecificThan(Type2 type) => false; | 5325 bool isMoreSpecificThan(Type2 type) => false; |
| 5326 bool isSubtypeOf(Type2 type) => identical(this, type); | 5326 bool isSubtypeOf(Type2 type) => identical(this, type); |
| 5327 bool isSupertypeOf(Type2 type) => true; | 5327 bool isSupertypeOf(Type2 type) => true; |
| 5328 DynamicTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTy
pes) => this; | 5328 DynamicTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTy
pes) => this; |
| 5329 } | 5329 } |
| 5330 /** | 5330 /** |
| 5331 * Instances of the class `FunctionTypeImpl` defines the behavior common to obje
cts | 5331 * Instances of the class `FunctionTypeImpl` defines the behavior common to obje
cts |
| 5332 * representing the type of a function, method, constructor, getter, or setter. | 5332 * representing the type of a function, method, constructor, getter, or setter. |
| 5333 * @coverage dart.engine.type | 5333 * @coverage dart.engine.type |
| 5334 */ | 5334 */ |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5528 int get hashCode { | 5528 int get hashCode { |
| 5529 Element element = this.element; | 5529 Element element = this.element; |
| 5530 if (element == null) { | 5530 if (element == null) { |
| 5531 return 0; | 5531 return 0; |
| 5532 } | 5532 } |
| 5533 return element.hashCode; | 5533 return element.hashCode; |
| 5534 } | 5534 } |
| 5535 bool isSubtypeOf(Type2 type) { | 5535 bool isSubtypeOf(Type2 type) { |
| 5536 if (type == null) { | 5536 if (type == null) { |
| 5537 return false; | 5537 return false; |
| 5538 } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunct
ion() || type.isObject()) { | 5538 } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunctio
n || type.isObject) { |
| 5539 return true; | 5539 return true; |
| 5540 } else if (type is! FunctionType) { | 5540 } else if (type is! FunctionType) { |
| 5541 return false; | 5541 return false; |
| 5542 } else if (this == type) { | 5542 } else if (this == type) { |
| 5543 return true; | 5543 return true; |
| 5544 } | 5544 } |
| 5545 FunctionType t = this; | 5545 FunctionType t = this; |
| 5546 FunctionType s = type as FunctionType; | 5546 FunctionType s = type as FunctionType; |
| 5547 List<Type2> tTypes = t.normalParameterTypes; | 5547 List<Type2> tTypes = t.normalParameterTypes; |
| 5548 List<Type2> tOpTypes = t.optionalParameterTypes; | 5548 List<Type2> tOpTypes = t.optionalParameterTypes; |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6030 } | 6030 } |
| 6031 List<Type2> get typeArguments => _typeArguments; | 6031 List<Type2> get typeArguments => _typeArguments; |
| 6032 List<TypeVariableElement> get typeVariables => element.typeVariables; | 6032 List<TypeVariableElement> get typeVariables => element.typeVariables; |
| 6033 int get hashCode { | 6033 int get hashCode { |
| 6034 ClassElement element = this.element; | 6034 ClassElement element = this.element; |
| 6035 if (element == null) { | 6035 if (element == null) { |
| 6036 return 0; | 6036 return 0; |
| 6037 } | 6037 } |
| 6038 return element.hashCode; | 6038 return element.hashCode; |
| 6039 } | 6039 } |
| 6040 bool isDartCoreFunction() { | 6040 bool get isDartCoreFunction { |
| 6041 ClassElement element = this.element; | 6041 ClassElement element = this.element; |
| 6042 if (element == null) { | 6042 if (element == null) { |
| 6043 return false; | 6043 return false; |
| 6044 } | 6044 } |
| 6045 return element.name == "Function" && element.library.isDartCore(); | 6045 return element.name == "Function" && element.library.isDartCore; |
| 6046 } | 6046 } |
| 6047 bool isDirectSupertypeOf(InterfaceType type) { | 6047 bool isDirectSupertypeOf(InterfaceType type) { |
| 6048 ClassElement i = element; | 6048 ClassElement i = element; |
| 6049 ClassElement j = type.element; | 6049 ClassElement j = type.element; |
| 6050 InterfaceType supertype = j.supertype; | 6050 InterfaceType supertype = j.supertype; |
| 6051 if (supertype == null) { | 6051 if (supertype == null) { |
| 6052 return false; | 6052 return false; |
| 6053 } | 6053 } |
| 6054 ClassElement supertypeElement = supertype.element; | 6054 ClassElement supertypeElement = supertype.element; |
| 6055 if (supertypeElement == i) { | 6055 if (supertypeElement == i) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 6068 return false; | 6068 return false; |
| 6069 } | 6069 } |
| 6070 bool isMoreSpecificThan(Type2 type) { | 6070 bool isMoreSpecificThan(Type2 type) { |
| 6071 if (identical(type, DynamicTypeImpl.instance)) { | 6071 if (identical(type, DynamicTypeImpl.instance)) { |
| 6072 return true; | 6072 return true; |
| 6073 } else if (type is! InterfaceType) { | 6073 } else if (type is! InterfaceType) { |
| 6074 return false; | 6074 return false; |
| 6075 } | 6075 } |
| 6076 return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>())
; | 6076 return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>())
; |
| 6077 } | 6077 } |
| 6078 bool isObject() => element.supertype == null; | 6078 bool get isObject => element.supertype == null; |
| 6079 bool isSubtypeOf(Type2 type2) { | 6079 bool isSubtypeOf(Type2 type2) { |
| 6080 if (identical(type2, DynamicTypeImpl.instance)) { | 6080 if (identical(type2, DynamicTypeImpl.instance)) { |
| 6081 return true; | 6081 return true; |
| 6082 } else if (type2 is TypeVariableType) { | 6082 } else if (type2 is TypeVariableType) { |
| 6083 return true; | 6083 return true; |
| 6084 } else if (type2 is FunctionType) { | 6084 } else if (type2 is FunctionType) { |
| 6085 ClassElement element = this.element; | 6085 ClassElement element = this.element; |
| 6086 MethodElement callMethod = element.lookUpMethod("call", element.library); | 6086 MethodElement callMethod = element.lookUpMethod("call", element.library); |
| 6087 if (callMethod != null) { | 6087 if (callMethod != null) { |
| 6088 return callMethod.type.isSubtypeOf(type2); | 6088 return callMethod.type.isSubtypeOf(type2); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6302 List<Type2> typeSArgs = typeS.typeArguments; | 6302 List<Type2> typeSArgs = typeS.typeArguments; |
| 6303 if (typeTArgs.length != typeSArgs.length) { | 6303 if (typeTArgs.length != typeSArgs.length) { |
| 6304 return false; | 6304 return false; |
| 6305 } | 6305 } |
| 6306 for (int i = 0; i < typeTArgs.length; i++) { | 6306 for (int i = 0; i < typeTArgs.length; i++) { |
| 6307 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { | 6307 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { |
| 6308 return false; | 6308 return false; |
| 6309 } | 6309 } |
| 6310 } | 6310 } |
| 6311 return true; | 6311 return true; |
| 6312 } else if (typeS.isDartCoreFunction() && elementT.getMethod("call") != null)
{ | 6312 } else if (typeS.isDartCoreFunction && elementT.getMethod("call") != null) { |
| 6313 return true; | 6313 return true; |
| 6314 } | 6314 } |
| 6315 InterfaceType supertype = elementT.supertype; | 6315 InterfaceType supertype = elementT.supertype; |
| 6316 if (supertype != null && ((supertype as InterfaceTypeImpl)).isSubtypeOf2(typ
eS, visitedClasses)) { | 6316 if (supertype != null && ((supertype as InterfaceTypeImpl)).isSubtypeOf2(typ
eS, visitedClasses)) { |
| 6317 return true; | 6317 return true; |
| 6318 } | 6318 } |
| 6319 List<InterfaceType> interfaceTypes = elementT.interfaces; | 6319 List<InterfaceType> interfaceTypes = elementT.interfaces; |
| 6320 for (InterfaceType interfaceType in interfaceTypes) { | 6320 for (InterfaceType interfaceType in interfaceTypes) { |
| 6321 if (((interfaceType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClas
ses)) { | 6321 if (((interfaceType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClas
ses)) { |
| 6322 return true; | 6322 return true; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6381 */ | 6381 */ |
| 6382 TypeImpl(Element element, String name) { | 6382 TypeImpl(Element element, String name) { |
| 6383 this._element = element; | 6383 this._element = element; |
| 6384 this._name = name; | 6384 this._name = name; |
| 6385 } | 6385 } |
| 6386 String get displayName => name; | 6386 String get displayName => name; |
| 6387 Element get element => _element; | 6387 Element get element => _element; |
| 6388 Type2 getLeastUpperBound(Type2 type) => null; | 6388 Type2 getLeastUpperBound(Type2 type) => null; |
| 6389 String get name => _name; | 6389 String get name => _name; |
| 6390 bool isAssignableTo(Type2 type) => this.isSubtypeOf(type) || type.isSubtypeOf(
this); | 6390 bool isAssignableTo(Type2 type) => this.isSubtypeOf(type) || type.isSubtypeOf(
this); |
| 6391 bool isDartCoreFunction() => false; | 6391 bool get isDartCoreFunction => false; |
| 6392 bool isDynamic() => false; | 6392 bool get isDynamic => false; |
| 6393 bool isMoreSpecificThan(Type2 type) => false; | 6393 bool isMoreSpecificThan(Type2 type) => false; |
| 6394 bool isObject() => false; | 6394 bool get isObject => false; |
| 6395 bool isSupertypeOf(Type2 type) => type.isSubtypeOf(this); | 6395 bool isSupertypeOf(Type2 type) => type.isSubtypeOf(this); |
| 6396 bool isVoid() => false; | 6396 bool get isVoid => false; |
| 6397 String toString() { | 6397 String toString() { |
| 6398 JavaStringBuilder builder = new JavaStringBuilder(); | 6398 JavaStringBuilder builder = new JavaStringBuilder(); |
| 6399 appendTo(builder); | 6399 appendTo(builder); |
| 6400 return builder.toString(); | 6400 return builder.toString(); |
| 6401 } | 6401 } |
| 6402 | 6402 |
| 6403 /** | 6403 /** |
| 6404 * Append a textual representation of this type to the given builder. | 6404 * Append a textual representation of this type to the given builder. |
| 6405 * @param builder the builder to which the text is to be appended | 6405 * @param builder the builder to which the text is to be appended |
| 6406 */ | 6406 */ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6484 */ | 6484 */ |
| 6485 static VoidTypeImpl get instance => _INSTANCE; | 6485 static VoidTypeImpl get instance => _INSTANCE; |
| 6486 | 6486 |
| 6487 /** | 6487 /** |
| 6488 * Prevent the creation of instances of this class. | 6488 * Prevent the creation of instances of this class. |
| 6489 */ | 6489 */ |
| 6490 VoidTypeImpl() : super(null, Keyword.VOID.syntax) { | 6490 VoidTypeImpl() : super(null, Keyword.VOID.syntax) { |
| 6491 } | 6491 } |
| 6492 bool operator ==(Object object) => identical(object, this); | 6492 bool operator ==(Object object) => identical(object, this); |
| 6493 bool isSubtypeOf(Type2 type) => identical(type, this) || identical(type, Dynam
icTypeImpl.instance); | 6493 bool isSubtypeOf(Type2 type) => identical(type, this) || identical(type, Dynam
icTypeImpl.instance); |
| 6494 bool isVoid() => true; | 6494 bool get isVoid => true; |
| 6495 VoidTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
) => this; | 6495 VoidTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
) => this; |
| 6496 } | 6496 } |
| 6497 /** | 6497 /** |
| 6498 * The interface `FunctionType` defines the behavior common to objects represent
ing the type | 6498 * The interface `FunctionType` defines the behavior common to objects represent
ing the type |
| 6499 * of a function, method, constructor, getter, or setter. Function types come in
three variations: | 6499 * of a function, method, constructor, getter, or setter. Function types come in
three variations: |
| 6500 * <ol> | 6500 * <ol> |
| 6501 * * The types of functions that only have required parameters. These have the g
eneral form | 6501 * * The types of functions that only have required parameters. These have the g
eneral form |
| 6502 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>. | 6502 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>. |
| 6503 * * The types of functions with optional positional parameters. These have the
general form | 6503 * * The types of functions with optional positional parameters. These have the
general form |
| 6504 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</sub>, …, T<su
b>n+k</sub>\]) → | 6504 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</sub>, …, T<su
b>n+k</sub>\]) → |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6971 * @return `true` if this type is assignable to the given type | 6971 * @return `true` if this type is assignable to the given type |
| 6972 */ | 6972 */ |
| 6973 bool isAssignableTo(Type2 type); | 6973 bool isAssignableTo(Type2 type); |
| 6974 | 6974 |
| 6975 /** | 6975 /** |
| 6976 * Return `true` if this type represents the type 'Function' defined in the da
rt:core | 6976 * Return `true` if this type represents the type 'Function' defined in the da
rt:core |
| 6977 * library. | 6977 * library. |
| 6978 * @return `true` if this type represents the type 'Function' defined in the d
art:core | 6978 * @return `true` if this type represents the type 'Function' defined in the d
art:core |
| 6979 * library | 6979 * library |
| 6980 */ | 6980 */ |
| 6981 bool isDartCoreFunction(); | 6981 bool get isDartCoreFunction; |
| 6982 | 6982 |
| 6983 /** | 6983 /** |
| 6984 * Return `true` if this type represents the type 'dynamic'. | 6984 * Return `true` if this type represents the type 'dynamic'. |
| 6985 * @return `true` if this type represents the type 'dynamic' | 6985 * @return `true` if this type represents the type 'dynamic' |
| 6986 */ | 6986 */ |
| 6987 bool isDynamic(); | 6987 bool get isDynamic; |
| 6988 | 6988 |
| 6989 /** | 6989 /** |
| 6990 * Return `true` if this type is more specific than the given type. | 6990 * Return `true` if this type is more specific than the given type. |
| 6991 * @param type the type being compared with this type | 6991 * @param type the type being compared with this type |
| 6992 * @return `true` if this type is more specific than the given type | 6992 * @return `true` if this type is more specific than the given type |
| 6993 */ | 6993 */ |
| 6994 bool isMoreSpecificThan(Type2 type); | 6994 bool isMoreSpecificThan(Type2 type); |
| 6995 | 6995 |
| 6996 /** | 6996 /** |
| 6997 * Return `true` if this type represents the type 'Object'. | 6997 * Return `true` if this type represents the type 'Object'. |
| 6998 * @return `true` if this type represents the type 'Object' | 6998 * @return `true` if this type represents the type 'Object' |
| 6999 */ | 6999 */ |
| 7000 bool isObject(); | 7000 bool get isObject; |
| 7001 | 7001 |
| 7002 /** | 7002 /** |
| 7003 * Return `true` if this type is a subtype of the given type. | 7003 * Return `true` if this type is a subtype of the given type. |
| 7004 * @param type the type being compared with this type | 7004 * @param type the type being compared with this type |
| 7005 * @return `true` if this type is a subtype of the given type | 7005 * @return `true` if this type is a subtype of the given type |
| 7006 */ | 7006 */ |
| 7007 bool isSubtypeOf(Type2 type); | 7007 bool isSubtypeOf(Type2 type); |
| 7008 | 7008 |
| 7009 /** | 7009 /** |
| 7010 * Return `true` if this type is a supertype of the given type. A type <i>S</i
> is a | 7010 * Return `true` if this type is a supertype of the given type. A type <i>S</i
> is a |
| 7011 * supertype of <i>T</i>, written <i>S</i> :> <i>T</i>, iff <i>T</i> is a subt
ype of <i>S</i>. | 7011 * supertype of <i>T</i>, written <i>S</i> :> <i>T</i>, iff <i>T</i> is a subt
ype of <i>S</i>. |
| 7012 * @param type the type being compared with this type | 7012 * @param type the type being compared with this type |
| 7013 * @return `true` if this type is a supertype of the given type | 7013 * @return `true` if this type is a supertype of the given type |
| 7014 */ | 7014 */ |
| 7015 bool isSupertypeOf(Type2 type); | 7015 bool isSupertypeOf(Type2 type); |
| 7016 | 7016 |
| 7017 /** | 7017 /** |
| 7018 * Return `true` if this type represents the type 'void'. | 7018 * Return `true` if this type represents the type 'void'. |
| 7019 * @return `true` if this type represents the type 'void' | 7019 * @return `true` if this type represents the type 'void' |
| 7020 */ | 7020 */ |
| 7021 bool isVoid(); | 7021 bool get isVoid; |
| 7022 | 7022 |
| 7023 /** | 7023 /** |
| 7024 * Return the type resulting from substituting the given arguments for the giv
en parameters in | 7024 * Return the type resulting from substituting the given arguments for the giv
en parameters in |
| 7025 * this type. The specification defines this operation in section 2: <blockquo
te> The notation | 7025 * this type. The specification defines this operation in section 2: <blockquo
te> The notation |
| 7026 * <i>\[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ..., y<sub>n</sub>\]E
</i> denotes a copy of | 7026 * <i>\[x<sub>1</sub>, ..., x<sub>n</sub>/y<sub>1</sub>, ..., y<sub>n</sub>\]E
</i> denotes a copy of |
| 7027 * <i>E</i> in which all occurrences of <i>y<sub>i</sub>, 1 <= i <= n</i> have
been replaced with | 7027 * <i>E</i> in which all occurrences of <i>y<sub>i</sub>, 1 <= i <= n</i> have
been replaced with |
| 7028 * <i>x<sub>i</sub></i>.</blockquote> Note that, contrary to the specification
, this method will | 7028 * <i>x<sub>i</sub></i>.</blockquote> Note that, contrary to the specification
, this method will |
| 7029 * not create a copy of this type if no substitutions were required, but will
return this type | 7029 * not create a copy of this type if no substitutions were required, but will
return this type |
| 7030 * directly. | 7030 * directly. |
| 7031 * @param argumentTypes the actual type arguments being substituted for the pa
rameters | 7031 * @param argumentTypes the actual type arguments being substituted for the pa
rameters |
| (...skipping 10 matching lines...) Expand all Loading... |
| 7042 abstract class TypeVariableType implements Type2 { | 7042 abstract class TypeVariableType implements Type2 { |
| 7043 TypeVariableElement get element; | 7043 TypeVariableElement get element; |
| 7044 } | 7044 } |
| 7045 /** | 7045 /** |
| 7046 * The interface `VoidType` defines the behavior of the unique object representi
ng the type`void`. | 7046 * The interface `VoidType` defines the behavior of the unique object representi
ng the type`void`. |
| 7047 * @coverage dart.engine.type | 7047 * @coverage dart.engine.type |
| 7048 */ | 7048 */ |
| 7049 abstract class VoidType implements Type2 { | 7049 abstract class VoidType implements Type2 { |
| 7050 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 7050 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
| 7051 } | 7051 } |
| OLD | NEW |