| 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; |
| 11 import 'html.dart' show XmlTagNode; | 11 import 'html.dart' show XmlTagNode; |
| 12 import 'engine.dart' show AnalysisContext; | 12 import 'engine.dart' show AnalysisContext; |
| 13 import 'constant.dart' show EvaluationResultImpl; | 13 import 'constant.dart' show EvaluationResultImpl; |
| 14 import 'utilities_dart.dart'; | 14 import 'utilities_dart.dart'; |
| 15 /** | 15 /** |
| 16 * The interface {@code ClassElement} defines the behavior of elements that repr
esent a class. | 16 * The interface `ClassElement` defines the behavior of elements that represent
a class. |
| 17 * @coverage dart.engine.element | 17 * @coverage dart.engine.element |
| 18 */ | 18 */ |
| 19 abstract class ClassElement implements Element { | 19 abstract class ClassElement implements Element { |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Return an array containing all of the accessors (getters and setters) decla
red in this class. | 22 * Return an array containing all of the accessors (getters and setters) decla
red in this class. |
| 23 * @return the accessors declared in this class | 23 * @return the accessors declared in this class |
| 24 */ | 24 */ |
| 25 List<PropertyAccessorElement> get accessors; | 25 List<PropertyAccessorElement> get accessors; |
| 26 | 26 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 List<ConstructorElement> get constructors; | 38 List<ConstructorElement> get constructors; |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Return an array containing all of the fields declared in this class. | 41 * Return an array containing all of the fields declared in this class. |
| 42 * @return the fields declared in this class | 42 * @return the fields declared in this class |
| 43 */ | 43 */ |
| 44 List<FieldElement> get fields; | 44 List<FieldElement> get fields; |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Return the element representing the getter with the given name that is decl
ared in this class, | 47 * Return the element representing the getter with the given name that is decl
ared in this class, |
| 48 * or {@code null} if this class does not declare a getter with the given name
. | 48 * or `null` if this class does not declare a getter with the given name. |
| 49 * @param getterName the name of the getter to be returned | 49 * @param getterName the name of the getter to be returned |
| 50 * @return the getter declared in this class with the given name | 50 * @return the getter declared in this class with the given name |
| 51 */ | 51 */ |
| 52 PropertyAccessorElement getGetter(String getterName); | 52 PropertyAccessorElement getGetter(String getterName); |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Return an array containing all of the interfaces that are implemented by th
is class. | 55 * Return an array containing all of the interfaces that are implemented by th
is class. |
| 56 * <p> | 56 * |
| 57 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it | 57 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it |
| 58 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance | 58 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance |
| 59 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure | 59 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure |
| 60 * must explicitly guard against infinite loops. | 60 * must explicitly guard against infinite loops. |
| 61 * @return the interfaces that are implemented by this class | 61 * @return the interfaces that are implemented by this class |
| 62 */ | 62 */ |
| 63 List<InterfaceType> get interfaces; | 63 List<InterfaceType> get interfaces; |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Return the element representing the method with the given name that is decl
ared in this class, | 66 * Return the element representing the method with the given name that is decl
ared in this class, |
| 67 * or {@code null} if this class does not declare a method with the given name
. | 67 * or `null` if this class does not declare a method with the given name. |
| 68 * @param methodName the name of the method to be returned | 68 * @param methodName the name of the method to be returned |
| 69 * @return the method declared in this class with the given name | 69 * @return the method declared in this class with the given name |
| 70 */ | 70 */ |
| 71 MethodElement getMethod(String methodName); | 71 MethodElement getMethod(String methodName); |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * Return an array containing all of the methods declared in this class. | 74 * Return an array containing all of the methods declared in this class. |
| 75 * @return the methods declared in this class | 75 * @return the methods declared in this class |
| 76 */ | 76 */ |
| 77 List<MethodElement> get methods; | 77 List<MethodElement> get methods; |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Return an array containing all of the mixins that are applied to the class
being extended in | 80 * Return an array containing all of the mixins that are applied to the class
being extended in |
| 81 * order to derive the superclass of this class. | 81 * order to derive the superclass of this class. |
| 82 * <p> | 82 * |
| 83 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it | 83 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it |
| 84 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance | 84 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance |
| 85 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure | 85 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure |
| 86 * must explicitly guard against infinite loops. | 86 * must explicitly guard against infinite loops. |
| 87 * @return the mixins that are applied to derive the superclass of this class | 87 * @return the mixins that are applied to derive the superclass of this class |
| 88 */ | 88 */ |
| 89 List<InterfaceType> get mixins; | 89 List<InterfaceType> get mixins; |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * Return the named constructor declared in this class with the given name, or
{@code null} if | 92 * Return the named constructor declared in this class with the given name, or
`null` if |
| 93 * this class does not declare a named constructor with the given name. | 93 * this class does not declare a named constructor with the given name. |
| 94 * @param name the name of the constructor to be returned | 94 * @param name the name of the constructor to be returned |
| 95 * @return the element representing the specified constructor | 95 * @return the element representing the specified constructor |
| 96 */ | 96 */ |
| 97 ConstructorElement getNamedConstructor(String name); | 97 ConstructorElement getNamedConstructor(String name); |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * Return the element representing the setter with the given name that is decl
ared in this class, | 100 * Return the element representing the setter with the given name that is decl
ared in this class, |
| 101 * or {@code null} if this class does not declare a setter with the given name
. | 101 * or `null` if this class does not declare a setter with the given name. |
| 102 * @param setterName the name of the getter to be returned | 102 * @param setterName the name of the getter to be returned |
| 103 * @return the setter declared in this class with the given name | 103 * @return the setter declared in this class with the given name |
| 104 */ | 104 */ |
| 105 PropertyAccessorElement getSetter(String setterName); | 105 PropertyAccessorElement getSetter(String setterName); |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Return the superclass of this class, or {@code null} if the class represent
s the class | 108 * Return the superclass of this class, or `null` if the class represents the
class |
| 109 * 'Object'. All other classes will have a non-{@code null} superclass. If the
superclass was not | 109 * 'Object'. All other classes will have a non-`null` superclass. If the super
class was not |
| 110 * explicitly declared then the implicit superclass 'Object' will be returned. | 110 * explicitly declared then the implicit superclass 'Object' will be returned. |
| 111 * <p> | 111 * |
| 112 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it | 112 * <b>Note:</b> Because the element model represents the state of the code, it
is possible for it |
| 113 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance | 113 * to be semantically invalid. In particular, it is not safe to assume that th
e inheritance |
| 114 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure | 114 * structure of a class does not contain a cycle. Clients that traverse the in
heritance structure |
| 115 * must explicitly guard against infinite loops. | 115 * must explicitly guard against infinite loops. |
| 116 * @return the superclass of this class | 116 * @return the superclass of this class |
| 117 */ | 117 */ |
| 118 InterfaceType get supertype; | 118 InterfaceType get supertype; |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Return the type defined by the class. | 121 * Return the type defined by the class. |
| 122 * @return the type defined by the class | 122 * @return the type defined by the class |
| 123 */ | 123 */ |
| 124 InterfaceType get type; | 124 InterfaceType get type; |
| 125 | 125 |
| 126 /** | 126 /** |
| 127 * Return an array containing all of the type variables declared for this clas
s. | 127 * Return an array containing all of the type variables declared for this clas
s. |
| 128 * @return the type variables declared for this class | 128 * @return the type variables declared for this class |
| 129 */ | 129 */ |
| 130 List<TypeVariableElement> get typeVariables; | 130 List<TypeVariableElement> get typeVariables; |
| 131 | 131 |
| 132 /** | 132 /** |
| 133 * Return the unnamed constructor declared in this class, or {@code null} if t
his class does not | 133 * Return the unnamed constructor declared in this class, or `null` if this cl
ass does not |
| 134 * declare an unnamed constructor but does declare named constructors. The ret
urned constructor | 134 * declare an unnamed constructor but does declare named constructors. The ret
urned constructor |
| 135 * will be synthetic if this class does not declare any constructors, in which
case it will | 135 * will be synthetic if this class does not declare any constructors, in which
case it will |
| 136 * represent the default constructor for the class. | 136 * represent the default constructor for the class. |
| 137 * @return the unnamed constructor defined in this class | 137 * @return the unnamed constructor defined in this class |
| 138 */ | 138 */ |
| 139 ConstructorElement get unnamedConstructor; | 139 ConstructorElement get unnamedConstructor; |
| 140 | 140 |
| 141 /** | 141 /** |
| 142 * Return {@code true} if this class or its superclass declares a non-final in
stance field. | 142 * Return `true` if this class has (implicit or explicit) default constructor. |
| 143 * @return {@code true} if this class or its superclass declares a non-final i
nstance field | 143 * @return `true` if this class has (implicit or explicit) default constructor |
| 144 */ |
| 145 bool hasDefaultConstructor(); |
| 146 |
| 147 /** |
| 148 * Return `true` if this class or its superclass declares a non-final instance
field. |
| 149 * @return `true` if this class or its superclass declares a non-final instanc
e field |
| 144 */ | 150 */ |
| 145 bool hasNonFinalField(); | 151 bool hasNonFinalField(); |
| 146 | 152 |
| 147 /** | 153 /** |
| 148 * Return {@code true} if this class has reference to super (so, for example,
cannot be used as a | 154 * Return `true` if this class has reference to super (so, for example, cannot
be used as a |
| 149 * mixin). | 155 * mixin). |
| 150 * @return {@code true} if this class has reference to super | 156 * @return `true` if this class has reference to super |
| 151 */ | 157 */ |
| 152 bool hasReferenceToSuper(); | 158 bool hasReferenceToSuper(); |
| 153 | 159 |
| 154 /** | 160 /** |
| 155 * Return {@code true} if this class is abstract. A class is abstract if it ha
s an explicit{@code abstract} modifier. Note, that this definition of <i>abstrac
t</i> is different 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 |
| 156 * <i>has unimplemented members</i>. | 162 * <i>has unimplemented members</i>. |
| 157 * @return {@code true} if this class is abstract | 163 * @return `true` if this class is abstract |
| 158 */ | 164 */ |
| 159 bool isAbstract(); | 165 bool isAbstract(); |
| 160 | 166 |
| 161 /** | 167 /** |
| 162 * Return {@code true} if this class is defined by a typedef construct. | 168 * Return `true` if this class is defined by a typedef construct. |
| 163 * @return {@code true} if this class is defined by a typedef construct | 169 * @return `true` if this class is defined by a typedef construct |
| 164 */ | 170 */ |
| 165 bool isTypedef(); | 171 bool isTypedef(); |
| 166 | 172 |
| 167 /** | 173 /** |
| 168 * Return {@code true} if this class can validly be used as a mixin when defin
ing another class. | 174 * Return `true` if this class can validly be used as a mixin when defining an
other class. |
| 169 * 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: |
| 170 * <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 |
| 171 * 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 |
| 172 * 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 |
| 173 * Object.</blockquote> | 179 * Object.</blockquote> |
| 174 * @return {@code true} if this class can validly be used as a mixin | 180 * @return `true` if this class can validly be used as a mixin |
| 175 */ | 181 */ |
| 176 bool isValidMixin(); | 182 bool isValidMixin(); |
| 177 | 183 |
| 178 /** | 184 /** |
| 179 * 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 |
| 180 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 186 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 181 * 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: |
| 182 * <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> |
| 183 * with respect to library <i>L</i> is: | 189 * with respect to library <i>L</i> is: |
| 184 * <ul> | 190 * |
| 185 * <li>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 |
| 186 * 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. |
| 187 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 193 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 188 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 194 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 189 * Otherwise, we say that the lookup has failed.</li> | 195 * Otherwise, we say that the lookup has failed. |
| 190 * </ul> | 196 * |
| 191 * </blockquote> | 197 * </blockquote> |
| 192 * @param getterName the name of the getter being looked up | 198 * @param getterName the name of the getter being looked up |
| 193 * @param library the library with respect to which the lookup is being perfor
med | 199 * @param library the library with respect to which the lookup is being perfor
med |
| 194 * @return the result of looking up the given getter in this class with respec
t to the given | 200 * @return the result of looking up the given getter in this class with respec
t to the given |
| 195 * library | 201 * library |
| 196 */ | 202 */ |
| 197 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
); | 203 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
); |
| 198 | 204 |
| 199 /** | 205 /** |
| 200 * Return the element representing the method that results from looking up the
given method in | 206 * Return the element representing the method that results from looking up the
given method in |
| 201 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 207 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 202 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: | 208 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: |
| 203 * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> wit
h respect to library | 209 * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> wit
h respect to library |
| 204 * <i>L</i> is: | 210 * <i>L</i> is: |
| 205 * <ul> | 211 * |
| 206 * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessib
le to <i>L</i>, then | 212 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible
to <i>L</i>, then |
| 207 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then | 213 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then |
| 208 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect | 214 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect |
| 209 * to <i>L</i>. Otherwise, we say that the lookup has failed.</li> | 215 * to <i>L</i>. Otherwise, we say that the lookup has failed. |
| 210 * </ul> | 216 * |
| 211 * </blockquote> | 217 * </blockquote> |
| 212 * @param methodName the name of the method being looked up | 218 * @param methodName the name of the method being looked up |
| 213 * @param library the library with respect to which the lookup is being perfor
med | 219 * @param library the library with respect to which the lookup is being perfor
med |
| 214 * @return the result of looking up the given method in this class with respec
t to the given | 220 * @return the result of looking up the given method in this class with respec
t to the given |
| 215 * library | 221 * library |
| 216 */ | 222 */ |
| 217 MethodElement lookUpMethod(String methodName, LibraryElement library); | 223 MethodElement lookUpMethod(String methodName, LibraryElement library); |
| 218 | 224 |
| 219 /** | 225 /** |
| 220 * Return the element representing the setter that results from looking up the
given setter in | 226 * Return the element representing the setter that results from looking up the
given setter in |
| 221 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 227 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 222 * behavior of this method is defined by the Dart Language Specification in se
ction 12.16: | 228 * behavior of this method is defined by the Dart Language Specification in se
ction 12.16: |
| 223 * <blockquote> The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> | 229 * <blockquote> The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> |
| 224 * with respect to library <i>L</i> is: | 230 * with respect to library <i>L</i> is: |
| 225 * <ul> | 231 * |
| 226 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>
m</i> that is | 232 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 227 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 233 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| 228 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 234 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 229 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 235 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 230 * Otherwise, we say that the lookup has failed.</li> | 236 * Otherwise, we say that the lookup has failed. |
| 231 * </ul> | 237 * |
| 232 * </blockquote> | 238 * </blockquote> |
| 233 * @param setterName the name of the setter being looked up | 239 * @param setterName the name of the setter being looked up |
| 234 * @param library the library with respect to which the lookup is being perfor
med | 240 * @param library the library with respect to which the lookup is being perfor
med |
| 235 * @return the result of looking up the given setter in this class with respec
t to the given | 241 * @return the result of looking up the given setter in this class with respec
t to the given |
| 236 * library | 242 * library |
| 237 */ | 243 */ |
| 238 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); | 244 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); |
| 239 } | 245 } |
| 240 /** | 246 /** |
| 241 * The interface {@code ClassMemberElement} defines the behavior of elements tha
t are contained | 247 * The interface `ClassMemberElement` defines the behavior of elements that are
contained |
| 242 * within a {@link ClassElement}. | 248 * within a [ClassElement]. |
| 243 */ | 249 */ |
| 244 abstract class ClassMemberElement implements Element { | 250 abstract class ClassMemberElement implements Element { |
| 245 | 251 |
| 246 /** | 252 /** |
| 247 * Return the type in which this member is defined. | 253 * Return the type in which this member is defined. |
| 248 * @return the type in which this member is defined | 254 * @return the type in which this member is defined |
| 249 */ | 255 */ |
| 250 ClassElement get enclosingElement; | 256 ClassElement get enclosingElement; |
| 251 } | 257 } |
| 252 /** | 258 /** |
| 253 * The interface {@code CompilationUnitElement} defines the behavior of elements
representing a | 259 * The interface `CompilationUnitElement` defines the behavior of elements repre
senting a |
| 254 * compilation unit. | 260 * compilation unit. |
| 255 * @coverage dart.engine.element | 261 * @coverage dart.engine.element |
| 256 */ | 262 */ |
| 257 abstract class CompilationUnitElement implements Element, UriReferencedElement { | 263 abstract class CompilationUnitElement implements Element, UriReferencedElement { |
| 258 | 264 |
| 259 /** | 265 /** |
| 260 * Return an array containing all of the top-level accessors (getters and sett
ers) contained in | 266 * Return an array containing all of the top-level accessors (getters and sett
ers) contained in |
| 261 * this compilation unit. | 267 * this compilation unit. |
| 262 * @return the top-level accessors contained in this compilation unit | 268 * @return the top-level accessors contained in this compilation unit |
| 263 */ | 269 */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 281 */ | 287 */ |
| 282 List<FunctionTypeAliasElement> get functionTypeAliases; | 288 List<FunctionTypeAliasElement> get functionTypeAliases; |
| 283 | 289 |
| 284 /** | 290 /** |
| 285 * Return an array containing all of the top-level variables contained in this
compilation unit. | 291 * Return an array containing all of the top-level variables contained in this
compilation unit. |
| 286 * @return the top-level variables contained in this compilation unit | 292 * @return the top-level variables contained in this compilation unit |
| 287 */ | 293 */ |
| 288 List<TopLevelVariableElement> get topLevelVariables; | 294 List<TopLevelVariableElement> get topLevelVariables; |
| 289 | 295 |
| 290 /** | 296 /** |
| 291 * Return the class defined in this compilation unit that has the given name,
or {@code null} if | 297 * Return the class defined in this compilation unit that has the given name,
or `null` if |
| 292 * this compilation unit does not define a class with the given name. | 298 * this compilation unit does not define a class with the given name. |
| 293 * @param className the name of the class to be returned | 299 * @param className the name of the class to be returned |
| 294 * @return the class with the given name that is defined in this compilation u
nit | 300 * @return the class with the given name that is defined in this compilation u
nit |
| 295 */ | 301 */ |
| 296 ClassElement getType(String className); | 302 ClassElement getType(String className); |
| 297 | 303 |
| 298 /** | 304 /** |
| 299 * Return an array containing all of the classes contained in this compilation
unit. | 305 * Return an array containing all of the classes contained in this compilation
unit. |
| 300 * @return the classes contained in this compilation unit | 306 * @return the classes contained in this compilation unit |
| 301 */ | 307 */ |
| 302 List<ClassElement> get types; | 308 List<ClassElement> get types; |
| 303 } | 309 } |
| 304 /** | 310 /** |
| 305 * The interface {@code ConstructorElement} defines the behavior of elements rep
resenting a | 311 * The interface `ConstructorElement` defines the behavior of elements represent
ing a |
| 306 * constructor or a factory method defined within a type. | 312 * constructor or a factory method defined within a type. |
| 307 * @coverage dart.engine.element | 313 * @coverage dart.engine.element |
| 308 */ | 314 */ |
| 309 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme
nt { | 315 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme
nt { |
| 310 | 316 |
| 311 /** | 317 /** |
| 312 * Return the constructor to which this constructor is redirecting. | 318 * Return the constructor to which this constructor is redirecting. |
| 313 * @return the constructor to which this constructor is redirecting | 319 * @return the constructor to which this constructor is redirecting |
| 314 */ | 320 */ |
| 315 ConstructorElement get redirectedConstructor; | 321 ConstructorElement get redirectedConstructor; |
| 316 | 322 |
| 317 /** | 323 /** |
| 318 * Return {@code true} if this constructor is a const constructor. | 324 * Return `true` if this constructor is a const constructor. |
| 319 * @return {@code true} if this constructor is a const constructor | 325 * @return `true` if this constructor is a const constructor |
| 320 */ | 326 */ |
| 321 bool isConst(); | 327 bool isConst(); |
| 322 | 328 |
| 323 /** | 329 /** |
| 324 * Return {@code true} if this constructor represents a factory constructor. | 330 * Return `true` if this constructor can be used as a default constructor - un
named and has |
| 325 * @return {@code true} if this constructor represents a factory constructor | 331 * no required parameters. |
| 332 * @return `true` if this constructor can be used as a default constructor. |
| 333 */ |
| 334 bool isDefaultConstructor(); |
| 335 |
| 336 /** |
| 337 * Return `true` if this constructor represents a factory constructor. |
| 338 * @return `true` if this constructor represents a factory constructor |
| 326 */ | 339 */ |
| 327 bool isFactory(); | 340 bool isFactory(); |
| 328 } | 341 } |
| 329 /** | 342 /** |
| 330 * The interface {@code Element} defines the behavior common to all of the eleme
nts in the element | 343 * The interface `Element` defines the behavior common to all of the elements in
the element |
| 331 * 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 |
| 332 * 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. |
| 333 * <p> | 346 * |
| 334 * 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 |
| 335 * 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 |
| 336 * 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 |
| 337 * <i>synthetic</i>. Examples of synthetic elements include | 350 * <i>synthetic</i>. Examples of synthetic elements include |
| 338 * <ul> | 351 * |
| 339 * <li>default constructors in classes that do not define any explicit construct
ors, | 352 * * default constructors in classes that do not define any explicit constructor
s, |
| 340 * <li>getters and setters that are induced by explicit field declarations, | 353 * * getters and setters that are induced by explicit field declarations, |
| 341 * <li>fields that are induced by explicit declarations of getters and setters,
and | 354 * * fields that are induced by explicit declarations of getters and setters, an
d |
| 342 * <li>functions representing the initialization expression for a variable. | 355 * * functions representing the initialization expression for a variable. |
| 343 * </ul> | 356 * |
| 344 * <p> | 357 * |
| 345 * Second, there are elements in the element model that do not have a name. Thes
e correspond to | 358 * Second, there are elements in the element model that do not have a name. Thes
e correspond to |
| 346 * unnamed functions and exist in order to more accurately represent the semanti
c structure of the | 359 * unnamed functions and exist in order to more accurately represent the semanti
c structure of the |
| 347 * program. | 360 * program. |
| 348 * @coverage dart.engine.element | 361 * @coverage dart.engine.element |
| 349 */ | 362 */ |
| 350 abstract class Element { | 363 abstract class Element { |
| 351 | 364 |
| 352 /** | 365 /** |
| 353 * A comparator that can be used to sort elements by their name offset. Elemen
ts with a smaller | 366 * A comparator that can be used to sort elements by their name offset. Elemen
ts with a smaller |
| 354 * offset will be sorted to be before elements with a larger name offset. | 367 * offset will be sorted to be before elements with a larger name offset. |
| 355 */ | 368 */ |
| 356 static final Comparator<Element> SORT_BY_OFFSET = (Element firstElement, Eleme
nt secondElement) => firstElement.nameOffset - secondElement.nameOffset; | 369 static final Comparator<Element> SORT_BY_OFFSET = (Element firstElement, Eleme
nt secondElement) => firstElement.nameOffset - secondElement.nameOffset; |
| 357 | 370 |
| 358 /** | 371 /** |
| 359 * Use the given visitor to visit this element. | 372 * Use the given visitor to visit this element. |
| 360 * @param visitor the visitor that will visit this element | 373 * @param visitor the visitor that will visit this element |
| 361 * @return the value returned by the visitor as a result of visiting this elem
ent | 374 * @return the value returned by the visitor as a result of visiting this elem
ent |
| 362 */ | 375 */ |
| 363 accept(ElementVisitor visitor); | 376 accept(ElementVisitor visitor); |
| 364 | 377 |
| 365 /** | 378 /** |
| 366 * Return the documentation comment for this element as it appears in the orig
inal source | 379 * Return the documentation comment for this element as it appears in the orig
inal source |
| 367 * (complete with the beginning and ending delimiters), or {@code null} if thi
s element does not | 380 * (complete with the beginning and ending delimiters), or `null` if this elem
ent does not |
| 368 * have a documentation comment associated with it. This can be a long-running
operation if the | 381 * have a documentation comment associated with it. This can be a long-running
operation if the |
| 369 * information needed to access the comment is not cached. | 382 * information needed to access the comment is not cached. |
| 370 * @return this element's documentation comment | 383 * @return this element's documentation comment |
| 371 * @throws AnalysisException if the documentation comment could not be determi
ned because the | 384 * @throws AnalysisException if the documentation comment could not be determi
ned because the |
| 372 * analysis could not be performed | 385 * analysis could not be performed |
| 373 */ | 386 */ |
| 374 String computeDocumentationComment(); | 387 String computeDocumentationComment(); |
| 375 | 388 |
| 376 /** | 389 /** |
| 377 * Return the element of the given class that most immediately encloses this e
lement, or{@code null} if there is no enclosing element of the given class. | 390 * Return the element of the given class that most immediately encloses this e
lement, or`null` if there is no enclosing element of the given class. |
| 378 * @param elementClass the class of the element to be returned | 391 * @param elementClass the class of the element to be returned |
| 379 * @return the element that encloses this element | 392 * @return the element that encloses this element |
| 380 */ | 393 */ |
| 381 Element getAncestor(Type elementClass); | 394 Element getAncestor(Type elementClass); |
| 382 | 395 |
| 383 /** | 396 /** |
| 384 * Return the analysis context in which this element is defined. | 397 * Return the analysis context in which this element is defined. |
| 385 * @return the analysis context in which this element is defined | 398 * @return the analysis context in which this element is defined |
| 386 */ | 399 */ |
| 387 AnalysisContext get context; | 400 AnalysisContext get context; |
| 388 | 401 |
| 389 /** | 402 /** |
| 390 * Return the display name of this element, or {@code null} if this element do
es not have a name. | 403 * Return the display name of this element, or `null` if this element does not
have a name. |
| 391 * <p> | 404 * |
| 392 * In most cases the name and the display name are the same. Differences thoug
h are cases such as | 405 * In most cases the name and the display name are the same. Differences thoug
h are cases such as |
| 393 * setters where the name of some setter {@code set f(x)} is {@code f=}, inste
ad of {@code f}. | 406 * setters where the name of some setter `set f(x)` is `f=`, instead of `f`. |
| 394 * @return the display name of this element | 407 * @return the display name of this element |
| 395 */ | 408 */ |
| 396 String get displayName; | 409 String get displayName; |
| 397 | 410 |
| 398 /** | 411 /** |
| 399 * Return the element that either physically or logically encloses this elemen
t. This will be{@code null} if this element is a library because libraries are t
he top-level elements in the | 412 * Return the element that either physically or logically encloses this elemen
t. This will be`null` if this element is a library because libraries are the top
-level elements in the |
| 400 * model. | 413 * model. |
| 401 * @return the element that encloses this element | 414 * @return the element that encloses this element |
| 402 */ | 415 */ |
| 403 Element get enclosingElement; | 416 Element get enclosingElement; |
| 404 | 417 |
| 405 /** | 418 /** |
| 406 * Return the kind of element that this is. | 419 * Return the kind of element that this is. |
| 407 * @return the kind of this element | 420 * @return the kind of this element |
| 408 */ | 421 */ |
| 409 ElementKind get kind; | 422 ElementKind get kind; |
| 410 | 423 |
| 411 /** | 424 /** |
| 412 * Return the library that contains this element. This will be the element its
elf if it is a | 425 * Return the library that contains this element. This will be the element its
elf if it is a |
| 413 * library element. This will be {@code null} if this element is an HTML file
because HTML files | 426 * library element. This will be `null` if this element is an HTML file becaus
e HTML files |
| 414 * are not contained in libraries. | 427 * are not contained in libraries. |
| 415 * @return the library that contains this element | 428 * @return the library that contains this element |
| 416 */ | 429 */ |
| 417 LibraryElement get library; | 430 LibraryElement get library; |
| 418 | 431 |
| 419 /** | 432 /** |
| 420 * Return an object representing the location of this element in the element m
odel. The object can | 433 * Return an object representing the location of this element in the element m
odel. The object can |
| 421 * be used to locate this element at a later time. | 434 * be used to locate this element at a later time. |
| 422 * @return the location of this element in the element model | 435 * @return the location of this element in the element model |
| 423 */ | 436 */ |
| 424 ElementLocation get location; | 437 ElementLocation get location; |
| 425 | 438 |
| 426 /** | 439 /** |
| 427 * Return an array containing all of the metadata associated with this element
. | 440 * Return an array containing all of the metadata associated with this element
. |
| 428 * @return the metadata associated with this element | 441 * @return the metadata associated with this element |
| 429 */ | 442 */ |
| 430 List<ElementAnnotation> get metadata; | 443 List<ElementAnnotation> get metadata; |
| 431 | 444 |
| 432 /** | 445 /** |
| 433 * Return the name of this element, or {@code null} if this element does not h
ave a name. | 446 * Return the name of this element, or `null` if this element does not have a
name. |
| 434 * @return the name of this element | 447 * @return the name of this element |
| 435 */ | 448 */ |
| 436 String get name; | 449 String get name; |
| 437 | 450 |
| 438 /** | 451 /** |
| 439 * Return the offset of the name of this element in the file that contains the
declaration of this | 452 * Return the offset of the name of this element in the file that contains the
declaration of this |
| 440 * element, or {@code -1} if this element is synthetic, does not have a name,
or otherwise does | 453 * element, or `-1` if this element is synthetic, does not have a name, or oth
erwise does |
| 441 * not have an offset. | 454 * not have an offset. |
| 442 * @return the offset of the name of this element | 455 * @return the offset of the name of this element |
| 443 */ | 456 */ |
| 444 int get nameOffset; | 457 int get nameOffset; |
| 445 | 458 |
| 446 /** | 459 /** |
| 447 * Return the source that contains this element, or {@code null} if this eleme
nt is not contained | 460 * Return the source that contains this element, or `null` if this element is
not contained |
| 448 * in a source. | 461 * in a source. |
| 449 * @return the source that contains this element | 462 * @return the source that contains this element |
| 450 */ | 463 */ |
| 451 Source get source; | 464 Source get source; |
| 452 | 465 |
| 453 /** | 466 /** |
| 454 * Return {@code true} if this element, assuming that it is within scope, is a
ccessible to code in | 467 * Return `true` if this element, assuming that it is within scope, is accessi
ble to code in |
| 455 * the given library. This is defined by the Dart Language Specification in se
ction 3.2: | 468 * the given library. This is defined by the Dart Language Specification in se
ction 3.2: |
| 456 * <blockquote> A declaration <i>m</i> is accessible to library <i>L</i> if <i
>m</i> is declared | 469 * <blockquote> A declaration <i>m</i> is accessible to library <i>L</i> if <i
>m</i> is declared |
| 457 * in <i>L</i> or if <i>m</i> is public. </blockquote> | 470 * in <i>L</i> or if <i>m</i> is public. </blockquote> |
| 458 * @param library the library in which a possible reference to this element wo
uld occur | 471 * @param library the library in which a possible reference to this element wo
uld occur |
| 459 * @return {@code true} if this element is accessible to code in the given lib
rary | 472 * @return `true` if this element is accessible to code in the given library |
| 460 */ | 473 */ |
| 461 bool isAccessibleIn(LibraryElement library); | 474 bool isAccessibleIn(LibraryElement library); |
| 462 | 475 |
| 463 /** | 476 /** |
| 464 * Return {@code true} if this element is synthetic. A synthetic element is an
element that is not | 477 * Return `true` if this element is synthetic. A synthetic element is an eleme
nt that is not |
| 465 * 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 |
| 466 * 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. |
| 467 * @return {@code true} if this element is synthetic | 480 * @return `true` if this element is synthetic |
| 468 */ | 481 */ |
| 469 bool isSynthetic(); | 482 bool isSynthetic(); |
| 470 | 483 |
| 471 /** | 484 /** |
| 472 * 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 |
| 473 * the order in which the children will be visited. | 486 * the order in which the children will be visited. |
| 474 * @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 |
| 475 */ | 488 */ |
| 476 void visitChildren(ElementVisitor<Object> visitor); | 489 void visitChildren(ElementVisitor<Object> visitor); |
| 477 } | 490 } |
| 478 /** | 491 /** |
| 479 * The interface {@code ElementAnnotation} defines the behavior of objects repre
senting a single | 492 * The interface `ElementAnnotation` defines the behavior of objects representin
g a single |
| 480 * annotation associated with an element. | 493 * annotation associated with an element. |
| 481 * @coverage dart.engine.element | 494 * @coverage dart.engine.element |
| 482 */ | 495 */ |
| 483 abstract class ElementAnnotation { | 496 abstract class ElementAnnotation { |
| 484 | 497 |
| 485 /** | 498 /** |
| 486 * Return the element representing the field, variable, or const constructor b
eing used as an | 499 * Return the element representing the field, variable, or const constructor b
eing used as an |
| 487 * annotation. | 500 * annotation. |
| 488 * @return the field, variable, or constructor being used as an annotation | 501 * @return the field, variable, or constructor being used as an annotation |
| 489 */ | 502 */ |
| 490 Element get element; | 503 Element get element; |
| 491 } | 504 } |
| 492 /** | 505 /** |
| 493 * The enumeration {@code ElementKind} defines the various kinds of elements in
the element model. | 506 * The enumeration `ElementKind` defines the various kinds of elements in the el
ement model. |
| 494 * @coverage dart.engine.element | 507 * @coverage dart.engine.element |
| 495 */ | 508 */ |
| 496 class ElementKind implements Comparable<ElementKind> { | 509 class ElementKind implements Comparable<ElementKind> { |
| 497 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); | 510 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); |
| 498 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT'
, 1, "compilation unit"); | 511 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT'
, 1, "compilation unit"); |
| 499 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons
tructor"); | 512 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons
tructor"); |
| 500 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); | 513 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); |
| 501 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML
_SCRIPT', 4, "embedded html script"); | 514 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML
_SCRIPT', 4, "embedded html script"); |
| 502 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); | 515 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); |
| 503 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi
ve"); | 516 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi
ve"); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 521 static final ElementKind UNIVERSE = new ElementKind('UNIVERSE', 24, "<universe
>"); | 534 static final ElementKind UNIVERSE = new ElementKind('UNIVERSE', 24, "<universe
>"); |
| 522 static final List<ElementKind> values = [CLASS, COMPILATION_UNIT, CONSTRUCTOR,
DYNAMIC, EMBEDDED_HTML_SCRIPT, ERROR, EXPORT, EXTERNAL_HTML_SCRIPT, FIELD, FUNC
TION, GETTER, HTML, IMPORT, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, NAME, PARAME
TER, PREFIX, SETTER, TOP_LEVEL_VARIABLE, FUNCTION_TYPE_ALIAS, TYPE_VARIABLE, UNI
VERSE]; | 535 static final List<ElementKind> values = [CLASS, COMPILATION_UNIT, CONSTRUCTOR,
DYNAMIC, EMBEDDED_HTML_SCRIPT, ERROR, EXPORT, EXTERNAL_HTML_SCRIPT, FIELD, FUNC
TION, GETTER, HTML, IMPORT, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, NAME, PARAME
TER, PREFIX, SETTER, TOP_LEVEL_VARIABLE, FUNCTION_TYPE_ALIAS, TYPE_VARIABLE, UNI
VERSE]; |
| 523 | 536 |
| 524 /// The name of this enum constant, as declared in the enum declaration. | 537 /// The name of this enum constant, as declared in the enum declaration. |
| 525 final String name; | 538 final String name; |
| 526 | 539 |
| 527 /// The position in the enum declaration. | 540 /// The position in the enum declaration. |
| 528 final int ordinal; | 541 final int ordinal; |
| 529 | 542 |
| 530 /** | 543 /** |
| 531 * Return the kind of the given element, or {@link #ERROR} if the element is {
@code null}. This is | 544 * Return the kind of the given element, or [ERROR] if the element is `null`.
This is |
| 532 * a utility method that can reduce the need for null checks in other places. | 545 * a utility method that can reduce the need for null checks in other places. |
| 533 * @param element the element whose kind is to be returned | 546 * @param element the element whose kind is to be returned |
| 534 * @return the kind of the given element | 547 * @return the kind of the given element |
| 535 */ | 548 */ |
| 536 static ElementKind of(Element element) { | 549 static ElementKind of(Element element) { |
| 537 if (element == null) { | 550 if (element == null) { |
| 538 return ERROR; | 551 return ERROR; |
| 539 } | 552 } |
| 540 return element.kind; | 553 return element.kind; |
| 541 } | 554 } |
| 542 | 555 |
| 543 /** | 556 /** |
| 544 * The name displayed in the UI for this kind of element. | 557 * The name displayed in the UI for this kind of element. |
| 545 */ | 558 */ |
| 546 String _displayName; | 559 String _displayName; |
| 547 | 560 |
| 548 /** | 561 /** |
| 549 * Initialize a newly created element kind to have the given display name. | 562 * Initialize a newly created element kind to have the given display name. |
| 550 * @param displayName the name displayed in the UI for this kind of element | 563 * @param displayName the name displayed in the UI for this kind of element |
| 551 */ | 564 */ |
| 552 ElementKind(this.name, this.ordinal, String displayName) { | 565 ElementKind(this.name, this.ordinal, String displayName) { |
| 553 this._displayName = displayName; | 566 this._displayName = displayName; |
| 554 } | 567 } |
| 555 | 568 |
| 556 /** | 569 /** |
| 557 * Return the name displayed in the UI for this kind of element. | 570 * Return the name displayed in the UI for this kind of element. |
| 558 * @return the name of this {@link ElementKind} to display in UI. | 571 * @return the name of this [ElementKind] to display in UI. |
| 559 */ | 572 */ |
| 560 String get displayName => _displayName; | 573 String get displayName => _displayName; |
| 561 int compareTo(ElementKind other) => ordinal - other.ordinal; | 574 int compareTo(ElementKind other) => ordinal - other.ordinal; |
| 562 int get hashCode => ordinal; | 575 int get hashCode => ordinal; |
| 563 String toString() => name; | 576 String toString() => name; |
| 564 } | 577 } |
| 565 /** | 578 /** |
| 566 * The interface {@code ElementLocation} defines the behavior of objects that re
present the location | 579 * The interface `ElementLocation` defines the behavior of objects that represen
t the location |
| 567 * of an element within the element model. | 580 * of an element within the element model. |
| 568 * @coverage dart.engine.element | 581 * @coverage dart.engine.element |
| 569 */ | 582 */ |
| 570 abstract class ElementLocation { | 583 abstract class ElementLocation { |
| 571 | 584 |
| 572 /** | 585 /** |
| 573 * Return an encoded representation of this location that can be used to creat
e a location that is | 586 * Return an encoded representation of this location that can be used to creat
e a location that is |
| 574 * equal to this location. | 587 * equal to this location. |
| 575 * @return an encoded representation of this location | 588 * @return an encoded representation of this location |
| 576 */ | 589 */ |
| 577 String get encoding; | 590 String get encoding; |
| 578 } | 591 } |
| 579 /** | 592 /** |
| 580 * The interface {@code ElementVisitor} defines the behavior of objects that can
be used to visit an | 593 * The interface `ElementVisitor` defines the behavior of objects that can be us
ed to visit an |
| 581 * element structure. | 594 * element structure. |
| 582 * @coverage dart.engine.element | 595 * @coverage dart.engine.element |
| 583 */ | 596 */ |
| 584 abstract class ElementVisitor<R> { | 597 abstract class ElementVisitor<R> { |
| 585 R visitClassElement(ClassElement element); | 598 R visitClassElement(ClassElement element); |
| 586 R visitCompilationUnitElement(CompilationUnitElement element); | 599 R visitCompilationUnitElement(CompilationUnitElement element); |
| 587 R visitConstructorElement(ConstructorElement element); | 600 R visitConstructorElement(ConstructorElement element); |
| 588 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element); | 601 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element); |
| 589 R visitExportElement(ExportElement element); | 602 R visitExportElement(ExportElement element); |
| 590 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element); | 603 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element); |
| 591 R visitFieldElement(FieldElement element); | 604 R visitFieldElement(FieldElement element); |
| 592 R visitFieldFormalParameterElement(FieldFormalParameterElement element); | 605 R visitFieldFormalParameterElement(FieldFormalParameterElement element); |
| 593 R visitFunctionElement(FunctionElement element); | 606 R visitFunctionElement(FunctionElement element); |
| 594 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element); | 607 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element); |
| 595 R visitHtmlElement(HtmlElement element); | 608 R visitHtmlElement(HtmlElement element); |
| 596 R visitImportElement(ImportElement element); | 609 R visitImportElement(ImportElement element); |
| 597 R visitLabelElement(LabelElement element); | 610 R visitLabelElement(LabelElement element); |
| 598 R visitLibraryElement(LibraryElement element); | 611 R visitLibraryElement(LibraryElement element); |
| 599 R visitLocalVariableElement(LocalVariableElement element); | 612 R visitLocalVariableElement(LocalVariableElement element); |
| 600 R visitMethodElement(MethodElement element); | 613 R visitMethodElement(MethodElement element); |
| 601 R visitMultiplyDefinedElement(MultiplyDefinedElement element); | 614 R visitMultiplyDefinedElement(MultiplyDefinedElement element); |
| 602 R visitParameterElement(ParameterElement element); | 615 R visitParameterElement(ParameterElement element); |
| 603 R visitPrefixElement(PrefixElement element); | 616 R visitPrefixElement(PrefixElement element); |
| 604 R visitPropertyAccessorElement(PropertyAccessorElement element); | 617 R visitPropertyAccessorElement(PropertyAccessorElement element); |
| 605 R visitTopLevelVariableElement(TopLevelVariableElement element); | 618 R visitTopLevelVariableElement(TopLevelVariableElement element); |
| 606 R visitTypeVariableElement(TypeVariableElement element); | 619 R visitTypeVariableElement(TypeVariableElement element); |
| 607 } | 620 } |
| 608 /** | 621 /** |
| 609 * The interface {@code EmbeddedHtmlScriptElement} defines the behavior of eleme
nts representing a | 622 * The interface `EmbeddedHtmlScriptElement` defines the behavior of elements re
presenting a |
| 610 * script tag in an HTML file having content that defines a Dart library. | 623 * script tag in an HTML file having content that defines a Dart library. |
| 611 * @coverage dart.engine.element | 624 * @coverage dart.engine.element |
| 612 */ | 625 */ |
| 613 abstract class EmbeddedHtmlScriptElement implements HtmlScriptElement { | 626 abstract class EmbeddedHtmlScriptElement implements HtmlScriptElement { |
| 614 | 627 |
| 615 /** | 628 /** |
| 616 * Return the library element defined by the content of the script tag. | 629 * Return the library element defined by the content of the script tag. |
| 617 * @return the library element (not {@code null}) | 630 * @return the library element (not `null`) |
| 618 */ | 631 */ |
| 619 LibraryElement get scriptLibrary; | 632 LibraryElement get scriptLibrary; |
| 620 } | 633 } |
| 621 /** | 634 /** |
| 622 * The interface {@code ExecutableElement} defines the behavior of elements repr
esenting an | 635 * The interface `ExecutableElement` defines the behavior of elements representi
ng an |
| 623 * executable object, including functions, methods, constructors, getters, and s
etters. | 636 * executable object, including functions, methods, constructors, getters, and s
etters. |
| 624 * @coverage dart.engine.element | 637 * @coverage dart.engine.element |
| 625 */ | 638 */ |
| 626 abstract class ExecutableElement implements Element { | 639 abstract class ExecutableElement implements Element { |
| 627 | 640 |
| 628 /** | 641 /** |
| 629 * Return an array containing all of the functions defined within this executa
ble element. | 642 * Return an array containing all of the functions defined within this executa
ble element. |
| 630 * @return the functions defined within this executable element | 643 * @return the functions defined within this executable element |
| 631 */ | 644 */ |
| 632 List<FunctionElement> get functions; | 645 List<FunctionElement> get functions; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 643 */ | 656 */ |
| 644 List<LocalVariableElement> get localVariables; | 657 List<LocalVariableElement> get localVariables; |
| 645 | 658 |
| 646 /** | 659 /** |
| 647 * Return an array containing all of the parameters defined by this executable
element. | 660 * Return an array containing all of the parameters defined by this executable
element. |
| 648 * @return the parameters defined by this executable element | 661 * @return the parameters defined by this executable element |
| 649 */ | 662 */ |
| 650 List<ParameterElement> get parameters; | 663 List<ParameterElement> get parameters; |
| 651 | 664 |
| 652 /** | 665 /** |
| 666 * Return the return type defined by this executable element. |
| 667 * @return the return type defined by this executable element |
| 668 */ |
| 669 Type2 get returnType; |
| 670 |
| 671 /** |
| 653 * Return the type of function defined by this executable element. | 672 * Return the type of function defined by this executable element. |
| 654 * @return the type of function defined by this executable element | 673 * @return the type of function defined by this executable element |
| 655 */ | 674 */ |
| 656 FunctionType get type; | 675 FunctionType get type; |
| 657 | 676 |
| 658 /** | 677 /** |
| 659 * Return {@code true} if this executable element is an operator. The test may
be based on the | 678 * Return `true` if this executable element is an operator. The test may be ba
sed on the |
| 660 * 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 |
| 661 * legal. | 680 * legal. |
| 662 * @return {@code true} if this executable element is an operator | 681 * @return `true` if this executable element is an operator |
| 663 */ | 682 */ |
| 664 bool isOperator(); | 683 bool isOperator(); |
| 665 | 684 |
| 666 /** | 685 /** |
| 667 * Return {@code true} if this element is a static element. A static element i
s an element that is | 686 * Return `true` if this element is a static element. A static element is an e
lement that is |
| 668 * 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. |
| 669 * @return {@code true} if this executable element is a static element | 688 * @return `true` if this executable element is a static element |
| 670 */ | 689 */ |
| 671 bool isStatic(); | 690 bool isStatic(); |
| 672 } | 691 } |
| 673 /** | 692 /** |
| 674 * The interface {@code ExportElement} defines the behavior of objects represent
ing information | 693 * The interface `ExportElement` defines the behavior of objects representing in
formation |
| 675 * about a single export directive within a library. | 694 * about a single export directive within a library. |
| 676 * @coverage dart.engine.element | 695 * @coverage dart.engine.element |
| 677 */ | 696 */ |
| 678 abstract class ExportElement implements Element, UriReferencedElement { | 697 abstract class ExportElement implements Element, UriReferencedElement { |
| 679 | 698 |
| 680 /** | 699 /** |
| 681 * An empty array of export elements. | 700 * An empty array of export elements. |
| 682 */ | 701 */ |
| 683 static final List<ExportElement> EMPTY_ARRAY = new List<ExportElement>(0); | 702 static final List<ExportElement> EMPTY_ARRAY = new List<ExportElement>(0); |
| 684 | 703 |
| 685 /** | 704 /** |
| 686 * Return an array containing the combinators that were specified as part of t
he export directive | 705 * Return an array containing the combinators that were specified as part of t
he export directive |
| 687 * in the order in which they were specified. | 706 * in the order in which they were specified. |
| 688 * @return the combinators specified in the export directive | 707 * @return the combinators specified in the export directive |
| 689 */ | 708 */ |
| 690 List<NamespaceCombinator> get combinators; | 709 List<NamespaceCombinator> get combinators; |
| 691 | 710 |
| 692 /** | 711 /** |
| 693 * Return the library that is exported from this library by this export direct
ive. | 712 * Return the library that is exported from this library by this export direct
ive. |
| 694 * @return the library that is exported from this library | 713 * @return the library that is exported from this library |
| 695 */ | 714 */ |
| 696 LibraryElement get exportedLibrary; | 715 LibraryElement get exportedLibrary; |
| 697 } | 716 } |
| 698 /** | 717 /** |
| 699 * The interface {@code ExternalHtmlScriptElement} defines the behavior of eleme
nts representing a | 718 * The interface `ExternalHtmlScriptElement` defines the behavior of elements re
presenting a |
| 700 * script tag in an HTML file having a {@code source} attribute that references
a Dart library | 719 * script tag in an HTML file having a `source` attribute that references a Dart
library |
| 701 * source file. | 720 * source file. |
| 702 * @coverage dart.engine.element | 721 * @coverage dart.engine.element |
| 703 */ | 722 */ |
| 704 abstract class ExternalHtmlScriptElement implements HtmlScriptElement { | 723 abstract class ExternalHtmlScriptElement implements HtmlScriptElement { |
| 705 | 724 |
| 706 /** | 725 /** |
| 707 * Return the source referenced by this element, or {@code null} if this eleme
nt does not | 726 * Return the source referenced by this element, or `null` if this element doe
s not |
| 708 * reference a Dart library source file. | 727 * reference a Dart library source file. |
| 709 * @return the source for the external Dart library | 728 * @return the source for the external Dart library |
| 710 */ | 729 */ |
| 711 Source get scriptSource; | 730 Source get scriptSource; |
| 712 } | 731 } |
| 713 /** | 732 /** |
| 714 * The interface {@code FieldElement} defines the behavior of elements represent
ing a field defined | 733 * The interface `FieldElement` defines the behavior of elements representing a
field defined |
| 715 * within a type. | 734 * within a type. |
| 716 * @coverage dart.engine.element | 735 * @coverage dart.engine.element |
| 717 */ | 736 */ |
| 718 abstract class FieldElement implements ClassMemberElement, PropertyInducingEleme
nt { | 737 abstract class FieldElement implements ClassMemberElement, PropertyInducingEleme
nt { |
| 719 } | 738 } |
| 720 /** | 739 /** |
| 721 * The interface {@code FieldFormalParameterElement} defines the behavior of ele
ments representing a | 740 * The interface `FieldFormalParameterElement` defines the behavior of elements
representing a |
| 722 * field formal parameter defined within a constructor element. | 741 * field formal parameter defined within a constructor element. |
| 723 */ | 742 */ |
| 724 abstract class FieldFormalParameterElement implements ParameterElement { | 743 abstract class FieldFormalParameterElement implements ParameterElement { |
| 725 | 744 |
| 726 /** | 745 /** |
| 727 * Return the field element associated with this field formal parameter, or {@
code null} if the | 746 * Return the field element associated with this field formal parameter, or `n
ull` if the |
| 728 * parameter references a field that doesn't exist. | 747 * parameter references a field that doesn't exist. |
| 729 * @return the field element associated with this field formal parameter | 748 * @return the field element associated with this field formal parameter |
| 730 */ | 749 */ |
| 731 FieldElement get field; | 750 FieldElement get field; |
| 732 } | 751 } |
| 733 /** | 752 /** |
| 734 * The interface {@code FunctionElement} defines the behavior of elements repres
enting a function. | 753 * The interface `FunctionElement` defines the behavior of elements representing
a function. |
| 735 * @coverage dart.engine.element | 754 * @coverage dart.engine.element |
| 736 */ | 755 */ |
| 737 abstract class FunctionElement implements ExecutableElement, LocalElement { | 756 abstract class FunctionElement implements ExecutableElement, LocalElement { |
| 738 } | 757 } |
| 739 /** | 758 /** |
| 740 * The interface {@code FunctionTypeAliasElement} defines the behavior of elemen
ts representing a | 759 * The interface `FunctionTypeAliasElement` defines the behavior of elements rep
resenting a |
| 741 * function type alias ({@code typedef}). | 760 * function type alias (`typedef`). |
| 742 * @coverage dart.engine.element | 761 * @coverage dart.engine.element |
| 743 */ | 762 */ |
| 744 abstract class FunctionTypeAliasElement implements Element { | 763 abstract class FunctionTypeAliasElement implements Element { |
| 745 | 764 |
| 746 /** | 765 /** |
| 747 * Return the compilation unit in which this type alias is defined. | 766 * Return the compilation unit in which this type alias is defined. |
| 748 * @return the compilation unit in which this type alias is defined | 767 * @return the compilation unit in which this type alias is defined |
| 749 */ | 768 */ |
| 750 CompilationUnitElement get enclosingElement; | 769 CompilationUnitElement get enclosingElement; |
| 751 | 770 |
| 752 /** | 771 /** |
| 753 * Return an array containing all of the parameters defined by this type alias
. | 772 * Return an array containing all of the parameters defined by this type alias
. |
| 754 * @return the parameters defined by this type alias | 773 * @return the parameters defined by this type alias |
| 755 */ | 774 */ |
| 756 List<ParameterElement> get parameters; | 775 List<ParameterElement> get parameters; |
| 757 | 776 |
| 758 /** | 777 /** |
| 778 * Return the return type defined by this type alias. |
| 779 * @return the return type defined by this type alias |
| 780 */ |
| 781 Type2 get returnType; |
| 782 |
| 783 /** |
| 759 * Return the type of function defined by this type alias. | 784 * Return the type of function defined by this type alias. |
| 760 * @return the type of function defined by this type alias | 785 * @return the type of function defined by this type alias |
| 761 */ | 786 */ |
| 762 FunctionType get type; | 787 FunctionType get type; |
| 763 | 788 |
| 764 /** | 789 /** |
| 765 * Return an array containing all of the type variables defined for this type. | 790 * Return an array containing all of the type variables defined for this type. |
| 766 * @return the type variables defined for this type | 791 * @return the type variables defined for this type |
| 767 */ | 792 */ |
| 768 List<TypeVariableElement> get typeVariables; | 793 List<TypeVariableElement> get typeVariables; |
| 769 } | 794 } |
| 770 /** | 795 /** |
| 771 * The interface {@code HideElementCombinator} defines the behavior of combinato
rs that cause some | 796 * The interface `HideElementCombinator` defines the behavior of combinators tha
t cause some |
| 772 * of the names in a namespace to be hidden when being imported. | 797 * of the names in a namespace to be hidden when being imported. |
| 773 * @coverage dart.engine.element | 798 * @coverage dart.engine.element |
| 774 */ | 799 */ |
| 775 abstract class HideElementCombinator implements NamespaceCombinator { | 800 abstract class HideElementCombinator implements NamespaceCombinator { |
| 776 | 801 |
| 777 /** | 802 /** |
| 778 * Return an array containing the names that are not to be made visible in the
importing library | 803 * Return an array containing the names that are not to be made visible in the
importing library |
| 779 * even if they are defined in the imported library. | 804 * even if they are defined in the imported library. |
| 780 * @return the names from the imported library that are hidden from the import
ing library | 805 * @return the names from the imported library that are hidden from the import
ing library |
| 781 */ | 806 */ |
| 782 List<String> get hiddenNames; | 807 List<String> get hiddenNames; |
| 783 } | 808 } |
| 784 /** | 809 /** |
| 785 * The interface {@code HtmlElement} defines the behavior of elements representi
ng an HTML file. | 810 * The interface `HtmlElement` defines the behavior of elements representing an
HTML file. |
| 786 * @coverage dart.engine.element | 811 * @coverage dart.engine.element |
| 787 */ | 812 */ |
| 788 abstract class HtmlElement implements Element { | 813 abstract class HtmlElement implements Element { |
| 789 | 814 |
| 790 /** | 815 /** |
| 791 * Return an array containing all of the script elements contained in the HTML
file. This includes | 816 * Return an array containing all of the script elements contained in the HTML
file. This includes |
| 792 * scripts with libraries that are defined by the content of a script tag as w
ell as libraries | 817 * scripts with libraries that are defined by the content of a script tag as w
ell as libraries |
| 793 * that are referenced in the {@core source} attribute of a script tag. | 818 * that are referenced in the {@core source} attribute of a script tag. |
| 794 * @return the script elements in the HTML file (not {@code null}, contains no
{@code null}s) | 819 * @return the script elements in the HTML file (not `null`, contains no `null
`s) |
| 795 */ | 820 */ |
| 796 List<HtmlScriptElement> get scripts; | 821 List<HtmlScriptElement> get scripts; |
| 797 } | 822 } |
| 798 /** | 823 /** |
| 799 * The interface {@code HtmlScriptElement} defines the behavior of elements repr
esenting a script | 824 * The interface `HtmlScriptElement` defines the behavior of elements representi
ng a script |
| 800 * tag in an HTML file. | 825 * tag in an HTML file. |
| 801 * @see EmbeddedHtmlScriptElement | 826 * @see EmbeddedHtmlScriptElement |
| 802 * @see ExternalHtmlScriptElement | 827 * @see ExternalHtmlScriptElement |
| 803 * @coverage dart.engine.element | 828 * @coverage dart.engine.element |
| 804 */ | 829 */ |
| 805 abstract class HtmlScriptElement implements Element { | 830 abstract class HtmlScriptElement implements Element { |
| 806 } | 831 } |
| 807 /** | 832 /** |
| 808 * The interface {@code ImportElement} defines the behavior of objects represent
ing information | 833 * The interface `ImportElement` defines the behavior of objects representing in
formation |
| 809 * about a single import directive within a library. | 834 * about a single import directive within a library. |
| 810 * @coverage dart.engine.element | 835 * @coverage dart.engine.element |
| 811 */ | 836 */ |
| 812 abstract class ImportElement implements Element, UriReferencedElement { | 837 abstract class ImportElement implements Element, UriReferencedElement { |
| 813 | 838 |
| 814 /** | 839 /** |
| 815 * An empty array of import elements. | 840 * An empty array of import elements. |
| 816 */ | 841 */ |
| 817 static final List<ImportElement> EMPTY_ARRAY = new List<ImportElement>(0); | 842 static final List<ImportElement> EMPTY_ARRAY = new List<ImportElement>(0); |
| 818 | 843 |
| 819 /** | 844 /** |
| 820 * Return an array containing the combinators that were specified as part of t
he import directive | 845 * Return an array containing the combinators that were specified as part of t
he import directive |
| 821 * in the order in which they were specified. | 846 * in the order in which they were specified. |
| 822 * @return the combinators specified in the import directive | 847 * @return the combinators specified in the import directive |
| 823 */ | 848 */ |
| 824 List<NamespaceCombinator> get combinators; | 849 List<NamespaceCombinator> get combinators; |
| 825 | 850 |
| 826 /** | 851 /** |
| 827 * Return the library that is imported into this library by this import direct
ive. | 852 * Return the library that is imported into this library by this import direct
ive. |
| 828 * @return the library that is imported into this library | 853 * @return the library that is imported into this library |
| 829 */ | 854 */ |
| 830 LibraryElement get importedLibrary; | 855 LibraryElement get importedLibrary; |
| 831 | 856 |
| 832 /** | 857 /** |
| 833 * Return the prefix that was specified as part of the import directive, or {@
code null} if there | 858 * Return the prefix that was specified as part of the import directive, or `n
ull` if there |
| 834 * was no prefix specified. | 859 * was no prefix specified. |
| 835 * @return the prefix that was specified as part of the import directive | 860 * @return the prefix that was specified as part of the import directive |
| 836 */ | 861 */ |
| 837 PrefixElement get prefix; | 862 PrefixElement get prefix; |
| 838 } | 863 } |
| 839 /** | 864 /** |
| 840 * The interface {@code LabelElement} defines the behavior of elements represent
ing a label | 865 * The interface `LabelElement` defines the behavior of elements representing a
label |
| 841 * associated with a statement. | 866 * associated with a statement. |
| 842 * @coverage dart.engine.element | 867 * @coverage dart.engine.element |
| 843 */ | 868 */ |
| 844 abstract class LabelElement implements Element { | 869 abstract class LabelElement implements Element { |
| 845 | 870 |
| 846 /** | 871 /** |
| 847 * Return the executable element in which this label is defined. | 872 * Return the executable element in which this label is defined. |
| 848 * @return the executable element in which this label is defined | 873 * @return the executable element in which this label is defined |
| 849 */ | 874 */ |
| 850 ExecutableElement get enclosingElement; | 875 ExecutableElement get enclosingElement; |
| 851 } | 876 } |
| 852 /** | 877 /** |
| 853 * The interface {@code LibraryElement} defines the behavior of elements represe
nting a library. | 878 * The interface `LibraryElement` defines the behavior of elements representing
a library. |
| 854 * @coverage dart.engine.element | 879 * @coverage dart.engine.element |
| 855 */ | 880 */ |
| 856 abstract class LibraryElement implements Element { | 881 abstract class LibraryElement implements Element { |
| 857 | 882 |
| 858 /** | 883 /** |
| 859 * Return the compilation unit that defines this library. | 884 * Return the compilation unit that defines this library. |
| 860 * @return the compilation unit that defines this library | 885 * @return the compilation unit that defines this library |
| 861 */ | 886 */ |
| 862 CompilationUnitElement get definingCompilationUnit; | 887 CompilationUnitElement get definingCompilationUnit; |
| 863 | 888 |
| 864 /** | 889 /** |
| 865 * Return the entry point for this library, or {@code null} if this library do
es not have an entry | 890 * Return the entry point for this library, or `null` if this library does not
have an entry |
| 866 * point. The entry point is defined to be a zero argument top-level function
whose name is{@code main}. | 891 * point. The entry point is defined to be a zero argument top-level function
whose name is`main`. |
| 867 * @return the entry point for this library | 892 * @return the entry point for this library |
| 868 */ | 893 */ |
| 869 FunctionElement get entryPoint; | 894 FunctionElement get entryPoint; |
| 870 | 895 |
| 871 /** | 896 /** |
| 872 * Return an array containing all of the libraries that are exported from this
library. | 897 * Return an array containing all of the libraries that are exported from this
library. |
| 873 * @return an array containing all of the libraries that are exported from thi
s library | 898 * @return an array containing all of the libraries that are exported from thi
s library |
| 874 */ | 899 */ |
| 875 List<LibraryElement> get exportedLibraries; | 900 List<LibraryElement> get exportedLibraries; |
| 876 | 901 |
| 877 /** | 902 /** |
| 878 * Return an array containing all of the exports defined in this library. | 903 * Return an array containing all of the exports defined in this library. |
| 879 * @return the exports defined in this library | 904 * @return the exports defined in this library |
| 880 */ | 905 */ |
| 881 List<ExportElement> get exports; | 906 List<ExportElement> get exports; |
| 882 | 907 |
| 883 /** | 908 /** |
| 884 * Return an array containing all of the libraries that are imported into this
library. This | 909 * Return an array containing all of the libraries that are imported into this
library. This |
| 885 * includes all of the libraries that are imported using a prefix (also availa
ble through the | 910 * includes all of the libraries that are imported using a prefix (also availa
ble through the |
| 886 * prefixes returned by {@link #getPrefixes()}) and those that are imported wi
thout a prefix. | 911 * prefixes returned by [getPrefixes]) and those that are imported without a p
refix. |
| 887 * @return an array containing all of the libraries that are imported into thi
s library | 912 * @return an array containing all of the libraries that are imported into thi
s library |
| 888 */ | 913 */ |
| 889 List<LibraryElement> get importedLibraries; | 914 List<LibraryElement> get importedLibraries; |
| 890 | 915 |
| 891 /** | 916 /** |
| 892 * Return an array containing all of the imports defined in this library. | 917 * Return an array containing all of the imports defined in this library. |
| 893 * @return the imports defined in this library | 918 * @return the imports defined in this library |
| 894 */ | 919 */ |
| 895 List<ImportElement> get imports; | 920 List<ImportElement> get imports; |
| 896 | 921 |
| 897 /** | 922 /** |
| 898 * Return an array containing all of the compilation units that are included i
n this library using | 923 * Return an array containing all of the compilation units that are included i
n this library using |
| 899 * a {@code part} directive. This does not include the defining compilation un
it that contains the{@code part} directives. | 924 * a `part` directive. This does not include the defining compilation unit tha
t contains the`part` directives. |
| 900 * @return the compilation units that are included in this library | 925 * @return the compilation units that are included in this library |
| 901 */ | 926 */ |
| 902 List<CompilationUnitElement> get parts; | 927 List<CompilationUnitElement> get parts; |
| 903 | 928 |
| 904 /** | 929 /** |
| 905 * Return an array containing elements for each of the prefixes used to {@code
import} libraries | 930 * Return an array containing elements for each of the prefixes used to `impor
t` libraries |
| 906 * into this library. Each prefix can be used in more than one {@code import}
directive. | 931 * into this library. Each prefix can be used in more than one `import` direct
ive. |
| 907 * @return the prefixes used to {@code import} libraries into this library | 932 * @return the prefixes used to `import` libraries into this library |
| 908 */ | 933 */ |
| 909 List<PrefixElement> get prefixes; | 934 List<PrefixElement> get prefixes; |
| 910 | 935 |
| 911 /** | 936 /** |
| 912 * Return the class defined in this library that has the given name, or {@code
null} if this | 937 * Return the class defined in this library that has the given name, or `null`
if this |
| 913 * library does not define a class with the given name. | 938 * library does not define a class with the given name. |
| 914 * @param className the name of the class to be returned | 939 * @param className the name of the class to be returned |
| 915 * @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 |
| 916 */ | 941 */ |
| 917 ClassElement getType(String className); | 942 ClassElement getType(String className); |
| 918 | 943 |
| 919 /** | 944 /** |
| 920 * Answer {@code true} if this library is an application that can be run in th
e browser. | 945 * Answer `true` if this library is an application that can be run in the brow
ser. |
| 921 * @return {@code true} if this library is an application that can be run in t
he browser | 946 * @return `true` if this library is an application that can be run in the bro
wser |
| 922 */ | 947 */ |
| 923 bool isBrowserApplication(); | 948 bool isBrowserApplication(); |
| 924 | 949 |
| 925 /** | 950 /** |
| 926 * Return {@code true} if this library is the dart:core library. | 951 * Return `true` if this library is the dart:core library. |
| 927 * @return {@code true} if this library is the dart:core library | 952 * @return `true` if this library is the dart:core library |
| 928 */ | 953 */ |
| 929 bool isDartCore(); | 954 bool isDartCore(); |
| 930 | 955 |
| 931 /** | 956 /** |
| 932 * Return {@code 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 |
| 933 * 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. |
| 934 * @param timeStamp the time stamp to compare against | 959 * @param timeStamp the time stamp to compare against |
| 935 * @return {@code true} if this library is up to date with respect to the give
n time stamp | 960 * @return `true` if this library is up to date with respect to the given time
stamp |
| 936 */ | 961 */ |
| 937 bool isUpToDate2(int timeStamp); | 962 bool isUpToDate2(int timeStamp); |
| 938 } | 963 } |
| 939 /** | 964 /** |
| 940 * The interface {@code LocalElement} defines the behavior of elements that can
be (but are not | 965 * The interface `LocalElement` defines the behavior of elements that can be (bu
t are not |
| 941 * required to be) defined within a method or function (an {@link ExecutableElem
ent}). | 966 * required to be) defined within a method or function (an [ExecutableElement]). |
| 942 * @coverage dart.engine.element | 967 * @coverage dart.engine.element |
| 943 */ | 968 */ |
| 944 abstract class LocalElement implements Element { | 969 abstract class LocalElement implements Element { |
| 945 | 970 |
| 946 /** | 971 /** |
| 947 * Return a source range that covers the approximate portion of the source in
which the name of | 972 * Return a source range that covers the approximate portion of the source in
which the name of |
| 948 * this element is visible, or {@code null} if there is no single range of cha
racters within which | 973 * this element is visible, or `null` if there is no single range of character
s within which |
| 949 * the element name is visible. | 974 * the element name is visible. |
| 950 * <ul> | 975 * |
| 951 * <li>For a local variable, this includes everything from the end of the vari
able's initializer | 976 * * For a local variable, this includes everything from the end of the variab
le's initializer |
| 952 * to the end of the block that encloses the variable declaration.</li> | 977 * to the end of the block that encloses the variable declaration. |
| 953 * <li>For a parameter, this includes the body of the method or function that
declares the | 978 * * For a parameter, this includes the body of the method or function that de
clares the |
| 954 * parameter.</li> | 979 * parameter. |
| 955 * <li>For a local function, this includes everything from the beginning of th
e function's body to | 980 * * For a local function, this includes everything from the beginning of the
function's body to |
| 956 * the end of the block that encloses the function declaration.</li> | 981 * the end of the block that encloses the function declaration. |
| 957 * <li>For top-level functions, {@code null} will be returned because they are
potentially visible | 982 * * For top-level functions, `null` will be returned because they are potenti
ally visible |
| 958 * in multiple sources.</li> | 983 * in multiple sources. |
| 959 * </ul> | 984 * |
| 960 * @return the range of characters in which the name of this element is visibl
e | 985 * @return the range of characters in which the name of this element is visibl
e |
| 961 */ | 986 */ |
| 962 SourceRange get visibleRange; | 987 SourceRange get visibleRange; |
| 963 } | 988 } |
| 964 /** | 989 /** |
| 965 * The interface {@code LocalVariableElement} defines the behavior common to ele
ments that represent | 990 * The interface `LocalVariableElement` defines the behavior common to elements
that represent |
| 966 * a local variable. | 991 * a local variable. |
| 967 * @coverage dart.engine.element | 992 * @coverage dart.engine.element |
| 968 */ | 993 */ |
| 969 abstract class LocalVariableElement implements LocalElement, VariableElement { | 994 abstract class LocalVariableElement implements LocalElement, VariableElement { |
| 970 } | 995 } |
| 971 /** | 996 /** |
| 972 * The interface {@code MethodElement} defines the behavior of elements that rep
resent a method | 997 * The interface `MethodElement` defines the behavior of elements that represent
a method |
| 973 * defined within a type. | 998 * defined within a type. |
| 974 * @coverage dart.engine.element | 999 * @coverage dart.engine.element |
| 975 */ | 1000 */ |
| 976 abstract class MethodElement implements ClassMemberElement, ExecutableElement { | 1001 abstract class MethodElement implements ClassMemberElement, ExecutableElement { |
| 977 | 1002 |
| 978 /** | 1003 /** |
| 979 * Return {@code true} if this method is abstract. Methods are abstract if the
y are not external | 1004 * Return `true` if this method is abstract. Methods are abstract if they are
not external |
| 980 * and have no body. | 1005 * and have no body. |
| 981 * @return {@code true} if this method is abstract | 1006 * @return `true` if this method is abstract |
| 982 */ | 1007 */ |
| 983 bool isAbstract(); | 1008 bool isAbstract(); |
| 984 } | 1009 } |
| 985 /** | 1010 /** |
| 986 * The interface {@code MultiplyDefinedElement} defines the behavior of pseudo-e
lements that | 1011 * The interface `MultiplyDefinedElement` defines the behavior of pseudo-element
s that |
| 987 * 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 |
| 988 * 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. |
| 989 * 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 |
| 990 * results. | 1015 * results. |
| 991 * @coverage dart.engine.element | 1016 * @coverage dart.engine.element |
| 992 */ | 1017 */ |
| 993 abstract class MultiplyDefinedElement implements Element { | 1018 abstract class MultiplyDefinedElement implements Element { |
| 994 | 1019 |
| 995 /** | 1020 /** |
| 996 * Return an array containing all of the elements that were defined within the
scope to have the | 1021 * Return an array containing all of the elements that were defined within the
scope to have the |
| 997 * same name. | 1022 * same name. |
| 998 * @return the elements that were defined with the same name | 1023 * @return the elements that were defined with the same name |
| 999 */ | 1024 */ |
| 1000 List<Element> get conflictingElements; | 1025 List<Element> get conflictingElements; |
| 1001 } | 1026 } |
| 1002 /** | 1027 /** |
| 1003 * The interface {@code NamespaceCombinator} defines the behavior common to obje
cts that control how | 1028 * The interface `NamespaceCombinator` defines the behavior common to objects th
at control how |
| 1004 * namespaces are combined. | 1029 * namespaces are combined. |
| 1005 * @coverage dart.engine.element | 1030 * @coverage dart.engine.element |
| 1006 */ | 1031 */ |
| 1007 abstract class NamespaceCombinator { | 1032 abstract class NamespaceCombinator { |
| 1008 | 1033 |
| 1009 /** | 1034 /** |
| 1010 * An empty array of namespace combinators. | 1035 * An empty array of namespace combinators. |
| 1011 */ | 1036 */ |
| 1012 static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombina
tor>(0); | 1037 static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombina
tor>(0); |
| 1013 } | 1038 } |
| 1014 /** | 1039 /** |
| 1015 * The interface {@code ParameterElement} defines the behavior of elements repre
senting a parameter | 1040 * The interface `ParameterElement` defines the behavior of elements representin
g a parameter |
| 1016 * defined within an executable element. | 1041 * defined within an executable element. |
| 1017 * @coverage dart.engine.element | 1042 * @coverage dart.engine.element |
| 1018 */ | 1043 */ |
| 1019 abstract class ParameterElement implements LocalElement, VariableElement { | 1044 abstract class ParameterElement implements LocalElement, VariableElement { |
| 1020 | 1045 |
| 1021 /** | 1046 /** |
| 1022 * Return a source range that covers the portion of the source in which the de
fault value for this | 1047 * Return a source range that covers the portion of the source in which the de
fault value for this |
| 1023 * parameter is specified, or {@code null} if there is no default value. | 1048 * parameter is specified, or `null` if there is no default value. |
| 1024 * @return the range of characters in which the default value of this paramete
r is specified | 1049 * @return the range of characters in which the default value of this paramete
r is specified |
| 1025 */ | 1050 */ |
| 1026 SourceRange get defaultValueRange; | 1051 SourceRange get defaultValueRange; |
| 1027 | 1052 |
| 1028 /** | 1053 /** |
| 1029 * Return the kind of this parameter. | 1054 * Return the kind of this parameter. |
| 1030 * @return the kind of this parameter | 1055 * @return the kind of this parameter |
| 1031 */ | 1056 */ |
| 1032 ParameterKind get parameterKind; | 1057 ParameterKind get parameterKind; |
| 1033 | 1058 |
| 1034 /** | 1059 /** |
| 1035 * 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 |
| 1036 * only define other parameters if it is a function typed parameter. | 1061 * only define other parameters if it is a function typed parameter. |
| 1037 * @return the parameters defined by this parameter element | 1062 * @return the parameters defined by this parameter element |
| 1038 */ | 1063 */ |
| 1039 List<ParameterElement> get parameters; | 1064 List<ParameterElement> get parameters; |
| 1040 | 1065 |
| 1041 /** | 1066 /** |
| 1042 * Return {@code true} if this parameter is an initializing formal parameter. | 1067 * Return `true` if this parameter is an initializing formal parameter. |
| 1043 * @return {@code true} if this parameter is an initializing formal parameter | 1068 * @return `true` if this parameter is an initializing formal parameter |
| 1044 */ | 1069 */ |
| 1045 bool isInitializingFormal(); | 1070 bool isInitializingFormal(); |
| 1046 } | 1071 } |
| 1047 /** | 1072 /** |
| 1048 * The interface {@code PrefixElement} defines the behavior common to elements t
hat represent a | 1073 * The interface `PrefixElement` defines the behavior common to elements that re
present a |
| 1049 * prefix used to import one or more libraries into another library. | 1074 * prefix used to import one or more libraries into another library. |
| 1050 * @coverage dart.engine.element | 1075 * @coverage dart.engine.element |
| 1051 */ | 1076 */ |
| 1052 abstract class PrefixElement implements Element { | 1077 abstract class PrefixElement implements Element { |
| 1053 | 1078 |
| 1054 /** | 1079 /** |
| 1055 * 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. |
| 1056 * @return the library into which other libraries are imported using this pref
ix | 1081 * @return the library into which other libraries are imported using this pref
ix |
| 1057 */ | 1082 */ |
| 1058 LibraryElement get enclosingElement; | 1083 LibraryElement get enclosingElement; |
| 1059 | 1084 |
| 1060 /** | 1085 /** |
| 1061 * Return an array containing all of the libraries that are imported using thi
s prefix. | 1086 * Return an array containing all of the libraries that are imported using thi
s prefix. |
| 1062 * @return the libraries that are imported using this prefix | 1087 * @return the libraries that are imported using this prefix |
| 1063 */ | 1088 */ |
| 1064 List<LibraryElement> get importedLibraries; | 1089 List<LibraryElement> get importedLibraries; |
| 1065 } | 1090 } |
| 1066 /** | 1091 /** |
| 1067 * The interface {@code PropertyAccessorElement} defines the behavior of element
s representing a | 1092 * The interface `PropertyAccessorElement` defines the behavior of elements repr
esenting a |
| 1068 * getter or a setter. Note that explicitly defined property accessors implicitl
y define a synthetic | 1093 * getter or a setter. Note that explicitly defined property accessors implicitl
y define a synthetic |
| 1069 * field. Symmetrically, synthetic accessors are implicitly created for explicit
ly defined fields. | 1094 * field. Symmetrically, synthetic accessors are implicitly created for explicit
ly defined fields. |
| 1070 * The following rules apply: | 1095 * The following rules apply: |
| 1071 * <ul> | 1096 * |
| 1072 * <li>Every explicit field is represented by a non-synthetic {@link FieldElemen
t}. | 1097 * * Every explicit field is represented by a non-synthetic [FieldElement]. |
| 1073 * <li>Every explicit field induces a getter and possibly a setter, both of whic
h are represented by | 1098 * * Every explicit field induces a getter and possibly a setter, both of which
are represented by |
| 1074 * synthetic {@link PropertyAccessorElement}s. | 1099 * synthetic [PropertyAccessorElement]s. |
| 1075 * <li>Every explicit getter or setter is represented by a non-synthetic{@link P
ropertyAccessorElement}. | 1100 * * Every explicit getter or setter is represented by a non-synthetic[PropertyA
ccessorElement]. |
| 1076 * <li>Every explicit getter or setter (or pair thereof if they have the same na
me) induces a field | 1101 * * Every explicit getter or setter (or pair thereof if they have the same name
) induces a field |
| 1077 * that is represented by a synthetic {@link FieldElement}. | 1102 * that is represented by a synthetic [FieldElement]. |
| 1078 * </ul> | 1103 * |
| 1079 * @coverage dart.engine.element | 1104 * @coverage dart.engine.element |
| 1080 */ | 1105 */ |
| 1081 abstract class PropertyAccessorElement implements ExecutableElement { | 1106 abstract class PropertyAccessorElement implements ExecutableElement { |
| 1082 | 1107 |
| 1083 /** | 1108 /** |
| 1084 * Return the accessor representing the getter that corresponds to (has the sa
me name as) this | 1109 * Return the accessor representing the getter that corresponds to (has the sa
me name as) this |
| 1085 * setter, or {@code null} if this accessor is not a setter or if there is no
corresponding | 1110 * setter, or `null` if this accessor is not a setter or if there is no corres
ponding |
| 1086 * getter. | 1111 * getter. |
| 1087 * @return the getter that corresponds to this setter | 1112 * @return the getter that corresponds to this setter |
| 1088 */ | 1113 */ |
| 1089 PropertyAccessorElement get correspondingGetter; | 1114 PropertyAccessorElement get correspondingGetter; |
| 1090 | 1115 |
| 1091 /** | 1116 /** |
| 1092 * Return the accessor representing the setter that corresponds to (has the sa
me name as) this | 1117 * Return the accessor representing the setter that corresponds to (has the sa
me name as) this |
| 1093 * getter, or {@code null} if this accessor is not a getter or if there is no
corresponding | 1118 * getter, or `null` if this accessor is not a getter or if there is no corres
ponding |
| 1094 * setter. | 1119 * setter. |
| 1095 * @return the setter that corresponds to this getter | 1120 * @return the setter that corresponds to this getter |
| 1096 */ | 1121 */ |
| 1097 PropertyAccessorElement get correspondingSetter; | 1122 PropertyAccessorElement get correspondingSetter; |
| 1098 | 1123 |
| 1099 /** | 1124 /** |
| 1100 * Return the field or top-level variable associated with this accessor. If th
is accessor was | 1125 * Return the field or top-level variable associated with this accessor. If th
is accessor was |
| 1101 * 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. |
| 1102 * @return the variable associated with this accessor | 1127 * @return the variable associated with this accessor |
| 1103 */ | 1128 */ |
| 1104 PropertyInducingElement get variable; | 1129 PropertyInducingElement get variable; |
| 1105 | 1130 |
| 1106 /** | 1131 /** |
| 1107 * Return {@code 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 |
| 1108 * external and have no body. | 1133 * external and have no body. |
| 1109 * @return {@code true} if this accessor is abstract | 1134 * @return `true` if this accessor is abstract |
| 1110 */ | 1135 */ |
| 1111 bool isAbstract(); | 1136 bool isAbstract(); |
| 1112 | 1137 |
| 1113 /** | 1138 /** |
| 1114 * Return {@code true} if this accessor represents a getter. | 1139 * Return `true` if this accessor represents a getter. |
| 1115 * @return {@code true} if this accessor represents a getter | 1140 * @return `true` if this accessor represents a getter |
| 1116 */ | 1141 */ |
| 1117 bool isGetter(); | 1142 bool isGetter(); |
| 1118 | 1143 |
| 1119 /** | 1144 /** |
| 1120 * Return {@code true} if this accessor represents a setter. | 1145 * Return `true` if this accessor represents a setter. |
| 1121 * @return {@code true} if this accessor represents a setter | 1146 * @return `true` if this accessor represents a setter |
| 1122 */ | 1147 */ |
| 1123 bool isSetter(); | 1148 bool isSetter(); |
| 1124 } | 1149 } |
| 1125 /** | 1150 /** |
| 1126 * The interface {@code PropertyInducingElement} defines the behavior of element
s representing a | 1151 * The interface `PropertyInducingElement` defines the behavior of elements repr
esenting a |
| 1127 * 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 |
| 1128 * variables implicitly define a synthetic getter and that non-{@code final} exp
licitly defined | 1153 * variables implicitly define a synthetic getter and that non-`final` explicitl
y defined |
| 1129 * 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 |
| 1130 * created for explicitly defined getters and setters. The following rules apply
: | 1155 * created for explicitly defined getters and setters. The following rules apply
: |
| 1131 * <ul> | 1156 * |
| 1132 * <li>Every explicit variable is represented by a non-synthetic {@link Property
InducingElement}. | 1157 * * Every explicit variable is represented by a non-synthetic [PropertyInducing
Element]. |
| 1133 * <li>Every explicit variable induces a getter and possibly a setter, both of w
hich are represented | 1158 * * Every explicit variable induces a getter and possibly a setter, both of whi
ch are represented |
| 1134 * by synthetic {@link PropertyAccessorElement}s. | 1159 * by synthetic [PropertyAccessorElement]s. |
| 1135 * <li>Every explicit getter or setter is represented by a non-synthetic{@link P
ropertyAccessorElement}. | 1160 * * Every explicit getter or setter is represented by a non-synthetic[PropertyA
ccessorElement]. |
| 1136 * <li>Every explicit getter or setter (or pair thereof if they have the same na
me) induces a | 1161 * * Every explicit getter or setter (or pair thereof if they have the same name
) induces a |
| 1137 * variable that is represented by a synthetic {@link PropertyInducingElement}. | 1162 * variable that is represented by a synthetic [PropertyInducingElement]. |
| 1138 * </ul> | 1163 * |
| 1139 * @coverage dart.engine.element | 1164 * @coverage dart.engine.element |
| 1140 */ | 1165 */ |
| 1141 abstract class PropertyInducingElement implements VariableElement { | 1166 abstract class PropertyInducingElement implements VariableElement { |
| 1142 | 1167 |
| 1143 /** | 1168 /** |
| 1144 * Return the getter associated with this variable. If this variable was expli
citly defined (is | 1169 * Return the getter associated with this variable. If this variable was expli
citly defined (is |
| 1145 * not synthetic) then the getter associated with it will be synthetic. | 1170 * not synthetic) then the getter associated with it will be synthetic. |
| 1146 * @return the getter associated with this variable | 1171 * @return the getter associated with this variable |
| 1147 */ | 1172 */ |
| 1148 PropertyAccessorElement get getter; | 1173 PropertyAccessorElement get getter; |
| 1149 | 1174 |
| 1150 /** | 1175 /** |
| 1151 * Return the setter associated with this variable, or {@code null} if the var
iable is effectively{@code final} and therefore does not have a setter associate
d with it. (This can happen either | 1176 * Return the setter associated with this variable, or `null` if the variable
is effectively`final` and therefore does not have a setter associated with it. (
This can happen either |
| 1152 * because the variable is explicitly defined as being {@code final} or becaus
e the variable is | 1177 * because the variable is explicitly defined as being `final` or because the
variable is |
| 1153 * induced by an explicit getter that does not have a corresponding setter.) I
f this variable was | 1178 * induced by an explicit getter that does not have a corresponding setter.) I
f this variable was |
| 1154 * 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. |
| 1155 * @return the setter associated with this variable | 1180 * @return the setter associated with this variable |
| 1156 */ | 1181 */ |
| 1157 PropertyAccessorElement get setter; | 1182 PropertyAccessorElement get setter; |
| 1158 | 1183 |
| 1159 /** | 1184 /** |
| 1160 * Return {@code true} if this element is a static element. A static element i
s an element that is | 1185 * Return `true` if this element is a static element. A static element is an e
lement that is |
| 1161 * 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. |
| 1162 * @return {@code true} if this executable element is a static element | 1187 * @return `true` if this executable element is a static element |
| 1163 */ | 1188 */ |
| 1164 bool isStatic(); | 1189 bool isStatic(); |
| 1165 } | 1190 } |
| 1166 /** | 1191 /** |
| 1167 * The interface {@code ShowElementCombinator} defines the behavior of combinato
rs that cause some | 1192 * The interface `ShowElementCombinator` defines the behavior of combinators tha
t cause some |
| 1168 * 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. |
| 1169 * @coverage dart.engine.element | 1194 * @coverage dart.engine.element |
| 1170 */ | 1195 */ |
| 1171 abstract class ShowElementCombinator implements NamespaceCombinator { | 1196 abstract class ShowElementCombinator implements NamespaceCombinator { |
| 1172 | 1197 |
| 1173 /** | 1198 /** |
| 1174 * 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 |
| 1175 * they are defined in the imported library. | 1200 * they are defined in the imported library. |
| 1176 * @return the names from the imported library that are visible in the importi
ng library | 1201 * @return the names from the imported library that are visible in the importi
ng library |
| 1177 */ | 1202 */ |
| 1178 List<String> get shownNames; | 1203 List<String> get shownNames; |
| 1179 } | 1204 } |
| 1180 /** | 1205 /** |
| 1181 * The interface {@code TopLevelVariableElement} defines the behavior of element
s representing a | 1206 * The interface `TopLevelVariableElement` defines the behavior of elements repr
esenting a |
| 1182 * top-level variable. | 1207 * top-level variable. |
| 1183 * @coverage dart.engine.element | 1208 * @coverage dart.engine.element |
| 1184 */ | 1209 */ |
| 1185 abstract class TopLevelVariableElement implements PropertyInducingElement { | 1210 abstract class TopLevelVariableElement implements PropertyInducingElement { |
| 1186 } | 1211 } |
| 1187 /** | 1212 /** |
| 1188 * The interface {@code TypeVariableElement} defines the behavior of elements re
presenting a type | 1213 * The interface `TypeVariableElement` defines the behavior of elements represen
ting a type |
| 1189 * variable. | 1214 * variable. |
| 1190 * @coverage dart.engine.element | 1215 * @coverage dart.engine.element |
| 1191 */ | 1216 */ |
| 1192 abstract class TypeVariableElement implements Element { | 1217 abstract class TypeVariableElement implements Element { |
| 1193 | 1218 |
| 1194 /** | 1219 /** |
| 1195 * Return the type representing the bound associated with this variable, or {@
code null} if this | 1220 * Return the type representing the bound associated with this variable, or `n
ull` if this |
| 1196 * variable does not have an explicit bound. | 1221 * variable does not have an explicit bound. |
| 1197 * @return the type representing the bound associated with this variable | 1222 * @return the type representing the bound associated with this variable |
| 1198 */ | 1223 */ |
| 1199 Type2 get bound; | 1224 Type2 get bound; |
| 1200 | 1225 |
| 1201 /** | 1226 /** |
| 1202 * Return the type defined by this type variable. | 1227 * Return the type defined by this type variable. |
| 1203 * @return the type defined by this type variable | 1228 * @return the type defined by this type variable |
| 1204 */ | 1229 */ |
| 1205 TypeVariableType get type; | 1230 TypeVariableType get type; |
| 1206 } | 1231 } |
| 1207 /** | 1232 /** |
| 1208 * The interface {@code UndefinedElement} defines the behavior of pseudo-element
s that represent | 1233 * The interface `UndefinedElement` defines the behavior of pseudo-elements that
represent |
| 1209 * names that are undefined. This situation is not allowed by the language, so o
bjects implementing | 1234 * names that are undefined. This situation is not allowed by the language, so o
bjects implementing |
| 1210 * this interface always represent an error. As a result, most of the normal ope
rations on elements | 1235 * this interface always represent an error. As a result, most of the normal ope
rations on elements |
| 1211 * do not make sense and will return useless results. | 1236 * do not make sense and will return useless results. |
| 1212 * @coverage dart.engine.element | 1237 * @coverage dart.engine.element |
| 1213 */ | 1238 */ |
| 1214 abstract class UndefinedElement implements Element { | 1239 abstract class UndefinedElement implements Element { |
| 1215 } | 1240 } |
| 1216 /** | 1241 /** |
| 1217 * The interface {@code UriReferencedElement} defines the behavior of objects in
cluded into a | 1242 * The interface `UriReferencedElement` defines the behavior of objects included
into a |
| 1218 * library using some URI. | 1243 * library using some URI. |
| 1219 * @coverage dart.engine.element | 1244 * @coverage dart.engine.element |
| 1220 */ | 1245 */ |
| 1221 abstract class UriReferencedElement implements Element { | 1246 abstract class UriReferencedElement implements Element { |
| 1222 | 1247 |
| 1223 /** | 1248 /** |
| 1224 * Return the URI that is used to include this element into the enclosing libr
ary, or {@code null}if this is the defining compilation unit of a library. | 1249 * Return the URI that is used to include this element into the enclosing libr
ary, or `null`if this is the defining compilation unit of a library. |
| 1225 * @return the URI that is used to include this element into the enclosing lib
rary | 1250 * @return the URI that is used to include this element into the enclosing lib
rary |
| 1226 */ | 1251 */ |
| 1227 String get uri; | 1252 String get uri; |
| 1228 } | 1253 } |
| 1229 /** | 1254 /** |
| 1230 * The interface {@code VariableElement} defines the behavior common to elements
that represent a | 1255 * The interface `VariableElement` defines the behavior common to elements that
represent a |
| 1231 * variable. | 1256 * variable. |
| 1232 * @coverage dart.engine.element | 1257 * @coverage dart.engine.element |
| 1233 */ | 1258 */ |
| 1234 abstract class VariableElement implements Element { | 1259 abstract class VariableElement implements Element { |
| 1235 | 1260 |
| 1236 /** | 1261 /** |
| 1237 * Return a synthetic function representing this variable's initializer, or {@
code null} if this | 1262 * Return a synthetic function representing this variable's initializer, or `n
ull` if this |
| 1238 * variable does not have an initializer. The function will have no parameters
. The return type of | 1263 * variable does not have an initializer. The function will have no parameters
. The return type of |
| 1239 * the function will be the compile-time type of the initialization expression
. | 1264 * the function will be the compile-time type of the initialization expression
. |
| 1240 * @return a synthetic function representing this variable's initializer | 1265 * @return a synthetic function representing this variable's initializer |
| 1241 */ | 1266 */ |
| 1242 FunctionElement get initializer; | 1267 FunctionElement get initializer; |
| 1243 | 1268 |
| 1244 /** | 1269 /** |
| 1245 * Return the declared type of this variable, or {@code null} if the variable
did not have a | 1270 * Return the declared type of this variable, or `null` if the variable did no
t have a |
| 1246 * 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'). |
| 1247 * @return the declared type of this variable | 1272 * @return the declared type of this variable |
| 1248 */ | 1273 */ |
| 1249 Type2 get type; | 1274 Type2 get type; |
| 1250 | 1275 |
| 1251 /** | 1276 /** |
| 1252 * Return {@code true} if this variable was declared with the 'const' modifier
. | 1277 * Return `true` if this variable was declared with the 'const' modifier. |
| 1253 * @return {@code true} if this variable was declared with the 'const' modifie
r | 1278 * @return `true` if this variable was declared with the 'const' modifier |
| 1254 */ | 1279 */ |
| 1255 bool isConst(); | 1280 bool isConst(); |
| 1256 | 1281 |
| 1257 /** | 1282 /** |
| 1258 * Return {@code true} if this variable was declared with the 'final' modifier
. Variables that are | 1283 * Return `true` if this variable was declared with the 'final' modifier. Vari
ables that are |
| 1259 * declared with the 'const' modifier will return {@code false} even though th
ey are implicitly | 1284 * declared with the 'const' modifier will return `false` even though they are
implicitly |
| 1260 * final. | 1285 * final. |
| 1261 * @return {@code true} if this variable was declared with the 'final' modifie
r | 1286 * @return `true` if this variable was declared with the 'final' modifier |
| 1262 */ | 1287 */ |
| 1263 bool isFinal(); | 1288 bool isFinal(); |
| 1264 } | 1289 } |
| 1265 /** | 1290 /** |
| 1266 * Instances of the class {@code GeneralizingElementVisitor} implement an elemen
t visitor that will | 1291 * Instances of the class `GeneralizingElementVisitor` implement an element visi
tor that will |
| 1267 * recursively visit all of the elements in an element model (like instances of
the class{@link RecursiveElementVisitor}). In addition, when an element of a spe
cific 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 |
| 1268 * 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 |
| 1269 * 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 |
| 1270 * class to visit a {@link MethodElement} will cause the method{@link #visitMeth
odElement(MethodElement)} to be invoked but will also cause the methods{@link #v
isitExecutableElement(ExecutableElement)} and {@link #visitElement(Element)} 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 |
| 1271 * 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 |
| 1272 * without needing to override the visit method for each of the specific subclas
ses of{@link ExecutableElement}. | 1297 * without needing to override the visit method for each of the specific subclas
ses of[ExecutableElement]. |
| 1273 * <p> | 1298 * |
| 1274 * Note, however, that unlike many visitors, element visitors visit objects base
d on the interfaces | 1299 * Note, however, that unlike many visitors, element visitors visit objects base
d on the interfaces |
| 1275 * implemented by those elements. Because interfaces form a graph structure rath
er than a tree | 1300 * implemented by those elements. Because interfaces form a graph structure rath
er than a tree |
| 1276 * structure the way classes do, and because it is generally undesirable for an
object to be visited | 1301 * structure the way classes do, and because it is generally undesirable for an
object to be visited |
| 1277 * more than once, this class flattens the interface graph into a pseudo-tree. I
n particular, this | 1302 * more than once, this class flattens the interface graph into a pseudo-tree. I
n particular, this |
| 1278 * class treats elements as if the element types were structured in the followin
g way: | 1303 * class treats elements as if the element types were structured in the followin
g way: |
| 1279 * <p> | 1304 * |
| 1280 * <pre> | 1305 * <pre> |
| 1281 * Element | 1306 * Element |
| 1282 * ClassElement | 1307 * ClassElement |
| 1283 * CompilationUnitElement | 1308 * CompilationUnitElement |
| 1284 * ExecutableElement | 1309 * ExecutableElement |
| 1285 * ConstructorElement | 1310 * ConstructorElement |
| 1286 * LocalElement | 1311 * LocalElement |
| 1287 * FunctionElement | 1312 * FunctionElement |
| 1288 * MethodElement | 1313 * MethodElement |
| 1289 * PropertyAccessorElement | 1314 * PropertyAccessorElement |
| 1290 * ExportElement | 1315 * ExportElement |
| 1291 * HtmlElement | 1316 * HtmlElement |
| 1292 * ImportElement | 1317 * ImportElement |
| 1293 * LabelElement | 1318 * LabelElement |
| 1294 * LibraryElement | 1319 * LibraryElement |
| 1295 * MultiplyDefinedElement | 1320 * MultiplyDefinedElement |
| 1296 * PrefixElement | 1321 * PrefixElement |
| 1297 * TypeAliasElement | 1322 * TypeAliasElement |
| 1298 * TypeVariableElement | 1323 * TypeVariableElement |
| 1299 * UndefinedElement | 1324 * UndefinedElement |
| 1300 * VariableElement | 1325 * VariableElement |
| 1301 * PropertyInducingElement | 1326 * PropertyInducingElement |
| 1302 * FieldElement | 1327 * FieldElement |
| 1303 * TopLevelVariableElement | 1328 * TopLevelVariableElement |
| 1304 * LocalElement | 1329 * LocalElement |
| 1305 * LocalVariableElement | 1330 * LocalVariableElement |
| 1306 * ParameterElement | 1331 * ParameterElement |
| 1307 * FieldFormalParameterElement | 1332 * FieldFormalParameterElement |
| 1308 * </pre> | 1333 * </pre> |
| 1309 * <p> | 1334 * |
| 1310 * Subclasses that override a visit method must either invoke the overridden vis
it method or | 1335 * Subclasses that override a visit method must either invoke the overridden vis
it method or |
| 1311 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods | 1336 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods |
| 1312 * for superclasses of the element to not be invoked and will cause the children
of the visited node | 1337 * for superclasses of the element to not be invoked and will cause the children
of the visited node |
| 1313 * to not be visited. | 1338 * to not be visited. |
| 1314 * @coverage dart.engine.element | 1339 * @coverage dart.engine.element |
| 1315 */ | 1340 */ |
| 1316 class GeneralizingElementVisitor<R> implements ElementVisitor<R> { | 1341 class GeneralizingElementVisitor<R> implements ElementVisitor<R> { |
| 1317 R visitClassElement(ClassElement element) => visitElement(element); | 1342 R visitClassElement(ClassElement element) => visitElement(element); |
| 1318 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement(
element); | 1343 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement(
element); |
| 1319 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen
t(element); | 1344 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen
t(element); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1349 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement(
element); | 1374 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement(
element); |
| 1350 R visitParameterElement(ParameterElement element) => visitLocalElement(element
); | 1375 R visitParameterElement(ParameterElement element) => visitLocalElement(element
); |
| 1351 R visitPrefixElement(PrefixElement element) => visitElement(element); | 1376 R visitPrefixElement(PrefixElement element) => visitElement(element); |
| 1352 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut
ableElement(element); | 1377 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut
ableElement(element); |
| 1353 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab
leElement(element); | 1378 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab
leElement(element); |
| 1354 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper
tyInducingElement(element); | 1379 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper
tyInducingElement(element); |
| 1355 R visitTypeVariableElement(TypeVariableElement element) => visitElement(elemen
t); | 1380 R visitTypeVariableElement(TypeVariableElement element) => visitElement(elemen
t); |
| 1356 R visitVariableElement(VariableElement element) => visitElement(element); | 1381 R visitVariableElement(VariableElement element) => visitElement(element); |
| 1357 } | 1382 } |
| 1358 /** | 1383 /** |
| 1359 * Instances of the class {@code RecursiveElementVisitor} implement an element v
isitor that will | 1384 * Instances of the class `RecursiveElementVisitor` implement an element visitor
that will |
| 1360 * recursively visit all of the element in an element model. For example, using
an instance of this | 1385 * recursively visit all of the element in an element model. For example, using
an instance of this |
| 1361 * class to visit a {@link CompilationUnitElement} will also cause all of the ty
pes in the | 1386 * class to visit a [CompilationUnitElement] will also cause all of the types in
the |
| 1362 * compilation unit to be visited. | 1387 * compilation unit to be visited. |
| 1363 * <p> | 1388 * |
| 1364 * Subclasses that override a visit method must either invoke the overridden vis
it method or must | 1389 * Subclasses that override a visit method must either invoke the overridden vis
it method or must |
| 1365 * explicitly ask the visited element to visit its children. Failure to do so wi
ll cause the | 1390 * explicitly ask the visited element to visit its children. Failure to do so wi
ll cause the |
| 1366 * children of the visited element to not be visited. | 1391 * children of the visited element to not be visited. |
| 1367 * @coverage dart.engine.element | 1392 * @coverage dart.engine.element |
| 1368 */ | 1393 */ |
| 1369 class RecursiveElementVisitor<R> implements ElementVisitor<R> { | 1394 class RecursiveElementVisitor<R> implements ElementVisitor<R> { |
| 1370 R visitClassElement(ClassElement element) { | 1395 R visitClassElement(ClassElement element) { |
| 1371 element.visitChildren(this); | 1396 element.visitChildren(this); |
| 1372 return null; | 1397 return null; |
| 1373 } | 1398 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 R visitTopLevelVariableElement(TopLevelVariableElement element) { | 1475 R visitTopLevelVariableElement(TopLevelVariableElement element) { |
| 1451 element.visitChildren(this); | 1476 element.visitChildren(this); |
| 1452 return null; | 1477 return null; |
| 1453 } | 1478 } |
| 1454 R visitTypeVariableElement(TypeVariableElement element) { | 1479 R visitTypeVariableElement(TypeVariableElement element) { |
| 1455 element.visitChildren(this); | 1480 element.visitChildren(this); |
| 1456 return null; | 1481 return null; |
| 1457 } | 1482 } |
| 1458 } | 1483 } |
| 1459 /** | 1484 /** |
| 1460 * Instances of the class {@code SimpleElementVisitor} implement an element visi
tor that will do | 1485 * Instances of the class `SimpleElementVisitor` implement an element visitor th
at will do |
| 1461 * nothing when visiting an element. It is intended to be a superclass for class
es that use the | 1486 * nothing when visiting an element. It is intended to be a superclass for class
es that use the |
| 1462 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re
cursively visit a | 1487 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re
cursively visit a |
| 1463 * whole structure) and that only need to visit a small number of element types. | 1488 * whole structure) and that only need to visit a small number of element types. |
| 1464 * @coverage dart.engine.element | 1489 * @coverage dart.engine.element |
| 1465 */ | 1490 */ |
| 1466 class SimpleElementVisitor<R> implements ElementVisitor<R> { | 1491 class SimpleElementVisitor<R> implements ElementVisitor<R> { |
| 1467 R visitClassElement(ClassElement element) => null; | 1492 R visitClassElement(ClassElement element) => null; |
| 1468 R visitCompilationUnitElement(CompilationUnitElement element) => null; | 1493 R visitCompilationUnitElement(CompilationUnitElement element) => null; |
| 1469 R visitConstructorElement(ConstructorElement element) => null; | 1494 R visitConstructorElement(ConstructorElement element) => null; |
| 1470 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null; | 1495 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1481 R visitLocalVariableElement(LocalVariableElement element) => null; | 1506 R visitLocalVariableElement(LocalVariableElement element) => null; |
| 1482 R visitMethodElement(MethodElement element) => null; | 1507 R visitMethodElement(MethodElement element) => null; |
| 1483 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; | 1508 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; |
| 1484 R visitParameterElement(ParameterElement element) => null; | 1509 R visitParameterElement(ParameterElement element) => null; |
| 1485 R visitPrefixElement(PrefixElement element) => null; | 1510 R visitPrefixElement(PrefixElement element) => null; |
| 1486 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; | 1511 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; |
| 1487 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; | 1512 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; |
| 1488 R visitTypeVariableElement(TypeVariableElement element) => null; | 1513 R visitTypeVariableElement(TypeVariableElement element) => null; |
| 1489 } | 1514 } |
| 1490 /** | 1515 /** |
| 1491 * Instances of the class {@code ClassElementImpl} implement a {@code ClassEleme
nt}. | 1516 * Instances of the class `ClassElementImpl` implement a `ClassElement`. |
| 1492 * @coverage dart.engine.element | 1517 * @coverage dart.engine.element |
| 1493 */ | 1518 */ |
| 1494 class ClassElementImpl extends ElementImpl implements ClassElement { | 1519 class ClassElementImpl extends ElementImpl implements ClassElement { |
| 1495 | 1520 |
| 1496 /** | 1521 /** |
| 1497 * An array containing all of the accessors (getters and setters) contained in
this class. | 1522 * An array containing all of the accessors (getters and setters) contained in
this class. |
| 1498 */ | 1523 */ |
| 1499 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; | 1524 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; |
| 1500 | 1525 |
| 1501 /** | 1526 /** |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1518 * An array containing all of the interfaces that are implemented by this clas
s. | 1543 * An array containing all of the interfaces that are implemented by this clas
s. |
| 1519 */ | 1544 */ |
| 1520 List<InterfaceType> _interfaces = InterfaceTypeImpl.EMPTY_ARRAY; | 1545 List<InterfaceType> _interfaces = InterfaceTypeImpl.EMPTY_ARRAY; |
| 1521 | 1546 |
| 1522 /** | 1547 /** |
| 1523 * An array containing all of the methods contained in this class. | 1548 * An array containing all of the methods contained in this class. |
| 1524 */ | 1549 */ |
| 1525 List<MethodElement> _methods = MethodElementImpl.EMPTY_ARRAY; | 1550 List<MethodElement> _methods = MethodElementImpl.EMPTY_ARRAY; |
| 1526 | 1551 |
| 1527 /** | 1552 /** |
| 1528 * The superclass of the class, or {@code null} if the class does not have an
explicit superclass. | 1553 * The superclass of the class, or `null` if the class does not have an explic
it superclass. |
| 1529 */ | 1554 */ |
| 1530 InterfaceType _supertype; | 1555 InterfaceType _supertype; |
| 1531 | 1556 |
| 1532 /** | 1557 /** |
| 1533 * The type defined by the class. | 1558 * The type defined by the class. |
| 1534 */ | 1559 */ |
| 1535 InterfaceType _type; | 1560 InterfaceType _type; |
| 1536 | 1561 |
| 1537 /** | 1562 /** |
| 1538 * An array containing all of the type variables defined for this class. | 1563 * An array containing all of the type variables defined for this class. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 for (TypeVariableElement typeVariable in _typeVariables) { | 1606 for (TypeVariableElement typeVariable in _typeVariables) { |
| 1582 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2)
{ | 1607 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2)
{ |
| 1583 return typeVariable as TypeVariableElementImpl; | 1608 return typeVariable as TypeVariableElementImpl; |
| 1584 } | 1609 } |
| 1585 } | 1610 } |
| 1586 return null; | 1611 return null; |
| 1587 } | 1612 } |
| 1588 List<ConstructorElement> get constructors => _constructors; | 1613 List<ConstructorElement> get constructors => _constructors; |
| 1589 | 1614 |
| 1590 /** | 1615 /** |
| 1591 * Given some name, this returns the {@link FieldElement} with the matching na
me, if there is no | 1616 * Given some name, this returns the [FieldElement] with the matching name, if
there is no |
| 1592 * such field, then {@code null} is returned. | 1617 * such field, then `null` is returned. |
| 1593 * @param name some name to lookup a field element with | 1618 * @param name some name to lookup a field element with |
| 1594 * @return the matching field element, or {@code null} if no such element was
found | 1619 * @return the matching field element, or `null` if no such element was found |
| 1595 */ | 1620 */ |
| 1596 FieldElement getField(String name2) { | 1621 FieldElement getField(String name2) { |
| 1597 for (FieldElement fieldElement in _fields) { | 1622 for (FieldElement fieldElement in _fields) { |
| 1598 if (name2 == fieldElement.name) { | 1623 if (name2 == fieldElement.name) { |
| 1599 return fieldElement; | 1624 return fieldElement; |
| 1600 } | 1625 } |
| 1601 } | 1626 } |
| 1602 return null; | 1627 return null; |
| 1603 } | 1628 } |
| 1604 List<FieldElement> get fields => _fields; | 1629 List<FieldElement> get fields => _fields; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 List<TypeVariableElement> get typeVariables => _typeVariables; | 1672 List<TypeVariableElement> get typeVariables => _typeVariables; |
| 1648 ConstructorElement get unnamedConstructor { | 1673 ConstructorElement get unnamedConstructor { |
| 1649 for (ConstructorElement element in constructors) { | 1674 for (ConstructorElement element in constructors) { |
| 1650 String name = element.displayName; | 1675 String name = element.displayName; |
| 1651 if (name == null || name.isEmpty) { | 1676 if (name == null || name.isEmpty) { |
| 1652 return element; | 1677 return element; |
| 1653 } | 1678 } |
| 1654 } | 1679 } |
| 1655 return null; | 1680 return null; |
| 1656 } | 1681 } |
| 1682 bool hasDefaultConstructor() { |
| 1683 for (ConstructorElement constructor in constructors) { |
| 1684 if (constructor.isDefaultConstructor()) { |
| 1685 return true; |
| 1686 } |
| 1687 } |
| 1688 return false; |
| 1689 } |
| 1657 bool hasNonFinalField() { | 1690 bool hasNonFinalField() { |
| 1658 List<ClassElement> classesToVisit = new List<ClassElement>(); | 1691 List<ClassElement> classesToVisit = new List<ClassElement>(); |
| 1659 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 1692 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 1660 classesToVisit.add(this); | 1693 classesToVisit.add(this); |
| 1661 while (!classesToVisit.isEmpty) { | 1694 while (!classesToVisit.isEmpty) { |
| 1662 ClassElement currentElement = classesToVisit.removeAt(0); | 1695 ClassElement currentElement = classesToVisit.removeAt(0); |
| 1663 if (javaSetAdd(visitedClasses, currentElement)) { | 1696 if (javaSetAdd(visitedClasses, currentElement)) { |
| 1664 for (FieldElement field in currentElement.fields) { | 1697 for (FieldElement field in currentElement.fields) { |
| 1665 if (!field.isFinal() && !field.isConst() && !field.isStatic() && !fiel
d.isSynthetic()) { | 1698 if (!field.isFinal() && !field.isConst() && !field.isStatic() && !fiel
d.isSynthetic()) { |
| 1666 return true; | 1699 return true; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 if (supertype == null) { | 1792 if (supertype == null) { |
| 1760 return null; | 1793 return null; |
| 1761 } | 1794 } |
| 1762 currentElement = supertype.element; | 1795 currentElement = supertype.element; |
| 1763 } | 1796 } |
| 1764 return null; | 1797 return null; |
| 1765 } | 1798 } |
| 1766 | 1799 |
| 1767 /** | 1800 /** |
| 1768 * Set whether this class is abstract to correspond to the given value. | 1801 * Set whether this class is abstract to correspond to the given value. |
| 1769 * @param isAbstract {@code true} if the class is abstract | 1802 * @param isAbstract `true` if the class is abstract |
| 1770 */ | 1803 */ |
| 1771 void set abstract(bool isAbstract) { | 1804 void set abstract(bool isAbstract) { |
| 1772 setModifier(Modifier.ABSTRACT, isAbstract); | 1805 setModifier(Modifier.ABSTRACT, isAbstract); |
| 1773 } | 1806 } |
| 1774 | 1807 |
| 1775 /** | 1808 /** |
| 1776 * Set the accessors contained in this class to the given accessors. | 1809 * Set the accessors contained in this class to the given accessors. |
| 1777 * @param accessors the accessors contained in this class | 1810 * @param accessors the accessors contained in this class |
| 1778 */ | 1811 */ |
| 1779 void set accessors(List<PropertyAccessorElement> accessors2) { | 1812 void set accessors(List<PropertyAccessorElement> accessors2) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1800 */ | 1833 */ |
| 1801 void set fields(List<FieldElement> fields2) { | 1834 void set fields(List<FieldElement> fields2) { |
| 1802 for (FieldElement field in fields2) { | 1835 for (FieldElement field in fields2) { |
| 1803 ((field as FieldElementImpl)).enclosingElement = this; | 1836 ((field as FieldElementImpl)).enclosingElement = this; |
| 1804 } | 1837 } |
| 1805 this._fields = fields2; | 1838 this._fields = fields2; |
| 1806 } | 1839 } |
| 1807 | 1840 |
| 1808 /** | 1841 /** |
| 1809 * Set whether this class references 'super' to the given value. | 1842 * Set whether this class references 'super' to the given value. |
| 1810 * @param isReferencedSuper {@code true} references 'super' | 1843 * @param isReferencedSuper `true` references 'super' |
| 1811 */ | 1844 */ |
| 1812 void set hasReferenceToSuper2(bool isReferencedSuper) { | 1845 void set hasReferenceToSuper2(bool isReferencedSuper) { |
| 1813 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper); | 1846 setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper); |
| 1814 } | 1847 } |
| 1815 | 1848 |
| 1816 /** | 1849 /** |
| 1817 * Set the interfaces that are implemented by this class to the given types. | 1850 * Set the interfaces that are implemented by this class to the given types. |
| 1818 * @param the interfaces that are implemented by this class | 1851 * @param the interfaces that are implemented by this class |
| 1819 */ | 1852 */ |
| 1820 void set interfaces(List<InterfaceType> interfaces2) { | 1853 void set interfaces(List<InterfaceType> interfaces2) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 /** | 1885 /** |
| 1853 * Set the type defined by the class to the given type. | 1886 * Set the type defined by the class to the given type. |
| 1854 * @param type the type defined by the class | 1887 * @param type the type defined by the class |
| 1855 */ | 1888 */ |
| 1856 void set type(InterfaceType type2) { | 1889 void set type(InterfaceType type2) { |
| 1857 this._type = type2; | 1890 this._type = type2; |
| 1858 } | 1891 } |
| 1859 | 1892 |
| 1860 /** | 1893 /** |
| 1861 * Set whether this class is defined by a typedef construct to correspond to t
he given value. | 1894 * Set whether this class is defined by a typedef construct to correspond to t
he given value. |
| 1862 * @param isTypedef {@code true} if the class is defined by a typedef construc
t | 1895 * @param isTypedef `true` if the class is defined by a typedef construct |
| 1863 */ | 1896 */ |
| 1864 void set typedef(bool isTypedef) { | 1897 void set typedef(bool isTypedef) { |
| 1865 setModifier(Modifier.TYPEDEF, isTypedef); | 1898 setModifier(Modifier.TYPEDEF, isTypedef); |
| 1866 } | 1899 } |
| 1867 | 1900 |
| 1868 /** | 1901 /** |
| 1869 * Set the type variables defined for this class to the given type variables. | 1902 * Set the type variables defined for this class to the given type variables. |
| 1870 * @param typeVariables the type variables defined for this class | 1903 * @param typeVariables the type variables defined for this class |
| 1871 */ | 1904 */ |
| 1872 void set typeVariables(List<TypeVariableElement> typeVariables2) { | 1905 void set typeVariables(List<TypeVariableElement> typeVariables2) { |
| 1873 for (TypeVariableElement typeVariable in typeVariables2) { | 1906 for (TypeVariableElement typeVariable in typeVariables2) { |
| 1874 ((typeVariable as TypeVariableElementImpl)).enclosingElement = this; | 1907 ((typeVariable as TypeVariableElementImpl)).enclosingElement = this; |
| 1875 } | 1908 } |
| 1876 this._typeVariables = typeVariables2; | 1909 this._typeVariables = typeVariables2; |
| 1877 } | 1910 } |
| 1878 | 1911 |
| 1879 /** | 1912 /** |
| 1880 * Set whether this class is a valid mixin to correspond to the given value. | 1913 * Set whether this class is a valid mixin to correspond to the given value. |
| 1881 * @param isValidMixin {@code true} if this class can be used as a mixin | 1914 * @param isValidMixin `true` if this class can be used as a mixin |
| 1882 */ | 1915 */ |
| 1883 void set validMixin(bool isValidMixin) { | 1916 void set validMixin(bool isValidMixin) { |
| 1884 setModifier(Modifier.MIXIN, isValidMixin); | 1917 setModifier(Modifier.MIXIN, isValidMixin); |
| 1885 } | 1918 } |
| 1886 void visitChildren(ElementVisitor<Object> visitor) { | 1919 void visitChildren(ElementVisitor<Object> visitor) { |
| 1887 super.visitChildren(visitor); | 1920 super.visitChildren(visitor); |
| 1888 safelyVisitChildren(_accessors, visitor); | 1921 safelyVisitChildren(_accessors, visitor); |
| 1889 safelyVisitChildren(_constructors, visitor); | 1922 safelyVisitChildren(_constructors, visitor); |
| 1890 safelyVisitChildren(_fields, visitor); | 1923 safelyVisitChildren(_fields, visitor); |
| 1891 safelyVisitChildren(_methods, visitor); | 1924 safelyVisitChildren(_methods, visitor); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 ClassElement element = type.element; | 1966 ClassElement element = type.element; |
| 1934 if (!visitedClasses.contains(element)) { | 1967 if (!visitedClasses.contains(element)) { |
| 1935 supertypes.add(type); | 1968 supertypes.add(type); |
| 1936 } | 1969 } |
| 1937 } | 1970 } |
| 1938 } | 1971 } |
| 1939 } | 1972 } |
| 1940 } | 1973 } |
| 1941 } | 1974 } |
| 1942 /** | 1975 /** |
| 1943 * Instances of the class {@code CompilationUnitElementImpl} implement a{@link C
ompilationUnitElement}. | 1976 * Instances of the class `CompilationUnitElementImpl` implement a[CompilationUn
itElement]. |
| 1944 * @coverage dart.engine.element | 1977 * @coverage dart.engine.element |
| 1945 */ | 1978 */ |
| 1946 class CompilationUnitElementImpl extends ElementImpl implements CompilationUnitE
lement { | 1979 class CompilationUnitElementImpl extends ElementImpl implements CompilationUnitE
lement { |
| 1947 | 1980 |
| 1948 /** | 1981 /** |
| 1949 * An empty array of compilation unit elements. | 1982 * An empty array of compilation unit elements. |
| 1950 */ | 1983 */ |
| 1951 static List<CompilationUnitElement> EMPTY_ARRAY = new List<CompilationUnitElem
ent>(0); | 1984 static List<CompilationUnitElement> EMPTY_ARRAY = new List<CompilationUnitElem
ent>(0); |
| 1952 | 1985 |
| 1953 /** | 1986 /** |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1975 * An array containing all of the function type aliases contained in this comp
ilation unit. | 2008 * An array containing all of the function type aliases contained in this comp
ilation unit. |
| 1976 */ | 2009 */ |
| 1977 List<FunctionTypeAliasElement> _typeAliases = FunctionTypeAliasElementImpl.EMP
TY_ARRAY; | 2010 List<FunctionTypeAliasElement> _typeAliases = FunctionTypeAliasElementImpl.EMP
TY_ARRAY; |
| 1978 | 2011 |
| 1979 /** | 2012 /** |
| 1980 * An array containing all of the types contained in this compilation unit. | 2013 * An array containing all of the types contained in this compilation unit. |
| 1981 */ | 2014 */ |
| 1982 List<ClassElement> _types = ClassElementImpl.EMPTY_ARRAY; | 2015 List<ClassElement> _types = ClassElementImpl.EMPTY_ARRAY; |
| 1983 | 2016 |
| 1984 /** | 2017 /** |
| 1985 * The URI that is specified by the "part" directive in the enclosing library,
or {@code null} if | 2018 * The URI that is specified by the "part" directive in the enclosing library,
or `null` if |
| 1986 * this is the defining compilation unit of a library. | 2019 * this is the defining compilation unit of a library. |
| 1987 */ | 2020 */ |
| 1988 String _uri; | 2021 String _uri; |
| 1989 | 2022 |
| 1990 /** | 2023 /** |
| 1991 * Initialize a newly created compilation unit element to have the given name. | 2024 * Initialize a newly created compilation unit element to have the given name. |
| 1992 * @param name the name of this element | 2025 * @param name the name of this element |
| 1993 */ | 2026 */ |
| 1994 CompilationUnitElementImpl(String name) : super.con2(name, -1) { | 2027 CompilationUnitElementImpl(String name) : super.con2(name, -1) { |
| 1995 } | 2028 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 } | 2157 } |
| 2125 void appendTo(JavaStringBuilder builder) { | 2158 void appendTo(JavaStringBuilder builder) { |
| 2126 if (_source == null) { | 2159 if (_source == null) { |
| 2127 builder.append("{compilation unit}"); | 2160 builder.append("{compilation unit}"); |
| 2128 } else { | 2161 } else { |
| 2129 builder.append(_source.fullName); | 2162 builder.append(_source.fullName); |
| 2130 } | 2163 } |
| 2131 } | 2164 } |
| 2132 } | 2165 } |
| 2133 /** | 2166 /** |
| 2134 * Instances of the class {@code ConstFieldElementImpl} implement a {@code Field
Element} for a | 2167 * Instances of the class `ConstFieldElementImpl` implement a `FieldElement` for
a |
| 2135 * 'const' field that has an initializer. | 2168 * 'const' field that has an initializer. |
| 2136 */ | 2169 */ |
| 2137 class ConstFieldElementImpl extends FieldElementImpl { | 2170 class ConstFieldElementImpl extends FieldElementImpl { |
| 2138 | 2171 |
| 2139 /** | 2172 /** |
| 2140 * The result of evaluating this variable's initializer. | 2173 * The result of evaluating this variable's initializer. |
| 2141 */ | 2174 */ |
| 2142 EvaluationResultImpl _result; | 2175 EvaluationResultImpl _result; |
| 2143 | 2176 |
| 2144 /** | 2177 /** |
| 2145 * Initialize a newly created field element to have the given name. | 2178 * Initialize a newly created field element to have the given name. |
| 2146 * @param name the name of this element | 2179 * @param name the name of this element |
| 2147 */ | 2180 */ |
| 2148 ConstFieldElementImpl(Identifier name) : super.con1(name) { | 2181 ConstFieldElementImpl(Identifier name) : super.con1(name) { |
| 2149 } | 2182 } |
| 2150 EvaluationResultImpl get evaluationResult => _result; | 2183 EvaluationResultImpl get evaluationResult => _result; |
| 2151 void set evaluationResult(EvaluationResultImpl result2) { | 2184 void set evaluationResult(EvaluationResultImpl result2) { |
| 2152 this._result = result2; | 2185 this._result = result2; |
| 2153 } | 2186 } |
| 2154 } | 2187 } |
| 2155 /** | 2188 /** |
| 2156 * Instances of the class {@code ConstLocalVariableElementImpl} implement a{@cod
e LocalVariableElement} for a local 'const' variable that has an initializer. | 2189 * Instances of the class `ConstLocalVariableElementImpl` implement a`LocalVaria
bleElement` for a local 'const' variable that has an initializer. |
| 2157 * @coverage dart.engine.element | 2190 * @coverage dart.engine.element |
| 2158 */ | 2191 */ |
| 2159 class ConstLocalVariableElementImpl extends LocalVariableElementImpl { | 2192 class ConstLocalVariableElementImpl extends LocalVariableElementImpl { |
| 2160 | 2193 |
| 2161 /** | 2194 /** |
| 2162 * The result of evaluating this variable's initializer. | 2195 * The result of evaluating this variable's initializer. |
| 2163 */ | 2196 */ |
| 2164 EvaluationResultImpl _result; | 2197 EvaluationResultImpl _result; |
| 2165 | 2198 |
| 2166 /** | 2199 /** |
| 2167 * Initialize a newly created local variable element to have the given name. | 2200 * Initialize a newly created local variable element to have the given name. |
| 2168 * @param name the name of this element | 2201 * @param name the name of this element |
| 2169 */ | 2202 */ |
| 2170 ConstLocalVariableElementImpl(Identifier name) : super(name) { | 2203 ConstLocalVariableElementImpl(Identifier name) : super(name) { |
| 2171 } | 2204 } |
| 2172 EvaluationResultImpl get evaluationResult => _result; | 2205 EvaluationResultImpl get evaluationResult => _result; |
| 2173 void set evaluationResult(EvaluationResultImpl result2) { | 2206 void set evaluationResult(EvaluationResultImpl result2) { |
| 2174 this._result = result2; | 2207 this._result = result2; |
| 2175 } | 2208 } |
| 2176 } | 2209 } |
| 2177 /** | 2210 /** |
| 2178 * Instances of the class {@code ConstParameterElementImpl} implement a {@code P
arameterElement} for | 2211 * Instances of the class `ConstTopLevelVariableElementImpl` implement a`TopLeve
lVariableElement` for a top-level 'const' variable that has an initializer. |
| 2179 * a 'const' parameter that has an initializer. | |
| 2180 * @coverage dart.engine.element | |
| 2181 */ | |
| 2182 class ConstParameterElementImpl extends ParameterElementImpl { | |
| 2183 | |
| 2184 /** | |
| 2185 * The result of evaluating this variable's initializer. | |
| 2186 */ | |
| 2187 EvaluationResultImpl _result; | |
| 2188 | |
| 2189 /** | |
| 2190 * Initialize a newly created parameter element to have the given name. | |
| 2191 * @param name the name of this element | |
| 2192 */ | |
| 2193 ConstParameterElementImpl(Identifier name) : super(name) { | |
| 2194 } | |
| 2195 EvaluationResultImpl get evaluationResult => _result; | |
| 2196 void set evaluationResult(EvaluationResultImpl result2) { | |
| 2197 this._result = result2; | |
| 2198 } | |
| 2199 } | |
| 2200 /** | |
| 2201 * Instances of the class {@code ConstTopLevelVariableElementImpl} implement a{@
code TopLevelVariableElement} for a top-level 'const' variable that has an initi
alizer. | |
| 2202 */ | 2212 */ |
| 2203 class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl { | 2213 class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl { |
| 2204 | 2214 |
| 2205 /** | 2215 /** |
| 2206 * The result of evaluating this variable's initializer. | 2216 * The result of evaluating this variable's initializer. |
| 2207 */ | 2217 */ |
| 2208 EvaluationResultImpl _result; | 2218 EvaluationResultImpl _result; |
| 2209 | 2219 |
| 2210 /** | 2220 /** |
| 2211 * Initialize a newly created top-level variable element to have the given nam
e. | 2221 * Initialize a newly created top-level variable element to have the given nam
e. |
| 2212 * @param name the name of this element | 2222 * @param name the name of this element |
| 2213 */ | 2223 */ |
| 2214 ConstTopLevelVariableElementImpl(Identifier name) : super.con1(name) { | 2224 ConstTopLevelVariableElementImpl(Identifier name) : super.con1(name) { |
| 2215 } | 2225 } |
| 2216 EvaluationResultImpl get evaluationResult => _result; | 2226 EvaluationResultImpl get evaluationResult => _result; |
| 2217 void set evaluationResult(EvaluationResultImpl result2) { | 2227 void set evaluationResult(EvaluationResultImpl result2) { |
| 2218 this._result = result2; | 2228 this._result = result2; |
| 2219 } | 2229 } |
| 2220 } | 2230 } |
| 2221 /** | 2231 /** |
| 2222 * Instances of the class {@code ConstructorElementImpl} implement a {@code Cons
tructorElement}. | 2232 * Instances of the class `ConstructorElementImpl` implement a `ConstructorEleme
nt`. |
| 2223 * @coverage dart.engine.element | 2233 * @coverage dart.engine.element |
| 2224 */ | 2234 */ |
| 2225 class ConstructorElementImpl extends ExecutableElementImpl implements Constructo
rElement { | 2235 class ConstructorElementImpl extends ExecutableElementImpl implements Constructo
rElement { |
| 2226 | 2236 |
| 2227 /** | 2237 /** |
| 2228 * An empty array of constructor elements. | 2238 * An empty array of constructor elements. |
| 2229 */ | 2239 */ |
| 2230 static List<ConstructorElement> EMPTY_ARRAY = new List<ConstructorElement>(0); | 2240 static List<ConstructorElement> EMPTY_ARRAY = new List<ConstructorElement>(0); |
| 2231 | 2241 |
| 2232 /** | 2242 /** |
| 2233 * The constructor to which this constructor is redirecting. | 2243 * The constructor to which this constructor is redirecting. |
| 2234 */ | 2244 */ |
| 2235 ConstructorElement _redirectedConstructor; | 2245 ConstructorElement _redirectedConstructor; |
| 2236 | 2246 |
| 2237 /** | 2247 /** |
| 2238 * Initialize a newly created constructor element to have the given name. | 2248 * Initialize a newly created constructor element to have the given name. |
| 2239 * @param name the name of this element | 2249 * @param name the name of this element |
| 2240 */ | 2250 */ |
| 2241 ConstructorElementImpl(Identifier name) : super.con1(name) { | 2251 ConstructorElementImpl(Identifier name) : super.con1(name) { |
| 2242 } | 2252 } |
| 2243 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 2253 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 2244 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 2254 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 2245 ElementKind get kind => ElementKind.CONSTRUCTOR; | 2255 ElementKind get kind => ElementKind.CONSTRUCTOR; |
| 2246 ConstructorElement get redirectedConstructor => _redirectedConstructor; | 2256 ConstructorElement get redirectedConstructor => _redirectedConstructor; |
| 2247 bool isConst() => hasModifier(Modifier.CONST); | 2257 bool isConst() => hasModifier(Modifier.CONST); |
| 2258 bool isDefaultConstructor() { |
| 2259 String name = this.name; |
| 2260 if (name != null && name.length != 0) { |
| 2261 return false; |
| 2262 } |
| 2263 for (ParameterElement parameter in parameters) { |
| 2264 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { |
| 2265 return false; |
| 2266 } |
| 2267 } |
| 2268 return true; |
| 2269 } |
| 2248 bool isFactory() => hasModifier(Modifier.FACTORY); | 2270 bool isFactory() => hasModifier(Modifier.FACTORY); |
| 2249 bool isStatic() => false; | 2271 bool isStatic() => false; |
| 2250 | 2272 |
| 2251 /** | 2273 /** |
| 2252 * 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. |
| 2253 * @param isConst {@code true} if this constructor represents a 'const' constr
uctor | 2275 * @param isConst `true` if this constructor represents a 'const' constructor |
| 2254 */ | 2276 */ |
| 2255 void set const2(bool isConst) { | 2277 void set const2(bool isConst) { |
| 2256 setModifier(Modifier.CONST, isConst); | 2278 setModifier(Modifier.CONST, isConst); |
| 2257 } | 2279 } |
| 2258 | 2280 |
| 2259 /** | 2281 /** |
| 2260 * Set whether this constructor represents a factory method to the given value
. | 2282 * Set whether this constructor represents a factory method to the given value
. |
| 2261 * @param isFactory {@code true} if this constructor represents a factory meth
od | 2283 * @param isFactory `true` if this constructor represents a factory method |
| 2262 */ | 2284 */ |
| 2263 void set factory(bool isFactory) { | 2285 void set factory(bool isFactory) { |
| 2264 setModifier(Modifier.FACTORY, isFactory); | 2286 setModifier(Modifier.FACTORY, isFactory); |
| 2265 } | 2287 } |
| 2266 | 2288 |
| 2267 /** | 2289 /** |
| 2268 * Sets the constructor to which this constructor is redirecting. | 2290 * Sets the constructor to which this constructor is redirecting. |
| 2269 * @param redirectedConstructor the constructor to which this constructor is r
edirecting | 2291 * @param redirectedConstructor the constructor to which this constructor is r
edirecting |
| 2270 */ | 2292 */ |
| 2271 void set redirectedConstructor(ConstructorElement redirectedConstructor2) { | 2293 void set redirectedConstructor(ConstructorElement redirectedConstructor2) { |
| 2272 this._redirectedConstructor = redirectedConstructor2; | 2294 this._redirectedConstructor = redirectedConstructor2; |
| 2273 } | 2295 } |
| 2274 void appendTo(JavaStringBuilder builder) { | 2296 void appendTo(JavaStringBuilder builder) { |
| 2275 builder.append(enclosingElement.displayName); | 2297 builder.append(enclosingElement.displayName); |
| 2276 String name = displayName; | 2298 String name = displayName; |
| 2277 if (name != null && !name.isEmpty) { | 2299 if (name != null && !name.isEmpty) { |
| 2278 builder.append("."); | 2300 builder.append("."); |
| 2279 builder.append(name); | 2301 builder.append(name); |
| 2280 } | 2302 } |
| 2281 super.appendTo(builder); | 2303 super.appendTo(builder); |
| 2282 } | 2304 } |
| 2283 } | 2305 } |
| 2284 /** | 2306 /** |
| 2285 * Instances of the class {@code DynamicElementImpl} represent the synthetic ele
ment representing | 2307 * Instances of the class `DefaultFieldFormalParameterElementImpl` implement a`F
ieldFormalParameterElementImpl` for parameters that have an initializer. |
| 2286 * the declaration of the type {@code dynamic}. | 2308 * @coverage dart.engine.element |
| 2309 */ |
| 2310 class DefaultFieldFormalParameterElementImpl extends FieldFormalParameterElement
Impl { |
| 2311 |
| 2312 /** |
| 2313 * The result of evaluating this variable's initializer. |
| 2314 */ |
| 2315 EvaluationResultImpl _result; |
| 2316 |
| 2317 /** |
| 2318 * Initialize a newly created parameter element to have the given name. |
| 2319 * @param name the name of this element |
| 2320 */ |
| 2321 DefaultFieldFormalParameterElementImpl(Identifier name) : super(name) { |
| 2322 } |
| 2323 EvaluationResultImpl get evaluationResult => _result; |
| 2324 void set evaluationResult(EvaluationResultImpl result2) { |
| 2325 this._result = result2; |
| 2326 } |
| 2327 } |
| 2328 /** |
| 2329 * Instances of the class `DefaultParameterElementImpl` implement a `ParameterEl
ement`for parameters that have an initializer. |
| 2330 * @coverage dart.engine.element |
| 2331 */ |
| 2332 class DefaultParameterElementImpl extends ParameterElementImpl { |
| 2333 |
| 2334 /** |
| 2335 * The result of evaluating this variable's initializer. |
| 2336 */ |
| 2337 EvaluationResultImpl _result; |
| 2338 |
| 2339 /** |
| 2340 * Initialize a newly created parameter element to have the given name. |
| 2341 * @param name the name of this element |
| 2342 */ |
| 2343 DefaultParameterElementImpl(Identifier name) : super(name) { |
| 2344 } |
| 2345 EvaluationResultImpl get evaluationResult => _result; |
| 2346 void set evaluationResult(EvaluationResultImpl result2) { |
| 2347 this._result = result2; |
| 2348 } |
| 2349 } |
| 2350 /** |
| 2351 * Instances of the class `DynamicElementImpl` represent the synthetic element r
epresenting |
| 2352 * the declaration of the type `dynamic`. |
| 2287 * @coverage dart.engine.element | 2353 * @coverage dart.engine.element |
| 2288 */ | 2354 */ |
| 2289 class DynamicElementImpl extends ElementImpl { | 2355 class DynamicElementImpl extends ElementImpl { |
| 2290 | 2356 |
| 2291 /** | 2357 /** |
| 2292 * Return the unique instance of this class. | 2358 * Return the unique instance of this class. |
| 2293 * @return the unique instance of this class | 2359 * @return the unique instance of this class |
| 2294 */ | 2360 */ |
| 2295 static DynamicElementImpl get instance => DynamicTypeImpl.instance.element as
DynamicElementImpl; | 2361 static DynamicElementImpl get instance => DynamicTypeImpl.instance.element as
DynamicElementImpl; |
| 2296 | 2362 |
| 2297 /** | 2363 /** |
| 2298 * The type defined by this element. | 2364 * The type defined by this element. |
| 2299 */ | 2365 */ |
| 2300 DynamicTypeImpl _type; | 2366 DynamicTypeImpl _type; |
| 2301 | 2367 |
| 2302 /** | 2368 /** |
| 2303 * Initialize a newly created instance of this class. Instances of this class
should <b>not</b> be | 2369 * Initialize a newly created instance of this class. Instances of this class
should <b>not</b> be |
| 2304 * created except as part of creating the type associated with this element. T
he single instance | 2370 * created except as part of creating the type associated with this element. T
he single instance |
| 2305 * of this class should be accessed through the method {@link #getInstance()}. | 2371 * of this class should be accessed through the method [getInstance]. |
| 2306 */ | 2372 */ |
| 2307 DynamicElementImpl() : super.con2(Keyword.DYNAMIC.syntax, -1) { | 2373 DynamicElementImpl() : super.con2(Keyword.DYNAMIC.syntax, -1) { |
| 2308 setModifier(Modifier.SYNTHETIC, true); | 2374 setModifier(Modifier.SYNTHETIC, true); |
| 2309 } | 2375 } |
| 2310 accept(ElementVisitor visitor) => null; | 2376 accept(ElementVisitor visitor) => null; |
| 2311 ElementKind get kind => ElementKind.DYNAMIC; | 2377 ElementKind get kind => ElementKind.DYNAMIC; |
| 2312 | 2378 |
| 2313 /** | 2379 /** |
| 2314 * Return the type defined by this element. | 2380 * Return the type defined by this element. |
| 2315 * @return the type defined by this element | 2381 * @return the type defined by this element |
| 2316 */ | 2382 */ |
| 2317 DynamicTypeImpl get type => _type; | 2383 DynamicTypeImpl get type => _type; |
| 2318 | 2384 |
| 2319 /** | 2385 /** |
| 2320 * Set the type defined by this element to the given type. | 2386 * Set the type defined by this element to the given type. |
| 2321 * @param type the type defined by this element | 2387 * @param type the type defined by this element |
| 2322 */ | 2388 */ |
| 2323 void set type(DynamicTypeImpl type2) { | 2389 void set type(DynamicTypeImpl type2) { |
| 2324 this._type = type2; | 2390 this._type = type2; |
| 2325 } | 2391 } |
| 2326 } | 2392 } |
| 2327 /** | 2393 /** |
| 2328 * Instances of the class {@code ElementAnnotationImpl} implement an {@link Elem
entAnnotation}. | 2394 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio
n]. |
| 2329 * @coverage dart.engine.element | 2395 * @coverage dart.engine.element |
| 2330 */ | 2396 */ |
| 2331 class ElementAnnotationImpl implements ElementAnnotation { | 2397 class ElementAnnotationImpl implements ElementAnnotation { |
| 2332 | 2398 |
| 2333 /** | 2399 /** |
| 2334 * The element representing the field, variable, or constructor being used as
an annotation. | 2400 * The element representing the field, variable, or constructor being used as
an annotation. |
| 2335 */ | 2401 */ |
| 2336 Element _element; | 2402 Element _element; |
| 2337 | 2403 |
| 2338 /** | 2404 /** |
| 2339 * An empty array of annotations. | 2405 * An empty array of annotations. |
| 2340 */ | 2406 */ |
| 2341 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp
l>(0); | 2407 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp
l>(0); |
| 2342 | 2408 |
| 2343 /** | 2409 /** |
| 2344 * Initialize a newly created annotation. | 2410 * Initialize a newly created annotation. |
| 2345 * @param element the element representing the field, variable, or constructor
being used as an | 2411 * @param element the element representing the field, variable, or constructor
being used as an |
| 2346 * annotation | 2412 * annotation |
| 2347 */ | 2413 */ |
| 2348 ElementAnnotationImpl(Element element) { | 2414 ElementAnnotationImpl(Element element) { |
| 2349 this._element = element; | 2415 this._element = element; |
| 2350 } | 2416 } |
| 2351 Element get element => _element; | 2417 Element get element => _element; |
| 2352 String toString() => "@${_element.toString()}"; | 2418 String toString() => "@${_element.toString()}"; |
| 2353 } | 2419 } |
| 2354 /** | 2420 /** |
| 2355 * The abstract class {@code ElementImpl} implements the behavior common to obje
cts that implement | 2421 * The abstract class `ElementImpl` implements the behavior common to objects th
at implement |
| 2356 * an {@link Element}. | 2422 * an [Element]. |
| 2357 * @coverage dart.engine.element | 2423 * @coverage dart.engine.element |
| 2358 */ | 2424 */ |
| 2359 abstract class ElementImpl implements Element { | 2425 abstract class ElementImpl implements Element { |
| 2360 | 2426 |
| 2361 /** | 2427 /** |
| 2362 * The enclosing element of this element, or {@code null} if this element is a
t the root of the | 2428 * The enclosing element of this element, or `null` if this element is at the
root of the |
| 2363 * element structure. | 2429 * element structure. |
| 2364 */ | 2430 */ |
| 2365 ElementImpl _enclosingElement; | 2431 ElementImpl _enclosingElement; |
| 2366 | 2432 |
| 2367 /** | 2433 /** |
| 2368 * The name of this element. | 2434 * The name of this element. |
| 2369 */ | 2435 */ |
| 2370 String _name; | 2436 String _name; |
| 2371 | 2437 |
| 2372 /** | 2438 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2388 /** | 2454 /** |
| 2389 * A cached copy of the calculated hashCode for this element. | 2455 * A cached copy of the calculated hashCode for this element. |
| 2390 */ | 2456 */ |
| 2391 int _cachedHashCode = 0; | 2457 int _cachedHashCode = 0; |
| 2392 | 2458 |
| 2393 /** | 2459 /** |
| 2394 * Initialize a newly created element to have the given name. | 2460 * Initialize a newly created element to have the given name. |
| 2395 * @param name the name of this element | 2461 * @param name the name of this element |
| 2396 */ | 2462 */ |
| 2397 ElementImpl.con1(Identifier name2) { | 2463 ElementImpl.con1(Identifier name2) { |
| 2398 _jtd_constructor_194_impl(name2); | 2464 _jtd_constructor_195_impl(name2); |
| 2399 } | 2465 } |
| 2400 _jtd_constructor_194_impl(Identifier name2) { | 2466 _jtd_constructor_195_impl(Identifier name2) { |
| 2401 _jtd_constructor_195_impl(name2 == null ? "" : name2.name, name2 == null ? -
1 : name2.offset); | 2467 _jtd_constructor_196_impl(name2 == null ? "" : name2.name, name2 == null ? -
1 : name2.offset); |
| 2402 } | 2468 } |
| 2403 | 2469 |
| 2404 /** | 2470 /** |
| 2405 * Initialize a newly created element to have the given name. | 2471 * Initialize a newly created element to have the given name. |
| 2406 * @param name the name of this element | 2472 * @param name the name of this element |
| 2407 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 2473 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 2408 * declaration of this element | 2474 * declaration of this element |
| 2409 */ | 2475 */ |
| 2410 ElementImpl.con2(String name2, int nameOffset2) { | 2476 ElementImpl.con2(String name2, int nameOffset2) { |
| 2411 _jtd_constructor_195_impl(name2, nameOffset2); | 2477 _jtd_constructor_196_impl(name2, nameOffset2); |
| 2412 } | 2478 } |
| 2413 _jtd_constructor_195_impl(String name2, int nameOffset2) { | 2479 _jtd_constructor_196_impl(String name2, int nameOffset2) { |
| 2414 this._name = StringUtilities.intern(name2); | 2480 this._name = StringUtilities.intern(name2); |
| 2415 this._nameOffset = nameOffset2; | 2481 this._nameOffset = nameOffset2; |
| 2416 } | 2482 } |
| 2417 String computeDocumentationComment() { | 2483 String computeDocumentationComment() { |
| 2418 AnalysisContext context = this.context; | 2484 AnalysisContext context = this.context; |
| 2419 if (context == null) { | 2485 if (context == null) { |
| 2420 return null; | 2486 return null; |
| 2421 } | 2487 } |
| 2422 return context.computeDocumentationComment(this); | 2488 return context.computeDocumentationComment(this); |
| 2423 } | 2489 } |
| 2424 bool operator ==(Object object) => object != null && object.runtimeType == run
timeType && ((object as Element)).location == location; | 2490 bool operator ==(Object object) => object != null && object.runtimeType == run
timeType && ((object as Element)).location == location; |
| 2425 Element getAncestor(Type elementClass) { | 2491 Element getAncestor(Type elementClass) { |
| 2426 Element ancestor = _enclosingElement; | 2492 Element ancestor = _enclosingElement; |
| 2427 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) { | 2493 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) { |
| 2428 ancestor = ancestor.enclosingElement; | 2494 ancestor = ancestor.enclosingElement; |
| 2429 } | 2495 } |
| 2430 return ancestor as Element; | 2496 return ancestor as Element; |
| 2431 } | 2497 } |
| 2432 | 2498 |
| 2433 /** | 2499 /** |
| 2434 * Return the child of this element that is uniquely identified by the given i
dentifier, or{@code null} if there is no such child. | 2500 * Return the child of this element that is uniquely identified by the given i
dentifier, or`null` if there is no such child. |
| 2435 * @param identifier the identifier used to select a child | 2501 * @param identifier the identifier used to select a child |
| 2436 * @return the child of this element with the given identifier | 2502 * @return the child of this element with the given identifier |
| 2437 */ | 2503 */ |
| 2438 ElementImpl getChild(String identifier) => null; | 2504 ElementImpl getChild(String identifier) => null; |
| 2439 AnalysisContext get context { | 2505 AnalysisContext get context { |
| 2440 if (_enclosingElement == null) { | 2506 if (_enclosingElement == null) { |
| 2441 return null; | 2507 return null; |
| 2442 } | 2508 } |
| 2443 return _enclosingElement.context; | 2509 return _enclosingElement.context; |
| 2444 } | 2510 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 * element to the given value. This is normally done via the constructor, but
this method is | 2548 * element to the given value. This is normally done via the constructor, but
this method is |
| 2483 * provided to support unnamed constructors. | 2549 * provided to support unnamed constructors. |
| 2484 * @param nameOffset the offset to the beginning of the name | 2550 * @param nameOffset the offset to the beginning of the name |
| 2485 */ | 2551 */ |
| 2486 void set nameOffset(int nameOffset2) { | 2552 void set nameOffset(int nameOffset2) { |
| 2487 this._nameOffset = nameOffset2; | 2553 this._nameOffset = nameOffset2; |
| 2488 } | 2554 } |
| 2489 | 2555 |
| 2490 /** | 2556 /** |
| 2491 * Set whether this element is synthetic to correspond to the given value. | 2557 * Set whether this element is synthetic to correspond to the given value. |
| 2492 * @param isSynthetic {@code true} if the element is synthetic | 2558 * @param isSynthetic `true` if the element is synthetic |
| 2493 */ | 2559 */ |
| 2494 void set synthetic(bool isSynthetic) { | 2560 void set synthetic(bool isSynthetic) { |
| 2495 setModifier(Modifier.SYNTHETIC, isSynthetic); | 2561 setModifier(Modifier.SYNTHETIC, isSynthetic); |
| 2496 } | 2562 } |
| 2497 String toString() { | 2563 String toString() { |
| 2498 JavaStringBuilder builder = new JavaStringBuilder(); | 2564 JavaStringBuilder builder = new JavaStringBuilder(); |
| 2499 appendTo(builder); | 2565 appendTo(builder); |
| 2500 return builder.toString(); | 2566 return builder.toString(); |
| 2501 } | 2567 } |
| 2502 void visitChildren(ElementVisitor<Object> visitor) { | 2568 void visitChildren(ElementVisitor<Object> visitor) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2517 } | 2583 } |
| 2518 | 2584 |
| 2519 /** | 2585 /** |
| 2520 * Return an identifier that uniquely identifies this element among the childr
en of this element's | 2586 * Return an identifier that uniquely identifies this element among the childr
en of this element's |
| 2521 * parent. | 2587 * parent. |
| 2522 * @return an identifier that uniquely identifies this element relative to its
parent | 2588 * @return an identifier that uniquely identifies this element relative to its
parent |
| 2523 */ | 2589 */ |
| 2524 String get identifier => name; | 2590 String get identifier => name; |
| 2525 | 2591 |
| 2526 /** | 2592 /** |
| 2527 * Return {@code true} if this element has the given modifier associated with
it. | 2593 * Return `true` if this element has the given modifier associated with it. |
| 2528 * @param modifier the modifier being tested for | 2594 * @param modifier the modifier being tested for |
| 2529 * @return {@code true} if this element has the given modifier associated with
it | 2595 * @return `true` if this element has the given modifier associated with it |
| 2530 */ | 2596 */ |
| 2531 bool hasModifier(Modifier modifier) => _modifiers != null && _modifiers.contai
ns(modifier); | 2597 bool hasModifier(Modifier modifier) => _modifiers != null && _modifiers.contai
ns(modifier); |
| 2532 | 2598 |
| 2533 /** | 2599 /** |
| 2534 * If the given child is not {@code null}, use the given visitor to visit it. | 2600 * If the given child is not `null`, use the given visitor to visit it. |
| 2535 * @param child the child to be visited | 2601 * @param child the child to be visited |
| 2536 * @param visitor the visitor to be used to visit the child | 2602 * @param visitor the visitor to be used to visit the child |
| 2537 */ | 2603 */ |
| 2538 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { | 2604 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { |
| 2539 if (child != null) { | 2605 if (child != null) { |
| 2540 child.accept(visitor); | 2606 child.accept(visitor); |
| 2541 } | 2607 } |
| 2542 } | 2608 } |
| 2543 | 2609 |
| 2544 /** | 2610 /** |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2559 * @param element the enclosing element of this element | 2625 * @param element the enclosing element of this element |
| 2560 */ | 2626 */ |
| 2561 void set enclosingElement(ElementImpl element) { | 2627 void set enclosingElement(ElementImpl element) { |
| 2562 _enclosingElement = element; | 2628 _enclosingElement = element; |
| 2563 } | 2629 } |
| 2564 | 2630 |
| 2565 /** | 2631 /** |
| 2566 * Set whether the given modifier is associated with this element to correspon
d to the given | 2632 * Set whether the given modifier is associated with this element to correspon
d to the given |
| 2567 * value. | 2633 * value. |
| 2568 * @param modifier the modifier to be set | 2634 * @param modifier the modifier to be set |
| 2569 * @param value {@code true} if the modifier is to be associated with this ele
ment | 2635 * @param value `true` if the modifier is to be associated with this element |
| 2570 */ | 2636 */ |
| 2571 void setModifier(Modifier modifier, bool value) { | 2637 void setModifier(Modifier modifier, bool value) { |
| 2572 if (value) { | 2638 if (value) { |
| 2573 if (_modifiers == null) { | 2639 if (_modifiers == null) { |
| 2574 _modifiers = new Set(); | 2640 _modifiers = new Set(); |
| 2575 } | 2641 } |
| 2576 _modifiers.add(modifier); | 2642 _modifiers.add(modifier); |
| 2577 } else { | 2643 } else { |
| 2578 if (_modifiers != null) { | 2644 if (_modifiers != null) { |
| 2579 _modifiers.remove(modifier); | 2645 _modifiers.remove(modifier); |
| 2580 if (_modifiers.isEmpty) { | 2646 if (_modifiers.isEmpty) { |
| 2581 _modifiers = null; | 2647 _modifiers = null; |
| 2582 } | 2648 } |
| 2583 } | 2649 } |
| 2584 } | 2650 } |
| 2585 } | 2651 } |
| 2586 } | 2652 } |
| 2587 /** | 2653 /** |
| 2588 * Instances of the class {@code ElementLocationImpl} implement an {@link Elemen
tLocation}. | 2654 * Instances of the class `ElementLocationImpl` implement an [ElementLocation]. |
| 2589 * @coverage dart.engine.element | 2655 * @coverage dart.engine.element |
| 2590 */ | 2656 */ |
| 2591 class ElementLocationImpl implements ElementLocation { | 2657 class ElementLocationImpl implements ElementLocation { |
| 2592 | 2658 |
| 2593 /** | 2659 /** |
| 2594 * The path to the element whose location is represented by this object. | 2660 * The path to the element whose location is represented by this object. |
| 2595 */ | 2661 */ |
| 2596 List<String> _components; | 2662 List<String> _components; |
| 2597 | 2663 |
| 2598 /** | 2664 /** |
| 2599 * The character used to separate components in the encoded form. | 2665 * The character used to separate components in the encoded form. |
| 2600 */ | 2666 */ |
| 2601 static int _SEPARATOR_CHAR = 0x3B; | 2667 static int _SEPARATOR_CHAR = 0x3B; |
| 2602 | 2668 |
| 2603 /** | 2669 /** |
| 2604 * Initialize a newly created location to represent the given element. | 2670 * Initialize a newly created location to represent the given element. |
| 2605 * @param element the element whose location is being represented | 2671 * @param element the element whose location is being represented |
| 2606 */ | 2672 */ |
| 2607 ElementLocationImpl.con1(Element element) { | 2673 ElementLocationImpl.con1(Element element) { |
| 2608 _jtd_constructor_196_impl(element); | 2674 _jtd_constructor_197_impl(element); |
| 2609 } | 2675 } |
| 2610 _jtd_constructor_196_impl(Element element) { | 2676 _jtd_constructor_197_impl(Element element) { |
| 2611 List<String> components = new List<String>(); | 2677 List<String> components = new List<String>(); |
| 2612 Element ancestor = element; | 2678 Element ancestor = element; |
| 2613 while (ancestor != null) { | 2679 while (ancestor != null) { |
| 2614 components.insert(0, ((ancestor as ElementImpl)).identifier); | 2680 components.insert(0, ((ancestor as ElementImpl)).identifier); |
| 2615 ancestor = ancestor.enclosingElement; | 2681 ancestor = ancestor.enclosingElement; |
| 2616 } | 2682 } |
| 2617 this._components = new List.from(components); | 2683 this._components = new List.from(components); |
| 2618 } | 2684 } |
| 2619 | 2685 |
| 2620 /** | 2686 /** |
| 2621 * Initialize a newly created location from the given encoded form. | 2687 * Initialize a newly created location from the given encoded form. |
| 2622 * @param encoding the encoded form of a location | 2688 * @param encoding the encoded form of a location |
| 2623 */ | 2689 */ |
| 2624 ElementLocationImpl.con2(String encoding) { | 2690 ElementLocationImpl.con2(String encoding) { |
| 2625 _jtd_constructor_197_impl(encoding); | 2691 _jtd_constructor_198_impl(encoding); |
| 2626 } | 2692 } |
| 2627 _jtd_constructor_197_impl(String encoding) { | 2693 _jtd_constructor_198_impl(String encoding) { |
| 2628 this._components = decode(encoding); | 2694 this._components = decode(encoding); |
| 2629 } | 2695 } |
| 2630 bool operator ==(Object object) { | 2696 bool operator ==(Object object) { |
| 2631 if (object is! ElementLocationImpl) { | 2697 if (object is! ElementLocationImpl) { |
| 2632 return false; | 2698 return false; |
| 2633 } | 2699 } |
| 2634 ElementLocationImpl location = object as ElementLocationImpl; | 2700 ElementLocationImpl location = object as ElementLocationImpl; |
| 2635 List<String> otherComponents = location._components; | 2701 List<String> otherComponents = location._components; |
| 2636 int length = _components.length; | 2702 int length = _components.length; |
| 2637 if (otherComponents.length != length) { | 2703 if (otherComponents.length != length) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 for (int i = 0; i < length; i++) { | 2778 for (int i = 0; i < length; i++) { |
| 2713 int currentChar = component.codeUnitAt(i); | 2779 int currentChar = component.codeUnitAt(i); |
| 2714 if (currentChar == _SEPARATOR_CHAR) { | 2780 if (currentChar == _SEPARATOR_CHAR) { |
| 2715 builder.appendChar(_SEPARATOR_CHAR); | 2781 builder.appendChar(_SEPARATOR_CHAR); |
| 2716 } | 2782 } |
| 2717 builder.appendChar(currentChar); | 2783 builder.appendChar(currentChar); |
| 2718 } | 2784 } |
| 2719 } | 2785 } |
| 2720 | 2786 |
| 2721 /** | 2787 /** |
| 2722 * Return {@code true} if the given components, when interpreted to be encoded
sources with a | 2788 * Return `true` if the given components, when interpreted to be encoded sourc
es with a |
| 2723 * leading source type indicator, are equal when the source type's are ignored
. | 2789 * leading source type indicator, are equal when the source type's are ignored
. |
| 2724 * @param left the left component being compared | 2790 * @param left the left component being compared |
| 2725 * @param right the right component being compared | 2791 * @param right the right component being compared |
| 2726 * @return {@code true} if the given components are equal when the source type
's are ignored | 2792 * @return `true` if the given components are equal when the source type's are
ignored |
| 2727 */ | 2793 */ |
| 2728 bool equalSourceComponents(String left, String right) { | 2794 bool equalSourceComponents(String left, String right) { |
| 2729 if (left == null) { | 2795 if (left == null) { |
| 2730 return right == null; | 2796 return right == null; |
| 2731 } else if (right == null) { | 2797 } else if (right == null) { |
| 2732 return false; | 2798 return false; |
| 2733 } | 2799 } |
| 2734 if (left.length <= 1 || right.length <= 1) { | 2800 if (left.length <= 1 || right.length <= 1) { |
| 2735 return left == right; | 2801 return left == right; |
| 2736 } | 2802 } |
| 2737 return left.substring(1) == right.substring(1); | 2803 return left.substring(1) == right.substring(1); |
| 2738 } | 2804 } |
| 2739 } | 2805 } |
| 2740 /** | 2806 /** |
| 2741 * Instances of the class {@code EmbeddedHtmlScriptElementImpl} implement an{@li
nk EmbeddedHtmlScriptElement}. | 2807 * Instances of the class `EmbeddedHtmlScriptElementImpl` implement an[EmbeddedH
tmlScriptElement]. |
| 2742 * @coverage dart.engine.element | 2808 * @coverage dart.engine.element |
| 2743 */ | 2809 */ |
| 2744 class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements Emb
eddedHtmlScriptElement { | 2810 class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements Emb
eddedHtmlScriptElement { |
| 2745 | 2811 |
| 2746 /** | 2812 /** |
| 2747 * The library defined by the script tag's content. | 2813 * The library defined by the script tag's content. |
| 2748 */ | 2814 */ |
| 2749 LibraryElement _scriptLibrary; | 2815 LibraryElement _scriptLibrary; |
| 2750 | 2816 |
| 2751 /** | 2817 /** |
| 2752 * Initialize a newly created script element to have the specified tag name an
d offset. | 2818 * Initialize a newly created script element to have the specified tag name an
d offset. |
| 2753 * @param node the XML node from which this element is derived (not {@code nul
l}) | 2819 * @param node the XML node from which this element is derived (not `null`) |
| 2754 */ | 2820 */ |
| 2755 EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node) { | 2821 EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node) { |
| 2756 } | 2822 } |
| 2757 accept(ElementVisitor visitor) => visitor.visitEmbeddedHtmlScriptElement(this)
; | 2823 accept(ElementVisitor visitor) => visitor.visitEmbeddedHtmlScriptElement(this)
; |
| 2758 ElementKind get kind => ElementKind.EMBEDDED_HTML_SCRIPT; | 2824 ElementKind get kind => ElementKind.EMBEDDED_HTML_SCRIPT; |
| 2759 LibraryElement get scriptLibrary => _scriptLibrary; | 2825 LibraryElement get scriptLibrary => _scriptLibrary; |
| 2760 | 2826 |
| 2761 /** | 2827 /** |
| 2762 * Set the script library defined by the script tag's content. | 2828 * Set the script library defined by the script tag's content. |
| 2763 * @param scriptLibrary the library or {@code null} if none | 2829 * @param scriptLibrary the library or `null` if none |
| 2764 */ | 2830 */ |
| 2765 void set scriptLibrary(LibraryElementImpl scriptLibrary2) { | 2831 void set scriptLibrary(LibraryElementImpl scriptLibrary2) { |
| 2766 scriptLibrary2.enclosingElement = this; | 2832 scriptLibrary2.enclosingElement = this; |
| 2767 this._scriptLibrary = scriptLibrary2; | 2833 this._scriptLibrary = scriptLibrary2; |
| 2768 } | 2834 } |
| 2769 void visitChildren(ElementVisitor<Object> visitor) { | 2835 void visitChildren(ElementVisitor<Object> visitor) { |
| 2770 safelyVisitChild(_scriptLibrary, visitor); | 2836 safelyVisitChild(_scriptLibrary, visitor); |
| 2771 } | 2837 } |
| 2772 } | 2838 } |
| 2773 /** | 2839 /** |
| 2774 * The abstract class {@code ExecutableElementImpl} implements the behavior comm
on to{@code ExecutableElement}s. | 2840 * The abstract class `ExecutableElementImpl` implements the behavior common to`
ExecutableElement`s. |
| 2775 * @coverage dart.engine.element | 2841 * @coverage dart.engine.element |
| 2776 */ | 2842 */ |
| 2777 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl
ement { | 2843 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl
ement { |
| 2778 | 2844 |
| 2779 /** | 2845 /** |
| 2780 * An array containing all of the functions defined within this executable ele
ment. | 2846 * An array containing all of the functions defined within this executable ele
ment. |
| 2781 */ | 2847 */ |
| 2782 List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY; | 2848 List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY; |
| 2783 | 2849 |
| 2784 /** | 2850 /** |
| 2785 * An array containing all of the labels defined within this executable elemen
t. | 2851 * An array containing all of the labels defined within this executable elemen
t. |
| 2786 */ | 2852 */ |
| 2787 List<LabelElement> _labels = LabelElementImpl.EMPTY_ARRAY; | 2853 List<LabelElement> _labels = LabelElementImpl.EMPTY_ARRAY; |
| 2788 | 2854 |
| 2789 /** | 2855 /** |
| 2790 * An array containing all of the local variables defined within this executab
le element. | 2856 * An array containing all of the local variables defined within this executab
le element. |
| 2791 */ | 2857 */ |
| 2792 List<LocalVariableElement> _localVariables = LocalVariableElementImpl.EMPTY_AR
RAY; | 2858 List<LocalVariableElement> _localVariables = LocalVariableElementImpl.EMPTY_AR
RAY; |
| 2793 | 2859 |
| 2794 /** | 2860 /** |
| 2795 * An array containing all of the parameters defined by this executable elemen
t. | 2861 * An array containing all of the parameters defined by this executable elemen
t. |
| 2796 */ | 2862 */ |
| 2797 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; | 2863 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; |
| 2798 | 2864 |
| 2799 /** | 2865 /** |
| 2866 * The return type defined by this executable element. |
| 2867 */ |
| 2868 Type2 _returnType; |
| 2869 |
| 2870 /** |
| 2800 * The type of function defined by this executable element. | 2871 * The type of function defined by this executable element. |
| 2801 */ | 2872 */ |
| 2802 FunctionType _type; | 2873 FunctionType _type; |
| 2803 | 2874 |
| 2804 /** | 2875 /** |
| 2805 * An empty array of executable elements. | 2876 * An empty array of executable elements. |
| 2806 */ | 2877 */ |
| 2807 static List<ExecutableElement> EMPTY_ARRAY = new List<ExecutableElement>(0); | 2878 static List<ExecutableElement> EMPTY_ARRAY = new List<ExecutableElement>(0); |
| 2808 | 2879 |
| 2809 /** | 2880 /** |
| 2810 * Initialize a newly created executable element to have the given name. | 2881 * Initialize a newly created executable element to have the given name. |
| 2811 * @param name the name of this element | 2882 * @param name the name of this element |
| 2812 */ | 2883 */ |
| 2813 ExecutableElementImpl.con1(Identifier name) : super.con1(name) { | 2884 ExecutableElementImpl.con1(Identifier name) : super.con1(name) { |
| 2814 _jtd_constructor_199_impl(name); | 2885 _jtd_constructor_200_impl(name); |
| 2815 } | 2886 } |
| 2816 _jtd_constructor_199_impl(Identifier name) { | 2887 _jtd_constructor_200_impl(Identifier name) { |
| 2817 } | 2888 } |
| 2818 | 2889 |
| 2819 /** | 2890 /** |
| 2820 * Initialize a newly created executable element to have the given name. | 2891 * Initialize a newly created executable element to have the given name. |
| 2821 * @param name the name of this element | 2892 * @param name the name of this element |
| 2822 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 2893 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 2823 * declaration of this element | 2894 * declaration of this element |
| 2824 */ | 2895 */ |
| 2825 ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nam
eOffset) { | 2896 ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nam
eOffset) { |
| 2826 _jtd_constructor_200_impl(name, nameOffset); | 2897 _jtd_constructor_201_impl(name, nameOffset); |
| 2827 } | 2898 } |
| 2828 _jtd_constructor_200_impl(String name, int nameOffset) { | 2899 _jtd_constructor_201_impl(String name, int nameOffset) { |
| 2829 } | 2900 } |
| 2830 ElementImpl getChild(String identifier2) { | 2901 ElementImpl getChild(String identifier2) { |
| 2831 for (ExecutableElement function in _functions) { | 2902 for (ExecutableElement function in _functions) { |
| 2832 if (((function as ExecutableElementImpl)).identifier == identifier2) { | 2903 if (((function as ExecutableElementImpl)).identifier == identifier2) { |
| 2833 return function as ExecutableElementImpl; | 2904 return function as ExecutableElementImpl; |
| 2834 } | 2905 } |
| 2835 } | 2906 } |
| 2836 for (LabelElement label in _labels) { | 2907 for (LabelElement label in _labels) { |
| 2837 if (((label as LabelElementImpl)).identifier == identifier2) { | 2908 if (((label as LabelElementImpl)).identifier == identifier2) { |
| 2838 return label as LabelElementImpl; | 2909 return label as LabelElementImpl; |
| 2839 } | 2910 } |
| 2840 } | 2911 } |
| 2841 for (VariableElement variable in _localVariables) { | 2912 for (VariableElement variable in _localVariables) { |
| 2842 if (((variable as VariableElementImpl)).identifier == identifier2) { | 2913 if (((variable as VariableElementImpl)).identifier == identifier2) { |
| 2843 return variable as VariableElementImpl; | 2914 return variable as VariableElementImpl; |
| 2844 } | 2915 } |
| 2845 } | 2916 } |
| 2846 for (ParameterElement parameter in _parameters) { | 2917 for (ParameterElement parameter in _parameters) { |
| 2847 if (((parameter as ParameterElementImpl)).identifier == identifier2) { | 2918 if (((parameter as ParameterElementImpl)).identifier == identifier2) { |
| 2848 return parameter as ParameterElementImpl; | 2919 return parameter as ParameterElementImpl; |
| 2849 } | 2920 } |
| 2850 } | 2921 } |
| 2851 return null; | 2922 return null; |
| 2852 } | 2923 } |
| 2853 List<FunctionElement> get functions => _functions; | 2924 List<FunctionElement> get functions => _functions; |
| 2854 List<LabelElement> get labels => _labels; | 2925 List<LabelElement> get labels => _labels; |
| 2855 List<LocalVariableElement> get localVariables => _localVariables; | 2926 List<LocalVariableElement> get localVariables => _localVariables; |
| 2856 List<ParameterElement> get parameters => _parameters; | 2927 List<ParameterElement> get parameters => _parameters; |
| 2928 Type2 get returnType => _returnType; |
| 2857 FunctionType get type => _type; | 2929 FunctionType get type => _type; |
| 2858 bool isOperator() => false; | 2930 bool isOperator() => false; |
| 2859 | 2931 |
| 2860 /** | 2932 /** |
| 2861 * 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. |
| 2862 * @param functions the functions defined within this executable element | 2934 * @param functions the functions defined within this executable element |
| 2863 */ | 2935 */ |
| 2864 void set functions(List<FunctionElement> functions2) { | 2936 void set functions(List<FunctionElement> functions2) { |
| 2865 for (FunctionElement function in functions2) { | 2937 for (FunctionElement function in functions2) { |
| 2866 ((function as FunctionElementImpl)).enclosingElement = this; | 2938 ((function as FunctionElementImpl)).enclosingElement = this; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2895 * @param parameters the parameters defined by this executable element | 2967 * @param parameters the parameters defined by this executable element |
| 2896 */ | 2968 */ |
| 2897 void set parameters(List<ParameterElement> parameters2) { | 2969 void set parameters(List<ParameterElement> parameters2) { |
| 2898 for (ParameterElement parameter in parameters2) { | 2970 for (ParameterElement parameter in parameters2) { |
| 2899 ((parameter as ParameterElementImpl)).enclosingElement = this; | 2971 ((parameter as ParameterElementImpl)).enclosingElement = this; |
| 2900 } | 2972 } |
| 2901 this._parameters = parameters2; | 2973 this._parameters = parameters2; |
| 2902 } | 2974 } |
| 2903 | 2975 |
| 2904 /** | 2976 /** |
| 2977 * Set the return type defined by this executable element. |
| 2978 * @param returnType the return type defined by this executable element |
| 2979 */ |
| 2980 void set returnType(Type2 returnType2) { |
| 2981 this._returnType = returnType2; |
| 2982 } |
| 2983 |
| 2984 /** |
| 2905 * Set the type of function defined by this executable element to the given ty
pe. | 2985 * Set the type of function defined by this executable element to the given ty
pe. |
| 2906 * @param type the type of function defined by this executable element | 2986 * @param type the type of function defined by this executable element |
| 2907 */ | 2987 */ |
| 2908 void set type(FunctionType type2) { | 2988 void set type(FunctionType type2) { |
| 2909 this._type = type2; | 2989 this._type = type2; |
| 2910 } | 2990 } |
| 2911 void visitChildren(ElementVisitor<Object> visitor) { | 2991 void visitChildren(ElementVisitor<Object> visitor) { |
| 2912 super.visitChildren(visitor); | 2992 super.visitChildren(visitor); |
| 2913 safelyVisitChildren(_functions, visitor); | 2993 safelyVisitChildren(_functions, visitor); |
| 2914 safelyVisitChildren(_labels, visitor); | 2994 safelyVisitChildren(_labels, visitor); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2925 ((_parameters[i] as ParameterElementImpl)).appendTo(builder); | 3005 ((_parameters[i] as ParameterElementImpl)).appendTo(builder); |
| 2926 } | 3006 } |
| 2927 builder.append(")"); | 3007 builder.append(")"); |
| 2928 if (_type != null) { | 3008 if (_type != null) { |
| 2929 builder.append(" -> "); | 3009 builder.append(" -> "); |
| 2930 builder.append(_type.returnType); | 3010 builder.append(_type.returnType); |
| 2931 } | 3011 } |
| 2932 } | 3012 } |
| 2933 } | 3013 } |
| 2934 /** | 3014 /** |
| 2935 * Instances of the class {@code ExportElementImpl} implement an {@link ExportEl
ement}. | 3015 * Instances of the class `ExportElementImpl` implement an [ExportElement]. |
| 2936 * @coverage dart.engine.element | 3016 * @coverage dart.engine.element |
| 2937 */ | 3017 */ |
| 2938 class ExportElementImpl extends ElementImpl implements ExportElement { | 3018 class ExportElementImpl extends ElementImpl implements ExportElement { |
| 2939 | 3019 |
| 2940 /** | 3020 /** |
| 2941 * The URI that is specified by this directive. | 3021 * The URI that is specified by this directive. |
| 2942 */ | 3022 */ |
| 2943 String _uri; | 3023 String _uri; |
| 2944 | 3024 |
| 2945 /** | 3025 /** |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 void set uri(String uri2) { | 3069 void set uri(String uri2) { |
| 2990 this._uri = uri2; | 3070 this._uri = uri2; |
| 2991 } | 3071 } |
| 2992 void appendTo(JavaStringBuilder builder) { | 3072 void appendTo(JavaStringBuilder builder) { |
| 2993 builder.append("export "); | 3073 builder.append("export "); |
| 2994 ((_exportedLibrary as LibraryElementImpl)).appendTo(builder); | 3074 ((_exportedLibrary as LibraryElementImpl)).appendTo(builder); |
| 2995 } | 3075 } |
| 2996 String get identifier => _exportedLibrary.name; | 3076 String get identifier => _exportedLibrary.name; |
| 2997 } | 3077 } |
| 2998 /** | 3078 /** |
| 2999 * Instances of the class {@code ExternalHtmlScriptElementImpl} implement an{@li
nk ExternalHtmlScriptElement}. | 3079 * Instances of the class `ExternalHtmlScriptElementImpl` implement an[ExternalH
tmlScriptElement]. |
| 3000 * @coverage dart.engine.element | 3080 * @coverage dart.engine.element |
| 3001 */ | 3081 */ |
| 3002 class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements Ext
ernalHtmlScriptElement { | 3082 class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements Ext
ernalHtmlScriptElement { |
| 3003 | 3083 |
| 3004 /** | 3084 /** |
| 3005 * The source specified in the {@code source} attribute or {@code null} if uns
pecified. | 3085 * The source specified in the `source` attribute or `null` if unspecified. |
| 3006 */ | 3086 */ |
| 3007 Source _scriptSource; | 3087 Source _scriptSource; |
| 3008 | 3088 |
| 3009 /** | 3089 /** |
| 3010 * Initialize a newly created script element to have the specified tag name an
d offset. | 3090 * Initialize a newly created script element to have the specified tag name an
d offset. |
| 3011 * @param node the XML node from which this element is derived (not {@code nul
l}) | 3091 * @param node the XML node from which this element is derived (not `null`) |
| 3012 */ | 3092 */ |
| 3013 ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node) { | 3093 ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node) { |
| 3014 } | 3094 } |
| 3015 accept(ElementVisitor visitor) => visitor.visitExternalHtmlScriptElement(this)
; | 3095 accept(ElementVisitor visitor) => visitor.visitExternalHtmlScriptElement(this)
; |
| 3016 ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT; | 3096 ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT; |
| 3017 Source get scriptSource => _scriptSource; | 3097 Source get scriptSource => _scriptSource; |
| 3018 | 3098 |
| 3019 /** | 3099 /** |
| 3020 * Set the source specified in the {@code source} attribute. | 3100 * Set the source specified in the `source` attribute. |
| 3021 * @param scriptSource the script source or {@code null} if unspecified | 3101 * @param scriptSource the script source or `null` if unspecified |
| 3022 */ | 3102 */ |
| 3023 void set scriptSource(Source scriptSource2) { | 3103 void set scriptSource(Source scriptSource2) { |
| 3024 this._scriptSource = scriptSource2; | 3104 this._scriptSource = scriptSource2; |
| 3025 } | 3105 } |
| 3026 } | 3106 } |
| 3027 /** | 3107 /** |
| 3028 * Instances of the class {@code FieldElementImpl} implement a {@code FieldEleme
nt}. | 3108 * Instances of the class `FieldElementImpl` implement a `FieldElement`. |
| 3029 * @coverage dart.engine.element | 3109 * @coverage dart.engine.element |
| 3030 */ | 3110 */ |
| 3031 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme
nt { | 3111 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme
nt { |
| 3032 | 3112 |
| 3033 /** | 3113 /** |
| 3034 * An empty array of field elements. | 3114 * An empty array of field elements. |
| 3035 */ | 3115 */ |
| 3036 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0); | 3116 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0); |
| 3037 | 3117 |
| 3038 /** | 3118 /** |
| 3039 * Initialize a newly created field element to have the given name. | 3119 * Initialize a newly created field element to have the given name. |
| 3040 * @param name the name of this element | 3120 * @param name the name of this element |
| 3041 */ | 3121 */ |
| 3042 FieldElementImpl.con1(Identifier name) : super.con1(name) { | 3122 FieldElementImpl.con1(Identifier name) : super.con1(name) { |
| 3043 _jtd_constructor_203_impl(name); | 3123 _jtd_constructor_204_impl(name); |
| 3044 } | 3124 } |
| 3045 _jtd_constructor_203_impl(Identifier name) { | 3125 _jtd_constructor_204_impl(Identifier name) { |
| 3046 } | 3126 } |
| 3047 | 3127 |
| 3048 /** | 3128 /** |
| 3049 * Initialize a newly created synthetic field element to have the given name. | 3129 * Initialize a newly created synthetic field element to have the given name. |
| 3050 * @param name the name of this element | 3130 * @param name the name of this element |
| 3051 */ | 3131 */ |
| 3052 FieldElementImpl.con2(String name) : super.con2(name) { | 3132 FieldElementImpl.con2(String name) : super.con2(name) { |
| 3053 _jtd_constructor_204_impl(name); | 3133 _jtd_constructor_205_impl(name); |
| 3054 } | 3134 } |
| 3055 _jtd_constructor_204_impl(String name) { | 3135 _jtd_constructor_205_impl(String name) { |
| 3056 } | 3136 } |
| 3057 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 3137 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 3058 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3138 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 3059 ElementKind get kind => ElementKind.FIELD; | 3139 ElementKind get kind => ElementKind.FIELD; |
| 3060 bool isStatic() => hasModifier(Modifier.STATIC); | 3140 bool isStatic() => hasModifier(Modifier.STATIC); |
| 3061 | 3141 |
| 3062 /** | 3142 /** |
| 3063 * 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. |
| 3064 * @param isStatic {@code true} if the field is static | 3144 * @param isStatic `true` if the field is static |
| 3065 */ | 3145 */ |
| 3066 void set static(bool isStatic) { | 3146 void set static(bool isStatic) { |
| 3067 setModifier(Modifier.STATIC, isStatic); | 3147 setModifier(Modifier.STATIC, isStatic); |
| 3068 } | 3148 } |
| 3069 } | 3149 } |
| 3070 /** | 3150 /** |
| 3071 * Instances of the class {@code FieldFormalParameterElementImpl} extend{@link P
arameterElementImpl} to provide the additional information of the {@link FieldEl
ement}associated with the parameter. | 3151 * Instances of the class `FieldFormalParameterElementImpl` extend[ParameterElem
entImpl] to provide the additional information of the [FieldElement]associated w
ith the parameter. |
| 3072 * @coverage dart.engine.element | 3152 * @coverage dart.engine.element |
| 3073 */ | 3153 */ |
| 3074 class FieldFormalParameterElementImpl extends ParameterElementImpl implements Fi
eldFormalParameterElement { | 3154 class FieldFormalParameterElementImpl extends ParameterElementImpl implements Fi
eldFormalParameterElement { |
| 3075 | 3155 |
| 3076 /** | 3156 /** |
| 3077 * The field associated with this field formal parameter. | 3157 * The field associated with this field formal parameter. |
| 3078 */ | 3158 */ |
| 3079 FieldElement _field; | 3159 FieldElement _field; |
| 3080 | 3160 |
| 3081 /** | 3161 /** |
| 3082 * Initialize a newly created parameter element to have the given name. | 3162 * Initialize a newly created parameter element to have the given name. |
| 3083 * @param name the name of this element | 3163 * @param name the name of this element |
| 3084 */ | 3164 */ |
| 3085 FieldFormalParameterElementImpl(Identifier name) : super(name) { | 3165 FieldFormalParameterElementImpl(Identifier name) : super(name) { |
| 3086 } | 3166 } |
| 3087 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); | 3167 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); |
| 3088 FieldElement get field => _field; | 3168 FieldElement get field => _field; |
| 3089 bool isInitializingFormal() => true; | 3169 bool isInitializingFormal() => true; |
| 3090 | 3170 |
| 3091 /** | 3171 /** |
| 3092 * 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. |
| 3093 * @param field the new field element | 3173 * @param field the new field element |
| 3094 */ | 3174 */ |
| 3095 void set field(FieldElement field2) { | 3175 void set field(FieldElement field2) { |
| 3096 this._field = field2; | 3176 this._field = field2; |
| 3097 } | 3177 } |
| 3098 } | 3178 } |
| 3099 /** | 3179 /** |
| 3100 * Instances of the class {@code FunctionElementImpl} implement a {@code Functio
nElement}. | 3180 * Instances of the class `FunctionElementImpl` implement a `FunctionElement`. |
| 3101 * @coverage dart.engine.element | 3181 * @coverage dart.engine.element |
| 3102 */ | 3182 */ |
| 3103 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme
nt { | 3183 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme
nt { |
| 3104 | 3184 |
| 3105 /** | 3185 /** |
| 3106 * The offset to the beginning of the visible range for this element. | 3186 * The offset to the beginning of the visible range for this element. |
| 3107 */ | 3187 */ |
| 3108 int _visibleRangeOffset = 0; | 3188 int _visibleRangeOffset = 0; |
| 3109 | 3189 |
| 3110 /** | 3190 /** |
| 3111 * The length of the visible range for this element, or {@code -1} if this ele
ment does not have a | 3191 * The length of the visible range for this element, or `-1` if this element d
oes not have a |
| 3112 * visible range. | 3192 * visible range. |
| 3113 */ | 3193 */ |
| 3114 int _visibleRangeLength = -1; | 3194 int _visibleRangeLength = -1; |
| 3115 | 3195 |
| 3116 /** | 3196 /** |
| 3117 * An empty array of function elements. | 3197 * An empty array of function elements. |
| 3118 */ | 3198 */ |
| 3119 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0); | 3199 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0); |
| 3120 | 3200 |
| 3121 /** | 3201 /** |
| 3122 * Initialize a newly created synthetic function element. | 3202 * Initialize a newly created synthetic function element. |
| 3123 */ | 3203 */ |
| 3124 FunctionElementImpl() : super.con2("", -1) { | 3204 FunctionElementImpl() : super.con2("", -1) { |
| 3125 _jtd_constructor_206_impl(); | 3205 _jtd_constructor_207_impl(); |
| 3126 } | 3206 } |
| 3127 _jtd_constructor_206_impl() { | 3207 _jtd_constructor_207_impl() { |
| 3128 synthetic = true; | 3208 synthetic = true; |
| 3129 } | 3209 } |
| 3130 | 3210 |
| 3131 /** | 3211 /** |
| 3132 * Initialize a newly created function element to have the given name. | 3212 * Initialize a newly created function element to have the given name. |
| 3133 * @param name the name of this element | 3213 * @param name the name of this element |
| 3134 */ | 3214 */ |
| 3135 FunctionElementImpl.con1(Identifier name) : super.con1(name) { | 3215 FunctionElementImpl.con1(Identifier name) : super.con1(name) { |
| 3136 _jtd_constructor_207_impl(name); | 3216 _jtd_constructor_208_impl(name); |
| 3137 } | 3217 } |
| 3138 _jtd_constructor_207_impl(Identifier name) { | 3218 _jtd_constructor_208_impl(Identifier name) { |
| 3139 } | 3219 } |
| 3140 | 3220 |
| 3141 /** | 3221 /** |
| 3142 * Initialize a newly created function element to have no name and the given o
ffset. This is used | 3222 * Initialize a newly created function element to have no name and the given o
ffset. This is used |
| 3143 * for function expressions, which have no name. | 3223 * for function expressions, which have no name. |
| 3144 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3224 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 3145 * declaration of this element | 3225 * declaration of this element |
| 3146 */ | 3226 */ |
| 3147 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) { | 3227 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) { |
| 3148 _jtd_constructor_208_impl(nameOffset); | 3228 _jtd_constructor_209_impl(nameOffset); |
| 3149 } | 3229 } |
| 3150 _jtd_constructor_208_impl(int nameOffset) { | 3230 _jtd_constructor_209_impl(int nameOffset) { |
| 3151 } | 3231 } |
| 3152 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); | 3232 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); |
| 3153 String get identifier => "${name}@${nameOffset}"; | 3233 String get identifier => "${name}@${nameOffset}"; |
| 3154 ElementKind get kind => ElementKind.FUNCTION; | 3234 ElementKind get kind => ElementKind.FUNCTION; |
| 3155 SourceRange get visibleRange { | 3235 SourceRange get visibleRange { |
| 3156 if (_visibleRangeLength < 0) { | 3236 if (_visibleRangeLength < 0) { |
| 3157 return null; | 3237 return null; |
| 3158 } | 3238 } |
| 3159 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 3239 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 3160 } | 3240 } |
| 3161 bool isStatic() => enclosingElement is CompilationUnitElement; | 3241 bool isStatic() => enclosingElement is CompilationUnitElement; |
| 3162 | 3242 |
| 3163 /** | 3243 /** |
| 3164 * 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 |
| 3165 * length. | 3245 * length. |
| 3166 * @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 |
| 3167 * @param length the length of the visible range for this element, or {@code -
1} if this element | 3247 * @param length the length of the visible range for this element, or `-1` if
this element |
| 3168 * does not have a visible range | 3248 * does not have a visible range |
| 3169 */ | 3249 */ |
| 3170 void setVisibleRange(int offset, int length) { | 3250 void setVisibleRange(int offset, int length) { |
| 3171 _visibleRangeOffset = offset; | 3251 _visibleRangeOffset = offset; |
| 3172 _visibleRangeLength = length; | 3252 _visibleRangeLength = length; |
| 3173 } | 3253 } |
| 3174 void appendTo(JavaStringBuilder builder) { | 3254 void appendTo(JavaStringBuilder builder) { |
| 3175 String name = displayName; | 3255 String name = displayName; |
| 3176 if (name != null) { | 3256 if (name != null) { |
| 3177 builder.append(name); | 3257 builder.append(name); |
| 3178 } | 3258 } |
| 3179 super.appendTo(builder); | 3259 super.appendTo(builder); |
| 3180 } | 3260 } |
| 3181 } | 3261 } |
| 3182 /** | 3262 /** |
| 3183 * Instances of the class {@code FunctionTypeAliasElementImpl} implement a{@code
FunctionTypeAliasElement}. | 3263 * Instances of the class `FunctionTypeAliasElementImpl` implement a`FunctionTyp
eAliasElement`. |
| 3184 * @coverage dart.engine.element | 3264 * @coverage dart.engine.element |
| 3185 */ | 3265 */ |
| 3186 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl
iasElement { | 3266 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl
iasElement { |
| 3187 | 3267 |
| 3188 /** | 3268 /** |
| 3189 * An array containing all of the parameters defined by this type alias. | 3269 * An array containing all of the parameters defined by this type alias. |
| 3190 */ | 3270 */ |
| 3191 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; | 3271 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; |
| 3192 | 3272 |
| 3193 /** | 3273 /** |
| 3274 * The return type defined by this type alias. |
| 3275 */ |
| 3276 Type2 _returnType; |
| 3277 |
| 3278 /** |
| 3194 * The type of function defined by this type alias. | 3279 * The type of function defined by this type alias. |
| 3195 */ | 3280 */ |
| 3196 FunctionType _type; | 3281 FunctionType _type; |
| 3197 | 3282 |
| 3198 /** | 3283 /** |
| 3199 * An array containing all of the type variables defined for this type. | 3284 * An array containing all of the type variables defined for this type. |
| 3200 */ | 3285 */ |
| 3201 List<TypeVariableElement> _typeVariables = TypeVariableElementImpl.EMPTY_ARRAY
; | 3286 List<TypeVariableElement> _typeVariables = TypeVariableElementImpl.EMPTY_ARRAY
; |
| 3202 | 3287 |
| 3203 /** | 3288 /** |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3221 for (TypeVariableElement typeVariable in _typeVariables) { | 3306 for (TypeVariableElement typeVariable in _typeVariables) { |
| 3222 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2)
{ | 3307 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier2)
{ |
| 3223 return typeVariable as TypeVariableElementImpl; | 3308 return typeVariable as TypeVariableElementImpl; |
| 3224 } | 3309 } |
| 3225 } | 3310 } |
| 3226 return null; | 3311 return null; |
| 3227 } | 3312 } |
| 3228 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi
lationUnitElement; | 3313 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi
lationUnitElement; |
| 3229 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS; | 3314 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS; |
| 3230 List<ParameterElement> get parameters => _parameters; | 3315 List<ParameterElement> get parameters => _parameters; |
| 3316 Type2 get returnType => _returnType; |
| 3231 FunctionType get type => _type; | 3317 FunctionType get type => _type; |
| 3232 List<TypeVariableElement> get typeVariables => _typeVariables; | 3318 List<TypeVariableElement> get typeVariables => _typeVariables; |
| 3233 | 3319 |
| 3234 /** | 3320 /** |
| 3235 * Set the parameters defined by this type alias to the given parameters. | 3321 * Set the parameters defined by this type alias to the given parameters. |
| 3236 * @param parameters the parameters defined by this type alias | 3322 * @param parameters the parameters defined by this type alias |
| 3237 */ | 3323 */ |
| 3238 void set parameters(List<ParameterElement> parameters2) { | 3324 void set parameters(List<ParameterElement> parameters2) { |
| 3239 if (parameters2 != null) { | 3325 if (parameters2 != null) { |
| 3240 for (ParameterElement parameter in parameters2) { | 3326 for (ParameterElement parameter in parameters2) { |
| 3241 ((parameter as ParameterElementImpl)).enclosingElement = this; | 3327 ((parameter as ParameterElementImpl)).enclosingElement = this; |
| 3242 } | 3328 } |
| 3243 } | 3329 } |
| 3244 this._parameters = parameters2; | 3330 this._parameters = parameters2; |
| 3245 } | 3331 } |
| 3246 | 3332 |
| 3247 /** | 3333 /** |
| 3334 * Set the return type defined by this type alias. |
| 3335 * @param returnType the return type defined by this type alias |
| 3336 */ |
| 3337 void set returnType(Type2 returnType2) { |
| 3338 this._returnType = returnType2; |
| 3339 } |
| 3340 |
| 3341 /** |
| 3248 * Set the type of function defined by this type alias to the given type. | 3342 * Set the type of function defined by this type alias to the given type. |
| 3249 * @param type the type of function defined by this type alias | 3343 * @param type the type of function defined by this type alias |
| 3250 */ | 3344 */ |
| 3251 void set type(FunctionType type2) { | 3345 void set type(FunctionType type2) { |
| 3252 this._type = type2; | 3346 this._type = type2; |
| 3253 } | 3347 } |
| 3254 | 3348 |
| 3255 /** | 3349 /** |
| 3256 * Set the type variables defined for this type to the given variables. | 3350 * Set the type variables defined for this type to the given variables. |
| 3257 * @param typeVariables the type variables defined for this type | 3351 * @param typeVariables the type variables defined for this type |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3290 ((_parameters[i] as ParameterElementImpl)).appendTo(builder); | 3384 ((_parameters[i] as ParameterElementImpl)).appendTo(builder); |
| 3291 } | 3385 } |
| 3292 builder.append(")"); | 3386 builder.append(")"); |
| 3293 if (_type != null) { | 3387 if (_type != null) { |
| 3294 builder.append(" -> "); | 3388 builder.append(" -> "); |
| 3295 builder.append(_type.returnType); | 3389 builder.append(_type.returnType); |
| 3296 } | 3390 } |
| 3297 } | 3391 } |
| 3298 } | 3392 } |
| 3299 /** | 3393 /** |
| 3300 * Instances of the class {@code HideElementCombinatorImpl} implement a{@link Hi
deElementCombinator}. | 3394 * Instances of the class `HideElementCombinatorImpl` implement a[HideElementCom
binator]. |
| 3301 * @coverage dart.engine.element | 3395 * @coverage dart.engine.element |
| 3302 */ | 3396 */ |
| 3303 class HideElementCombinatorImpl implements HideElementCombinator { | 3397 class HideElementCombinatorImpl implements HideElementCombinator { |
| 3304 | 3398 |
| 3305 /** | 3399 /** |
| 3306 * The names that are not to be made visible in the importing library even if
they are defined in | 3400 * The names that are not to be made visible in the importing library even if
they are defined in |
| 3307 * the imported library. | 3401 * the imported library. |
| 3308 */ | 3402 */ |
| 3309 List<String> _hiddenNames = StringUtilities.EMPTY_ARRAY; | 3403 List<String> _hiddenNames = StringUtilities.EMPTY_ARRAY; |
| 3310 List<String> get hiddenNames => _hiddenNames; | 3404 List<String> get hiddenNames => _hiddenNames; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3324 for (int i = 0; i < count; i++) { | 3418 for (int i = 0; i < count; i++) { |
| 3325 if (i > 0) { | 3419 if (i > 0) { |
| 3326 builder.append(", "); | 3420 builder.append(", "); |
| 3327 } | 3421 } |
| 3328 builder.append(_hiddenNames[i]); | 3422 builder.append(_hiddenNames[i]); |
| 3329 } | 3423 } |
| 3330 return builder.toString(); | 3424 return builder.toString(); |
| 3331 } | 3425 } |
| 3332 } | 3426 } |
| 3333 /** | 3427 /** |
| 3334 * Instances of the class {@code HtmlElementImpl} implement an {@link HtmlElemen
t}. | 3428 * Instances of the class `HtmlElementImpl` implement an [HtmlElement]. |
| 3335 * @coverage dart.engine.element | 3429 * @coverage dart.engine.element |
| 3336 */ | 3430 */ |
| 3337 class HtmlElementImpl extends ElementImpl implements HtmlElement { | 3431 class HtmlElementImpl extends ElementImpl implements HtmlElement { |
| 3338 | 3432 |
| 3339 /** | 3433 /** |
| 3340 * An empty array of HTML file elements. | 3434 * An empty array of HTML file elements. |
| 3341 */ | 3435 */ |
| 3342 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0); | 3436 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0); |
| 3343 | 3437 |
| 3344 /** | 3438 /** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3399 } | 3493 } |
| 3400 void appendTo(JavaStringBuilder builder) { | 3494 void appendTo(JavaStringBuilder builder) { |
| 3401 if (_source == null) { | 3495 if (_source == null) { |
| 3402 builder.append("{HTML file}"); | 3496 builder.append("{HTML file}"); |
| 3403 } else { | 3497 } else { |
| 3404 builder.append(_source.fullName); | 3498 builder.append(_source.fullName); |
| 3405 } | 3499 } |
| 3406 } | 3500 } |
| 3407 } | 3501 } |
| 3408 /** | 3502 /** |
| 3409 * Instances of the class {@code HtmlScriptElementImpl} implement an {@link Html
ScriptElement}. | 3503 * Instances of the class `HtmlScriptElementImpl` implement an [HtmlScriptElemen
t]. |
| 3410 * @coverage dart.engine.element | 3504 * @coverage dart.engine.element |
| 3411 */ | 3505 */ |
| 3412 abstract class HtmlScriptElementImpl extends ElementImpl implements HtmlScriptEl
ement { | 3506 abstract class HtmlScriptElementImpl extends ElementImpl implements HtmlScriptEl
ement { |
| 3413 | 3507 |
| 3414 /** | 3508 /** |
| 3415 * An empty array of HTML script elements. | 3509 * An empty array of HTML script elements. |
| 3416 */ | 3510 */ |
| 3417 static List<HtmlScriptElement> EMPTY_ARRAY = new List<HtmlScriptElement>(0); | 3511 static List<HtmlScriptElement> EMPTY_ARRAY = new List<HtmlScriptElement>(0); |
| 3418 | 3512 |
| 3419 /** | 3513 /** |
| 3420 * Initialize a newly created script element to have the specified tag name an
d offset. | 3514 * Initialize a newly created script element to have the specified tag name an
d offset. |
| 3421 * @param node the XML node from which this element is derived (not {@code nul
l}) | 3515 * @param node the XML node from which this element is derived (not `null`) |
| 3422 */ | 3516 */ |
| 3423 HtmlScriptElementImpl(XmlTagNode node) : super.con2(node.tag.lexeme, node.tag.
offset) { | 3517 HtmlScriptElementImpl(XmlTagNode node) : super.con2(node.tag.lexeme, node.tag.
offset) { |
| 3424 } | 3518 } |
| 3425 } | 3519 } |
| 3426 /** | 3520 /** |
| 3427 * Instances of the class {@code ImportElementImpl} implement an {@link ImportEl
ement}. | 3521 * Instances of the class `ImportElementImpl` implement an [ImportElement]. |
| 3428 * @coverage dart.engine.element | 3522 * @coverage dart.engine.element |
| 3429 */ | 3523 */ |
| 3430 class ImportElementImpl extends ElementImpl implements ImportElement { | 3524 class ImportElementImpl extends ElementImpl implements ImportElement { |
| 3431 | 3525 |
| 3432 /** | 3526 /** |
| 3433 * The URI that is specified by this directive. | 3527 * The URI that is specified by this directive. |
| 3434 */ | 3528 */ |
| 3435 String _uri; | 3529 String _uri; |
| 3436 | 3530 |
| 3437 /** | 3531 /** |
| 3438 * The library that is imported into this library by this import directive. | 3532 * The library that is imported into this library by this import directive. |
| 3439 */ | 3533 */ |
| 3440 LibraryElement _importedLibrary; | 3534 LibraryElement _importedLibrary; |
| 3441 | 3535 |
| 3442 /** | 3536 /** |
| 3443 * The combinators that were specified as part of the import directive in the
order in which they | 3537 * The combinators that were specified as part of the import directive in the
order in which they |
| 3444 * were specified. | 3538 * were specified. |
| 3445 */ | 3539 */ |
| 3446 List<NamespaceCombinator> _combinators = NamespaceCombinator.EMPTY_ARRAY; | 3540 List<NamespaceCombinator> _combinators = NamespaceCombinator.EMPTY_ARRAY; |
| 3447 | 3541 |
| 3448 /** | 3542 /** |
| 3449 * The prefix that was specified as part of the import directive, or {@code nu
ll} if there was no | 3543 * The prefix that was specified as part of the import directive, or `null` if
there was no |
| 3450 * prefix specified. | 3544 * prefix specified. |
| 3451 */ | 3545 */ |
| 3452 PrefixElement _prefix; | 3546 PrefixElement _prefix; |
| 3453 | 3547 |
| 3454 /** | 3548 /** |
| 3455 * Initialize a newly created import element. | 3549 * Initialize a newly created import element. |
| 3456 */ | 3550 */ |
| 3457 ImportElementImpl() : super.con1(null) { | 3551 ImportElementImpl() : super.con1(null) { |
| 3458 } | 3552 } |
| 3459 accept(ElementVisitor visitor) => visitor.visitImportElement(this); | 3553 accept(ElementVisitor visitor) => visitor.visitImportElement(this); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3500 super.visitChildren(visitor); | 3594 super.visitChildren(visitor); |
| 3501 safelyVisitChild(_prefix, visitor); | 3595 safelyVisitChild(_prefix, visitor); |
| 3502 } | 3596 } |
| 3503 void appendTo(JavaStringBuilder builder) { | 3597 void appendTo(JavaStringBuilder builder) { |
| 3504 builder.append("import "); | 3598 builder.append("import "); |
| 3505 ((_importedLibrary as LibraryElementImpl)).appendTo(builder); | 3599 ((_importedLibrary as LibraryElementImpl)).appendTo(builder); |
| 3506 } | 3600 } |
| 3507 String get identifier => ((_importedLibrary as LibraryElementImpl)).identifier
; | 3601 String get identifier => ((_importedLibrary as LibraryElementImpl)).identifier
; |
| 3508 } | 3602 } |
| 3509 /** | 3603 /** |
| 3510 * Instances of the class {@code LabelElementImpl} implement a {@code LabelEleme
nt}. | 3604 * Instances of the class `LabelElementImpl` implement a `LabelElement`. |
| 3511 * @coverage dart.engine.element | 3605 * @coverage dart.engine.element |
| 3512 */ | 3606 */ |
| 3513 class LabelElementImpl extends ElementImpl implements LabelElement { | 3607 class LabelElementImpl extends ElementImpl implements LabelElement { |
| 3514 | 3608 |
| 3515 /** | 3609 /** |
| 3516 * A flag indicating whether this label is associated with a {@code switch} st
atement. | 3610 * A flag indicating whether this label is associated with a `switch` statemen
t. |
| 3517 */ | 3611 */ |
| 3518 bool _onSwitchStatement = false; | 3612 bool _onSwitchStatement = false; |
| 3519 | 3613 |
| 3520 /** | 3614 /** |
| 3521 * A flag indicating whether this label is associated with a {@code switch} me
mber ({@code case}or {@code default}). | 3615 * A flag indicating whether this label is associated with a `switch` member (
`case`or `default`). |
| 3522 */ | 3616 */ |
| 3523 bool _onSwitchMember = false; | 3617 bool _onSwitchMember = false; |
| 3524 | 3618 |
| 3525 /** | 3619 /** |
| 3526 * An empty array of label elements. | 3620 * An empty array of label elements. |
| 3527 */ | 3621 */ |
| 3528 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0); | 3622 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0); |
| 3529 | 3623 |
| 3530 /** | 3624 /** |
| 3531 * Initialize a newly created label element to have the given name. | 3625 * Initialize a newly created label element to have the given name. |
| 3532 * @param name the name of this element | 3626 * @param name the name of this element |
| 3533 * @param onSwitchStatement {@code true} if this label is associated with a {@
code switch}statement | 3627 * @param onSwitchStatement `true` if this label is associated with a `switch`
statement |
| 3534 * @param onSwitchMember {@code true} if this label is associated with a {@cod
e switch} member | 3628 * @param onSwitchMember `true` if this label is associated with a `switch` me
mber |
| 3535 */ | 3629 */ |
| 3536 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember)
: super.con1(name) { | 3630 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember)
: super.con1(name) { |
| 3537 this._onSwitchStatement = onSwitchStatement; | 3631 this._onSwitchStatement = onSwitchStatement; |
| 3538 this._onSwitchMember = onSwitchMember; | 3632 this._onSwitchMember = onSwitchMember; |
| 3539 } | 3633 } |
| 3540 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); | 3634 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); |
| 3541 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; | 3635 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; |
| 3542 ElementKind get kind => ElementKind.LABEL; | 3636 ElementKind get kind => ElementKind.LABEL; |
| 3543 | 3637 |
| 3544 /** | 3638 /** |
| 3545 * Return {@code true} if this label is associated with a {@code switch} membe
r ({@code case} or{@code default}). | 3639 * Return `true` if this label is associated with a `switch` member (`case` or
`default`). |
| 3546 * @return {@code true} if this label is associated with a {@code switch} memb
er | 3640 * @return `true` if this label is associated with a `switch` member |
| 3547 */ | 3641 */ |
| 3548 bool isOnSwitchMember() => _onSwitchMember; | 3642 bool isOnSwitchMember() => _onSwitchMember; |
| 3549 | 3643 |
| 3550 /** | 3644 /** |
| 3551 * Return {@code true} if this label is associated with a {@code switch} state
ment. | 3645 * Return `true` if this label is associated with a `switch` statement. |
| 3552 * @return {@code true} if this label is associated with a {@code switch} stat
ement | 3646 * @return `true` if this label is associated with a `switch` statement |
| 3553 */ | 3647 */ |
| 3554 bool isOnSwitchStatement() => _onSwitchStatement; | 3648 bool isOnSwitchStatement() => _onSwitchStatement; |
| 3555 } | 3649 } |
| 3556 /** | 3650 /** |
| 3557 * Instances of the class {@code LibraryElementImpl} implement a {@code LibraryE
lement}. | 3651 * Instances of the class `LibraryElementImpl` implement a `LibraryElement`. |
| 3558 * @coverage dart.engine.element | 3652 * @coverage dart.engine.element |
| 3559 */ | 3653 */ |
| 3560 class LibraryElementImpl extends ElementImpl implements LibraryElement { | 3654 class LibraryElementImpl extends ElementImpl implements LibraryElement { |
| 3561 | 3655 |
| 3562 /** | 3656 /** |
| 3563 * An empty array of library elements. | 3657 * An empty array of library elements. |
| 3564 */ | 3658 */ |
| 3565 static List<LibraryElement> EMPTY_ARRAY = new List<LibraryElement>(0); | 3659 static List<LibraryElement> EMPTY_ARRAY = new List<LibraryElement>(0); |
| 3566 | 3660 |
| 3567 /** | 3661 /** |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3599 * The analysis context in which this library is defined. | 3693 * The analysis context in which this library is defined. |
| 3600 */ | 3694 */ |
| 3601 AnalysisContext _context; | 3695 AnalysisContext _context; |
| 3602 | 3696 |
| 3603 /** | 3697 /** |
| 3604 * The compilation unit that defines this library. | 3698 * The compilation unit that defines this library. |
| 3605 */ | 3699 */ |
| 3606 CompilationUnitElement _definingCompilationUnit; | 3700 CompilationUnitElement _definingCompilationUnit; |
| 3607 | 3701 |
| 3608 /** | 3702 /** |
| 3609 * The entry point for this library, or {@code null} if this library does not
have an entry point. | 3703 * The entry point for this library, or `null` if this library does not have a
n entry point. |
| 3610 */ | 3704 */ |
| 3611 FunctionElement _entryPoint; | 3705 FunctionElement _entryPoint; |
| 3612 | 3706 |
| 3613 /** | 3707 /** |
| 3614 * An array containing specifications of all of the imports defined in this li
brary. | 3708 * An array containing specifications of all of the imports defined in this li
brary. |
| 3615 */ | 3709 */ |
| 3616 List<ImportElement> _imports = ImportElement.EMPTY_ARRAY; | 3710 List<ImportElement> _imports = ImportElement.EMPTY_ARRAY; |
| 3617 | 3711 |
| 3618 /** | 3712 /** |
| 3619 * An array containing specifications of all of the exports defined in this li
brary. | 3713 * An array containing specifications of all of the exports defined in this li
brary. |
| 3620 */ | 3714 */ |
| 3621 List<ExportElement> _exports = ExportElement.EMPTY_ARRAY; | 3715 List<ExportElement> _exports = ExportElement.EMPTY_ARRAY; |
| 3622 | 3716 |
| 3623 /** | 3717 /** |
| 3624 * An array containing all of the compilation units that are included in this
library using a{@code part} directive. | 3718 * An array containing all of the compilation units that are included in this
library using a`part` directive. |
| 3625 */ | 3719 */ |
| 3626 List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY; | 3720 List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY; |
| 3627 | 3721 |
| 3628 /** | 3722 /** |
| 3629 * Initialize a newly created library element to have the given name. | 3723 * Initialize a newly created library element to have the given name. |
| 3630 * @param context the analysis context in which the library is defined | 3724 * @param context the analysis context in which the library is defined |
| 3631 * @param name the name of this element | 3725 * @param name the name of this element |
| 3632 */ | 3726 */ |
| 3633 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.co
n1(name) { | 3727 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.co
n1(name) { |
| 3634 this._context = context; | 3728 this._context = context; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3759 ((importElement as ImportElementImpl)).enclosingElement = this; | 3853 ((importElement as ImportElementImpl)).enclosingElement = this; |
| 3760 PrefixElementImpl prefix = importElement.prefix as PrefixElementImpl; | 3854 PrefixElementImpl prefix = importElement.prefix as PrefixElementImpl; |
| 3761 if (prefix != null) { | 3855 if (prefix != null) { |
| 3762 prefix.enclosingElement = this; | 3856 prefix.enclosingElement = this; |
| 3763 } | 3857 } |
| 3764 } | 3858 } |
| 3765 this._imports = imports2; | 3859 this._imports = imports2; |
| 3766 } | 3860 } |
| 3767 | 3861 |
| 3768 /** | 3862 /** |
| 3769 * Set the compilation units that are included in this library using a {@code
part} directive. | 3863 * Set the compilation units that are included in this library using a `part`
directive. |
| 3770 * @param parts the compilation units that are included in this library using
a {@code part}directive | 3864 * @param parts the compilation units that are included in this library using
a `part`directive |
| 3771 */ | 3865 */ |
| 3772 void set parts(List<CompilationUnitElement> parts2) { | 3866 void set parts(List<CompilationUnitElement> parts2) { |
| 3773 for (CompilationUnitElement compilationUnit in parts2) { | 3867 for (CompilationUnitElement compilationUnit in parts2) { |
| 3774 ((compilationUnit as CompilationUnitElementImpl)).enclosingElement = this; | 3868 ((compilationUnit as CompilationUnitElementImpl)).enclosingElement = this; |
| 3775 } | 3869 } |
| 3776 this._parts = parts2; | 3870 this._parts = parts2; |
| 3777 } | 3871 } |
| 3778 void visitChildren(ElementVisitor<Object> visitor) { | 3872 void visitChildren(ElementVisitor<Object> visitor) { |
| 3779 super.visitChildren(visitor); | 3873 super.visitChildren(visitor); |
| 3780 safelyVisitChild(_definingCompilationUnit, visitor); | 3874 safelyVisitChild(_definingCompilationUnit, visitor); |
| 3781 safelyVisitChildren(_exports, visitor); | 3875 safelyVisitChildren(_exports, visitor); |
| 3782 safelyVisitChildren(_imports, visitor); | 3876 safelyVisitChildren(_imports, visitor); |
| 3783 safelyVisitChildren(_parts, visitor); | 3877 safelyVisitChildren(_parts, visitor); |
| 3784 } | 3878 } |
| 3785 | 3879 |
| 3786 /** | 3880 /** |
| 3787 * Answer {@code 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. |
| 3788 * @return {@code true} if the receiver directly or indirectly imports the dar
t:html libraries | 3882 * @return `true` if the receiver directly or indirectly imports the dart:html
libraries |
| 3789 */ | 3883 */ |
| 3790 bool isOrImportsBrowserLibrary() { | 3884 bool isOrImportsBrowserLibrary() { |
| 3791 List<LibraryElement> visited = new List<LibraryElement>(); | 3885 List<LibraryElement> visited = new List<LibraryElement>(); |
| 3792 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); | 3886 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); |
| 3793 visited.add(this); | 3887 visited.add(this); |
| 3794 for (int index = 0; index < visited.length; index++) { | 3888 for (int index = 0; index < visited.length; index++) { |
| 3795 LibraryElement library = visited[index]; | 3889 LibraryElement library = visited[index]; |
| 3796 Source source = library.definingCompilationUnit.source; | 3890 Source source = library.definingCompilationUnit.source; |
| 3797 if (source == htmlLibSource) { | 3891 if (source == htmlLibSource) { |
| 3798 return true; | 3892 return true; |
| 3799 } | 3893 } |
| 3800 for (LibraryElement importedLibrary in library.importedLibraries) { | 3894 for (LibraryElement importedLibrary in library.importedLibraries) { |
| 3801 if (!visited.contains(importedLibrary)) { | 3895 if (!visited.contains(importedLibrary)) { |
| 3802 visited.add(importedLibrary); | 3896 visited.add(importedLibrary); |
| 3803 } | 3897 } |
| 3804 } | 3898 } |
| 3805 for (LibraryElement exportedLibrary in library.exportedLibraries) { | 3899 for (LibraryElement exportedLibrary in library.exportedLibraries) { |
| 3806 if (!visited.contains(exportedLibrary)) { | 3900 if (!visited.contains(exportedLibrary)) { |
| 3807 visited.add(exportedLibrary); | 3901 visited.add(exportedLibrary); |
| 3808 } | 3902 } |
| 3809 } | 3903 } |
| 3810 } | 3904 } |
| 3811 return false; | 3905 return false; |
| 3812 } | 3906 } |
| 3813 } | 3907 } |
| 3814 /** | 3908 /** |
| 3815 * Instances of the class {@code LocalVariableElementImpl} implement a {@code Lo
calVariableElement}. | 3909 * Instances of the class `LocalVariableElementImpl` implement a `LocalVariableE
lement`. |
| 3816 * @coverage dart.engine.element | 3910 * @coverage dart.engine.element |
| 3817 */ | 3911 */ |
| 3818 class LocalVariableElementImpl extends VariableElementImpl implements LocalVaria
bleElement { | 3912 class LocalVariableElementImpl extends VariableElementImpl implements LocalVaria
bleElement { |
| 3819 | 3913 |
| 3820 /** | 3914 /** |
| 3821 * The offset to the beginning of the visible range for this element. | 3915 * The offset to the beginning of the visible range for this element. |
| 3822 */ | 3916 */ |
| 3823 int _visibleRangeOffset = 0; | 3917 int _visibleRangeOffset = 0; |
| 3824 | 3918 |
| 3825 /** | 3919 /** |
| 3826 * The length of the visible range for this element, or {@code -1} if this ele
ment does not have a | 3920 * The length of the visible range for this element, or `-1` if this element d
oes not have a |
| 3827 * visible range. | 3921 * visible range. |
| 3828 */ | 3922 */ |
| 3829 int _visibleRangeLength = -1; | 3923 int _visibleRangeLength = -1; |
| 3830 | 3924 |
| 3831 /** | 3925 /** |
| 3832 * An empty array of field elements. | 3926 * An empty array of field elements. |
| 3833 */ | 3927 */ |
| 3834 static List<LocalVariableElement> EMPTY_ARRAY = new List<LocalVariableElement>
(0); | 3928 static List<LocalVariableElement> EMPTY_ARRAY = new List<LocalVariableElement>
(0); |
| 3835 | 3929 |
| 3836 /** | 3930 /** |
| 3837 * Initialize a newly created local variable element to have the given name. | 3931 * Initialize a newly created local variable element to have the given name. |
| 3838 * @param name the name of this element | 3932 * @param name the name of this element |
| 3839 */ | 3933 */ |
| 3840 LocalVariableElementImpl(Identifier name) : super.con1(name) { | 3934 LocalVariableElementImpl(Identifier name) : super.con1(name) { |
| 3841 } | 3935 } |
| 3842 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this); | 3936 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this); |
| 3843 ElementKind get kind => ElementKind.LOCAL_VARIABLE; | 3937 ElementKind get kind => ElementKind.LOCAL_VARIABLE; |
| 3844 SourceRange get visibleRange { | 3938 SourceRange get visibleRange { |
| 3845 if (_visibleRangeLength < 0) { | 3939 if (_visibleRangeLength < 0) { |
| 3846 return null; | 3940 return null; |
| 3847 } | 3941 } |
| 3848 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 3942 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 3849 } | 3943 } |
| 3850 | 3944 |
| 3851 /** | 3945 /** |
| 3852 * Set the visible range for this element to the range starting at the given o
ffset with the given | 3946 * Set the visible range for this element to the range starting at the given o
ffset with the given |
| 3853 * length. | 3947 * length. |
| 3854 * @param offset the offset to the beginning of the visible range for this ele
ment | 3948 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 3855 * @param length the length of the visible range for this element, or {@code -
1} if this element | 3949 * @param length the length of the visible range for this element, or `-1` if
this element |
| 3856 * does not have a visible range | 3950 * does not have a visible range |
| 3857 */ | 3951 */ |
| 3858 void setVisibleRange(int offset, int length) { | 3952 void setVisibleRange(int offset, int length) { |
| 3859 _visibleRangeOffset = offset; | 3953 _visibleRangeOffset = offset; |
| 3860 _visibleRangeLength = length; | 3954 _visibleRangeLength = length; |
| 3861 } | 3955 } |
| 3862 void appendTo(JavaStringBuilder builder) { | 3956 void appendTo(JavaStringBuilder builder) { |
| 3863 builder.append(type); | 3957 builder.append(type); |
| 3864 builder.append(" "); | 3958 builder.append(" "); |
| 3865 builder.append(displayName); | 3959 builder.append(displayName); |
| 3866 } | 3960 } |
| 3867 String get identifier => "${super.identifier}@${nameOffset}"; | 3961 String get identifier => "${super.identifier}@${nameOffset}"; |
| 3868 } | 3962 } |
| 3869 /** | 3963 /** |
| 3870 * Instances of the class {@code MethodElementImpl} implement a {@code MethodEle
ment}. | 3964 * Instances of the class `MethodElementImpl` implement a `MethodElement`. |
| 3871 * @coverage dart.engine.element | 3965 * @coverage dart.engine.element |
| 3872 */ | 3966 */ |
| 3873 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { | 3967 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { |
| 3874 | 3968 |
| 3875 /** | 3969 /** |
| 3876 * An empty array of method elements. | 3970 * An empty array of method elements. |
| 3877 */ | 3971 */ |
| 3878 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0); | 3972 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0); |
| 3879 | 3973 |
| 3880 /** | 3974 /** |
| 3881 * Initialize a newly created method element to have the given name. | 3975 * Initialize a newly created method element to have the given name. |
| 3882 * @param name the name of this element | 3976 * @param name the name of this element |
| 3883 */ | 3977 */ |
| 3884 MethodElementImpl.con1(Identifier name) : super.con1(name) { | 3978 MethodElementImpl.con1(Identifier name) : super.con1(name) { |
| 3885 _jtd_constructor_217_impl(name); | 3979 _jtd_constructor_218_impl(name); |
| 3886 } | 3980 } |
| 3887 _jtd_constructor_217_impl(Identifier name) { | 3981 _jtd_constructor_218_impl(Identifier name) { |
| 3888 } | 3982 } |
| 3889 | 3983 |
| 3890 /** | 3984 /** |
| 3891 * Initialize a newly created method element to have the given name. | 3985 * Initialize a newly created method element to have the given name. |
| 3892 * @param name the name of this element | 3986 * @param name the name of this element |
| 3893 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3987 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 3894 * declaration of this element | 3988 * declaration of this element |
| 3895 */ | 3989 */ |
| 3896 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { | 3990 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { |
| 3897 _jtd_constructor_218_impl(name, nameOffset); | 3991 _jtd_constructor_219_impl(name, nameOffset); |
| 3898 } | 3992 } |
| 3899 _jtd_constructor_218_impl(String name, int nameOffset) { | 3993 _jtd_constructor_219_impl(String name, int nameOffset) { |
| 3900 } | 3994 } |
| 3901 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 3995 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
| 3902 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3996 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 3903 ElementKind get kind => ElementKind.METHOD; | 3997 ElementKind get kind => ElementKind.METHOD; |
| 3904 String get name { | 3998 String get name { |
| 3905 String name = super.name; | 3999 String name = super.name; |
| 3906 if (isOperator() && name == "-") { | 4000 if (isOperator() && name == "-") { |
| 3907 if (parameters.length == 0) { | 4001 if (parameters.length == 0) { |
| 3908 return "unary-"; | 4002 return "unary-"; |
| 3909 } | 4003 } |
| 3910 } | 4004 } |
| 3911 return super.name; | 4005 return super.name; |
| 3912 } | 4006 } |
| 3913 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 4007 bool isAbstract() => hasModifier(Modifier.ABSTRACT); |
| 3914 bool isOperator() { | 4008 bool isOperator() { |
| 3915 String name = displayName; | 4009 String name = displayName; |
| 3916 if (name.isEmpty) { | 4010 if (name.isEmpty) { |
| 3917 return false; | 4011 return false; |
| 3918 } | 4012 } |
| 3919 int first = name.codeUnitAt(0); | 4013 int first = name.codeUnitAt(0); |
| 3920 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); |
| 3921 } | 4015 } |
| 3922 bool isStatic() => hasModifier(Modifier.STATIC); | 4016 bool isStatic() => hasModifier(Modifier.STATIC); |
| 3923 | 4017 |
| 3924 /** | 4018 /** |
| 3925 * 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. |
| 3926 * @param isAbstract {@code true} if the method is abstract | 4020 * @param isAbstract `true` if the method is abstract |
| 3927 */ | 4021 */ |
| 3928 void set abstract(bool isAbstract) { | 4022 void set abstract(bool isAbstract) { |
| 3929 setModifier(Modifier.ABSTRACT, isAbstract); | 4023 setModifier(Modifier.ABSTRACT, isAbstract); |
| 3930 } | 4024 } |
| 3931 | 4025 |
| 3932 /** | 4026 /** |
| 3933 * Set whether this method is static to correspond to the given value. | 4027 * Set whether this method is static to correspond to the given value. |
| 3934 * @param isStatic {@code true} if the method is static | 4028 * @param isStatic `true` if the method is static |
| 3935 */ | 4029 */ |
| 3936 void set static(bool isStatic) { | 4030 void set static(bool isStatic) { |
| 3937 setModifier(Modifier.STATIC, isStatic); | 4031 setModifier(Modifier.STATIC, isStatic); |
| 3938 } | 4032 } |
| 3939 void appendTo(JavaStringBuilder builder) { | 4033 void appendTo(JavaStringBuilder builder) { |
| 3940 builder.append(enclosingElement.displayName); | 4034 builder.append(enclosingElement.displayName); |
| 3941 builder.append("."); | 4035 builder.append("."); |
| 3942 builder.append(displayName); | 4036 builder.append(displayName); |
| 3943 super.appendTo(builder); | 4037 super.appendTo(builder); |
| 3944 } | 4038 } |
| 3945 } | 4039 } |
| 3946 /** | 4040 /** |
| 3947 * The enumeration {@code Modifier} defines constants for all of the modifiers d
efined by the Dart | 4041 * The enumeration `Modifier` defines constants for all of the modifiers defined
by the Dart |
| 3948 * language and for a few additional flags that are useful. | 4042 * language and for a few additional flags that are useful. |
| 3949 * @coverage dart.engine.element | 4043 * @coverage dart.engine.element |
| 3950 */ | 4044 */ |
| 3951 class Modifier implements Comparable<Modifier> { | 4045 class Modifier implements Comparable<Modifier> { |
| 3952 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0); | 4046 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0); |
| 3953 static final Modifier CONST = new Modifier('CONST', 1); | 4047 static final Modifier CONST = new Modifier('CONST', 1); |
| 3954 static final Modifier FACTORY = new Modifier('FACTORY', 2); | 4048 static final Modifier FACTORY = new Modifier('FACTORY', 2); |
| 3955 static final Modifier FINAL = new Modifier('FINAL', 3); | 4049 static final Modifier FINAL = new Modifier('FINAL', 3); |
| 3956 static final Modifier GETTER = new Modifier('GETTER', 4); | 4050 static final Modifier GETTER = new Modifier('GETTER', 4); |
| 3957 static final Modifier MIXIN = new Modifier('MIXIN', 5); | 4051 static final Modifier MIXIN = new Modifier('MIXIN', 5); |
| 3958 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 6); | 4052 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 6); |
| 3959 static final Modifier SETTER = new Modifier('SETTER', 7); | 4053 static final Modifier SETTER = new Modifier('SETTER', 7); |
| 3960 static final Modifier STATIC = new Modifier('STATIC', 8); | 4054 static final Modifier STATIC = new Modifier('STATIC', 8); |
| 3961 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9); | 4055 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9); |
| 3962 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10); | 4056 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10); |
| 3963 static final List<Modifier> values = [ABSTRACT, CONST, FACTORY, FINAL, GETTER,
MIXIN, REFERENCES_SUPER, SETTER, STATIC, SYNTHETIC, TYPEDEF]; | 4057 static final List<Modifier> values = [ABSTRACT, CONST, FACTORY, FINAL, GETTER,
MIXIN, REFERENCES_SUPER, SETTER, STATIC, SYNTHETIC, TYPEDEF]; |
| 3964 | 4058 |
| 3965 /// The name of this enum constant, as declared in the enum declaration. | 4059 /// The name of this enum constant, as declared in the enum declaration. |
| 3966 final String name; | 4060 final String name; |
| 3967 | 4061 |
| 3968 /// The position in the enum declaration. | 4062 /// The position in the enum declaration. |
| 3969 final int ordinal; | 4063 final int ordinal; |
| 3970 Modifier(this.name, this.ordinal) { | 4064 Modifier(this.name, this.ordinal) { |
| 3971 } | 4065 } |
| 3972 int compareTo(Modifier other) => ordinal - other.ordinal; | 4066 int compareTo(Modifier other) => ordinal - other.ordinal; |
| 3973 int get hashCode => ordinal; | 4067 int get hashCode => ordinal; |
| 3974 String toString() => name; | 4068 String toString() => name; |
| 3975 } | 4069 } |
| 3976 /** | 4070 /** |
| 3977 * Instances of the class {@code MultiplyDefinedElementImpl} represent a collect
ion of elements that | 4071 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of
elements that |
| 3978 * have the same name within the same scope. | 4072 * have the same name within the same scope. |
| 3979 * @coverage dart.engine.element | 4073 * @coverage dart.engine.element |
| 3980 */ | 4074 */ |
| 3981 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { | 4075 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { |
| 3982 | 4076 |
| 3983 /** | 4077 /** |
| 3984 * The analysis context in which the multiply defined elements are defined. | 4078 * The analysis context in which the multiply defined elements are defined. |
| 3985 */ | 4079 */ |
| 3986 AnalysisContext _context; | 4080 AnalysisContext _context; |
| 3987 | 4081 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4069 * @return an array containing all of the conflicting elements | 4163 * @return an array containing all of the conflicting elements |
| 4070 */ | 4164 */ |
| 4071 List<Element> computeConflictingElements(Element firstElement, Element secondE
lement) { | 4165 List<Element> computeConflictingElements(Element firstElement, Element secondE
lement) { |
| 4072 List<Element> elements = new List<Element>(); | 4166 List<Element> elements = new List<Element>(); |
| 4073 add(elements, firstElement); | 4167 add(elements, firstElement); |
| 4074 add(elements, secondElement); | 4168 add(elements, secondElement); |
| 4075 return new List.from(elements); | 4169 return new List.from(elements); |
| 4076 } | 4170 } |
| 4077 } | 4171 } |
| 4078 /** | 4172 /** |
| 4079 * Instances of the class {@code ParameterElementImpl} implement a {@code Parame
terElement}. | 4173 * Instances of the class `ParameterElementImpl` implement a `ParameterElement`. |
| 4080 * @coverage dart.engine.element | 4174 * @coverage dart.engine.element |
| 4081 */ | 4175 */ |
| 4082 class ParameterElementImpl extends VariableElementImpl implements ParameterEleme
nt { | 4176 class ParameterElementImpl extends VariableElementImpl implements ParameterEleme
nt { |
| 4083 | 4177 |
| 4084 /** | 4178 /** |
| 4085 * An array containing all of the parameters defined by this parameter element
. There will only be | 4179 * An array containing all of the parameters defined by this parameter element
. There will only be |
| 4086 * parameters if this parameter is a function typed parameter. | 4180 * parameters if this parameter is a function typed parameter. |
| 4087 */ | 4181 */ |
| 4088 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; | 4182 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; |
| 4089 | 4183 |
| 4090 /** | 4184 /** |
| 4091 * The kind of this parameter. | 4185 * The kind of this parameter. |
| 4092 */ | 4186 */ |
| 4093 ParameterKind _parameterKind; | 4187 ParameterKind _parameterKind; |
| 4094 | 4188 |
| 4095 /** | 4189 /** |
| 4096 * The offset to the beginning of the default value range for this element. | 4190 * The offset to the beginning of the default value range for this element. |
| 4097 */ | 4191 */ |
| 4098 int _defaultValueRangeOffset = 0; | 4192 int _defaultValueRangeOffset = 0; |
| 4099 | 4193 |
| 4100 /** | 4194 /** |
| 4101 * The length of the default value range for this element, or {@code -1} if th
is element does not | 4195 * The length of the default value range for this element, or `-1` if this ele
ment does not |
| 4102 * have a default value. | 4196 * have a default value. |
| 4103 */ | 4197 */ |
| 4104 int _defaultValueRangeLength = -1; | 4198 int _defaultValueRangeLength = -1; |
| 4105 | 4199 |
| 4106 /** | 4200 /** |
| 4107 * The offset to the beginning of the visible range for this element. | 4201 * The offset to the beginning of the visible range for this element. |
| 4108 */ | 4202 */ |
| 4109 int _visibleRangeOffset = 0; | 4203 int _visibleRangeOffset = 0; |
| 4110 | 4204 |
| 4111 /** | 4205 /** |
| 4112 * The length of the visible range for this element, or {@code -1} if this ele
ment does not have a | 4206 * The length of the visible range for this element, or `-1` if this element d
oes not have a |
| 4113 * visible range. | 4207 * visible range. |
| 4114 */ | 4208 */ |
| 4115 int _visibleRangeLength = -1; | 4209 int _visibleRangeLength = -1; |
| 4116 | 4210 |
| 4117 /** | 4211 /** |
| 4118 * An empty array of field elements. | 4212 * An empty array of field elements. |
| 4119 */ | 4213 */ |
| 4120 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0); | 4214 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0); |
| 4121 | 4215 |
| 4122 /** | 4216 /** |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4140 return null; | 4234 return null; |
| 4141 } | 4235 } |
| 4142 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 4236 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 4143 } | 4237 } |
| 4144 bool isInitializingFormal() => false; | 4238 bool isInitializingFormal() => false; |
| 4145 | 4239 |
| 4146 /** | 4240 /** |
| 4147 * 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 |
| 4148 * with the given length. | 4242 * with the given length. |
| 4149 * @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 |
| 4150 * @param length the length of the default value range for this element, or {@
code -1} if this | 4244 * @param length the length of the default value range for this element, or `-
1` if this |
| 4151 * element does not have a default value | 4245 * element does not have a default value |
| 4152 */ | 4246 */ |
| 4153 void setDefaultValueRange(int offset, int length) { | 4247 void setDefaultValueRange(int offset, int length) { |
| 4154 _defaultValueRangeOffset = offset; | 4248 _defaultValueRangeOffset = offset; |
| 4155 _defaultValueRangeLength = length; | 4249 _defaultValueRangeLength = length; |
| 4156 } | 4250 } |
| 4157 | 4251 |
| 4158 /** | 4252 /** |
| 4159 * Set the kind of this parameter to the given kind. | 4253 * Set the kind of this parameter to the given kind. |
| 4160 * @param parameterKind the new kind of this parameter | 4254 * @param parameterKind the new kind of this parameter |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4171 for (ParameterElement parameter in parameters2) { | 4265 for (ParameterElement parameter in parameters2) { |
| 4172 ((parameter as ParameterElementImpl)).enclosingElement = this; | 4266 ((parameter as ParameterElementImpl)).enclosingElement = this; |
| 4173 } | 4267 } |
| 4174 this._parameters = parameters2; | 4268 this._parameters = parameters2; |
| 4175 } | 4269 } |
| 4176 | 4270 |
| 4177 /** | 4271 /** |
| 4178 * Set the visible range for this element to the range starting at the given o
ffset with the given | 4272 * Set the visible range for this element to the range starting at the given o
ffset with the given |
| 4179 * length. | 4273 * length. |
| 4180 * @param offset the offset to the beginning of the visible range for this ele
ment | 4274 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 4181 * @param length the length of the visible range for this element, or {@code -
1} if this element | 4275 * @param length the length of the visible range for this element, or `-1` if
this element |
| 4182 * does not have a visible range | 4276 * does not have a visible range |
| 4183 */ | 4277 */ |
| 4184 void setVisibleRange(int offset, int length) { | 4278 void setVisibleRange(int offset, int length) { |
| 4185 _visibleRangeOffset = offset; | 4279 _visibleRangeOffset = offset; |
| 4186 _visibleRangeLength = length; | 4280 _visibleRangeLength = length; |
| 4187 } | 4281 } |
| 4188 void visitChildren(ElementVisitor<Object> visitor) { | 4282 void visitChildren(ElementVisitor<Object> visitor) { |
| 4189 super.visitChildren(visitor); | 4283 super.visitChildren(visitor); |
| 4190 safelyVisitChildren(_parameters, visitor); | 4284 safelyVisitChildren(_parameters, visitor); |
| 4191 } | 4285 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4203 break; | 4297 break; |
| 4204 } | 4298 } |
| 4205 builder.append(left); | 4299 builder.append(left); |
| 4206 builder.append(type); | 4300 builder.append(type); |
| 4207 builder.append(" "); | 4301 builder.append(" "); |
| 4208 builder.append(displayName); | 4302 builder.append(displayName); |
| 4209 builder.append(right); | 4303 builder.append(right); |
| 4210 } | 4304 } |
| 4211 } | 4305 } |
| 4212 /** | 4306 /** |
| 4213 * Instances of the class {@code PrefixElementImpl} implement a {@code PrefixEle
ment}. | 4307 * Instances of the class `PrefixElementImpl` implement a `PrefixElement`. |
| 4214 * @coverage dart.engine.element | 4308 * @coverage dart.engine.element |
| 4215 */ | 4309 */ |
| 4216 class PrefixElementImpl extends ElementImpl implements PrefixElement { | 4310 class PrefixElementImpl extends ElementImpl implements PrefixElement { |
| 4217 | 4311 |
| 4218 /** | 4312 /** |
| 4219 * An array containing all of the libraries that are imported using this prefi
x. | 4313 * An array containing all of the libraries that are imported using this prefi
x. |
| 4220 */ | 4314 */ |
| 4221 List<LibraryElement> _importedLibraries = LibraryElementImpl.EMPTY_ARRAY; | 4315 List<LibraryElement> _importedLibraries = LibraryElementImpl.EMPTY_ARRAY; |
| 4222 | 4316 |
| 4223 /** | 4317 /** |
| (...skipping 21 matching lines...) Expand all Loading... |
| 4245 ((library as LibraryElementImpl)).enclosingElement = this; | 4339 ((library as LibraryElementImpl)).enclosingElement = this; |
| 4246 } | 4340 } |
| 4247 this._importedLibraries = importedLibraries2; | 4341 this._importedLibraries = importedLibraries2; |
| 4248 } | 4342 } |
| 4249 void appendTo(JavaStringBuilder builder) { | 4343 void appendTo(JavaStringBuilder builder) { |
| 4250 builder.append("as "); | 4344 builder.append("as "); |
| 4251 super.appendTo(builder); | 4345 super.appendTo(builder); |
| 4252 } | 4346 } |
| 4253 } | 4347 } |
| 4254 /** | 4348 /** |
| 4255 * Instances of the class {@code PropertyAccessorElementImpl} implement a{@code
PropertyAccessorElement}. | 4349 * Instances of the class `PropertyAccessorElementImpl` implement a`PropertyAcce
ssorElement`. |
| 4256 * @coverage dart.engine.element | 4350 * @coverage dart.engine.element |
| 4257 */ | 4351 */ |
| 4258 class PropertyAccessorElementImpl extends ExecutableElementImpl implements Prope
rtyAccessorElement { | 4352 class PropertyAccessorElementImpl extends ExecutableElementImpl implements Prope
rtyAccessorElement { |
| 4259 | 4353 |
| 4260 /** | 4354 /** |
| 4261 * The variable associated with this accessor. | 4355 * The variable associated with this accessor. |
| 4262 */ | 4356 */ |
| 4263 PropertyInducingElement _variable; | 4357 PropertyInducingElement _variable; |
| 4264 | 4358 |
| 4265 /** | 4359 /** |
| 4266 * An empty array of property accessor elements. | 4360 * An empty array of property accessor elements. |
| 4267 */ | 4361 */ |
| 4268 static List<PropertyAccessorElement> EMPTY_ARRAY = new List<PropertyAccessorEl
ement>(0); | 4362 static List<PropertyAccessorElement> EMPTY_ARRAY = new List<PropertyAccessorEl
ement>(0); |
| 4269 | 4363 |
| 4270 /** | 4364 /** |
| 4271 * Initialize a newly created property accessor element to have the given name
. | 4365 * Initialize a newly created property accessor element to have the given name
. |
| 4272 * @param name the name of this element | 4366 * @param name the name of this element |
| 4273 */ | 4367 */ |
| 4274 PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) { | 4368 PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) { |
| 4275 _jtd_constructor_223_impl(name); | 4369 _jtd_constructor_224_impl(name); |
| 4276 } | 4370 } |
| 4277 _jtd_constructor_223_impl(Identifier name) { | 4371 _jtd_constructor_224_impl(Identifier name) { |
| 4278 } | 4372 } |
| 4279 | 4373 |
| 4280 /** | 4374 /** |
| 4281 * Initialize a newly created synthetic property accessor element to be associ
ated with the given | 4375 * Initialize a newly created synthetic property accessor element to be associ
ated with the given |
| 4282 * variable. | 4376 * variable. |
| 4283 * @param variable the variable with which this access is associated | 4377 * @param variable the variable with which this access is associated |
| 4284 */ | 4378 */ |
| 4285 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe
r.con2(variable2.name, variable2.nameOffset) { | 4379 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe
r.con2(variable2.name, variable2.nameOffset) { |
| 4286 _jtd_constructor_224_impl(variable2); | 4380 _jtd_constructor_225_impl(variable2); |
| 4287 } | 4381 } |
| 4288 _jtd_constructor_224_impl(PropertyInducingElementImpl variable2) { | 4382 _jtd_constructor_225_impl(PropertyInducingElementImpl variable2) { |
| 4289 this._variable = variable2; | 4383 this._variable = variable2; |
| 4290 synthetic = true; | 4384 synthetic = true; |
| 4291 } | 4385 } |
| 4292 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 4386 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 4293 bool operator ==(Object object) => super == object && identical(isGetter(), ((
object as PropertyAccessorElement)).isGetter()); | 4387 bool operator ==(Object object) => super == object && identical(isGetter(), ((
object as PropertyAccessorElement)).isGetter()); |
| 4294 PropertyAccessorElement get correspondingGetter { | 4388 PropertyAccessorElement get correspondingGetter { |
| 4295 if (isGetter() || _variable == null) { | 4389 if (isGetter() || _variable == null) { |
| 4296 return null; | 4390 return null; |
| 4297 } | 4391 } |
| 4298 return _variable.getter; | 4392 return _variable.getter; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4316 return super.name; | 4410 return super.name; |
| 4317 } | 4411 } |
| 4318 PropertyInducingElement get variable => _variable; | 4412 PropertyInducingElement get variable => _variable; |
| 4319 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 4413 bool isAbstract() => hasModifier(Modifier.ABSTRACT); |
| 4320 bool isGetter() => hasModifier(Modifier.GETTER); | 4414 bool isGetter() => hasModifier(Modifier.GETTER); |
| 4321 bool isSetter() => hasModifier(Modifier.SETTER); | 4415 bool isSetter() => hasModifier(Modifier.SETTER); |
| 4322 bool isStatic() => hasModifier(Modifier.STATIC); | 4416 bool isStatic() => hasModifier(Modifier.STATIC); |
| 4323 | 4417 |
| 4324 /** | 4418 /** |
| 4325 * 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. |
| 4326 * @param isAbstract {@code true} if the accessor is abstract | 4420 * @param isAbstract `true` if the accessor is abstract |
| 4327 */ | 4421 */ |
| 4328 void set abstract(bool isAbstract) { | 4422 void set abstract(bool isAbstract) { |
| 4329 setModifier(Modifier.ABSTRACT, isAbstract); | 4423 setModifier(Modifier.ABSTRACT, isAbstract); |
| 4330 } | 4424 } |
| 4331 | 4425 |
| 4332 /** | 4426 /** |
| 4333 * Set whether this accessor is a getter to correspond to the given value. | 4427 * Set whether this accessor is a getter to correspond to the given value. |
| 4334 * @param isGetter {@code true} if the accessor is a getter | 4428 * @param isGetter `true` if the accessor is a getter |
| 4335 */ | 4429 */ |
| 4336 void set getter(bool isGetter) { | 4430 void set getter(bool isGetter) { |
| 4337 setModifier(Modifier.GETTER, isGetter); | 4431 setModifier(Modifier.GETTER, isGetter); |
| 4338 } | 4432 } |
| 4339 | 4433 |
| 4340 /** | 4434 /** |
| 4341 * Set whether this accessor is a setter to correspond to the given value. | 4435 * Set whether this accessor is a setter to correspond to the given value. |
| 4342 * @param isSetter {@code true} if the accessor is a setter | 4436 * @param isSetter `true` if the accessor is a setter |
| 4343 */ | 4437 */ |
| 4344 void set setter(bool isSetter) { | 4438 void set setter(bool isSetter) { |
| 4345 setModifier(Modifier.SETTER, isSetter); | 4439 setModifier(Modifier.SETTER, isSetter); |
| 4346 } | 4440 } |
| 4347 | 4441 |
| 4348 /** | 4442 /** |
| 4349 * Set whether this accessor is static to correspond to the given value. | 4443 * Set whether this accessor is static to correspond to the given value. |
| 4350 * @param isStatic {@code true} if the accessor is static | 4444 * @param isStatic `true` if the accessor is static |
| 4351 */ | 4445 */ |
| 4352 void set static(bool isStatic) { | 4446 void set static(bool isStatic) { |
| 4353 setModifier(Modifier.STATIC, isStatic); | 4447 setModifier(Modifier.STATIC, isStatic); |
| 4354 } | 4448 } |
| 4355 | 4449 |
| 4356 /** | 4450 /** |
| 4357 * Set the variable associated with this accessor to the given variable. | 4451 * Set the variable associated with this accessor to the given variable. |
| 4358 * @param variable the variable associated with this accessor | 4452 * @param variable the variable associated with this accessor |
| 4359 */ | 4453 */ |
| 4360 void set variable(PropertyInducingElement variable2) { | 4454 void set variable(PropertyInducingElement variable2) { |
| 4361 this._variable = variable2; | 4455 this._variable = variable2; |
| 4362 } | 4456 } |
| 4363 void appendTo(JavaStringBuilder builder) { | 4457 void appendTo(JavaStringBuilder builder) { |
| 4364 builder.append(isGetter() ? "get " : "set "); | 4458 builder.append(isGetter() ? "get " : "set "); |
| 4365 builder.append(variable.displayName); | 4459 builder.append(variable.displayName); |
| 4366 super.appendTo(builder); | 4460 super.appendTo(builder); |
| 4367 } | 4461 } |
| 4368 } | 4462 } |
| 4369 /** | 4463 /** |
| 4370 * Instances of the class {@code PropertyInducingElementImpl} implement a{@code
PropertyInducingElement}. | 4464 * Instances of the class `PropertyInducingElementImpl` implement a`PropertyIndu
cingElement`. |
| 4371 * @coverage dart.engine.element | 4465 * @coverage dart.engine.element |
| 4372 */ | 4466 */ |
| 4373 abstract class PropertyInducingElementImpl extends VariableElementImpl implement
s PropertyInducingElement { | 4467 abstract class PropertyInducingElementImpl extends VariableElementImpl implement
s PropertyInducingElement { |
| 4374 | 4468 |
| 4375 /** | 4469 /** |
| 4376 * The getter associated with this element. | 4470 * The getter associated with this element. |
| 4377 */ | 4471 */ |
| 4378 PropertyAccessorElement _getter; | 4472 PropertyAccessorElement _getter; |
| 4379 | 4473 |
| 4380 /** | 4474 /** |
| 4381 * The setter associated with this element, or {@code null} if the element is
effectively{@code final} and therefore does not have a setter associated with it
. | 4475 * The setter associated with this element, or `null` if the element is effect
ively`final` and therefore does not have a setter associated with it. |
| 4382 */ | 4476 */ |
| 4383 PropertyAccessorElement _setter; | 4477 PropertyAccessorElement _setter; |
| 4384 | 4478 |
| 4385 /** | 4479 /** |
| 4386 * An empty array of elements. | 4480 * An empty array of elements. |
| 4387 */ | 4481 */ |
| 4388 static List<PropertyInducingElement> EMPTY_ARRAY = new List<PropertyInducingEl
ement>(0); | 4482 static List<PropertyInducingElement> EMPTY_ARRAY = new List<PropertyInducingEl
ement>(0); |
| 4389 | 4483 |
| 4390 /** | 4484 /** |
| 4391 * Initialize a newly created element to have the given name. | 4485 * Initialize a newly created element to have the given name. |
| 4392 * @param name the name of this element | 4486 * @param name the name of this element |
| 4393 */ | 4487 */ |
| 4394 PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) { | 4488 PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) { |
| 4395 _jtd_constructor_225_impl(name); | 4489 _jtd_constructor_226_impl(name); |
| 4396 } | 4490 } |
| 4397 _jtd_constructor_225_impl(Identifier name) { | 4491 _jtd_constructor_226_impl(Identifier name) { |
| 4398 } | 4492 } |
| 4399 | 4493 |
| 4400 /** | 4494 /** |
| 4401 * Initialize a newly created synthetic element to have the given name. | 4495 * Initialize a newly created synthetic element to have the given name. |
| 4402 * @param name the name of this element | 4496 * @param name the name of this element |
| 4403 */ | 4497 */ |
| 4404 PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) { | 4498 PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) { |
| 4405 _jtd_constructor_226_impl(name); | 4499 _jtd_constructor_227_impl(name); |
| 4406 } | 4500 } |
| 4407 _jtd_constructor_226_impl(String name) { | 4501 _jtd_constructor_227_impl(String name) { |
| 4408 synthetic = true; | 4502 synthetic = true; |
| 4409 } | 4503 } |
| 4410 PropertyAccessorElement get getter => _getter; | 4504 PropertyAccessorElement get getter => _getter; |
| 4411 PropertyAccessorElement get setter => _setter; | 4505 PropertyAccessorElement get setter => _setter; |
| 4412 | 4506 |
| 4413 /** | 4507 /** |
| 4414 * Set the getter associated with this element to the given accessor. | 4508 * Set the getter associated with this element to the given accessor. |
| 4415 * @param getter the getter associated with this element | 4509 * @param getter the getter associated with this element |
| 4416 */ | 4510 */ |
| 4417 void set getter(PropertyAccessorElement getter2) { | 4511 void set getter(PropertyAccessorElement getter2) { |
| 4418 this._getter = getter2; | 4512 this._getter = getter2; |
| 4419 } | 4513 } |
| 4420 | 4514 |
| 4421 /** | 4515 /** |
| 4422 * Set the setter associated with this element to the given accessor. | 4516 * Set the setter associated with this element to the given accessor. |
| 4423 * @param setter the setter associated with this element | 4517 * @param setter the setter associated with this element |
| 4424 */ | 4518 */ |
| 4425 void set setter(PropertyAccessorElement setter2) { | 4519 void set setter(PropertyAccessorElement setter2) { |
| 4426 this._setter = setter2; | 4520 this._setter = setter2; |
| 4427 } | 4521 } |
| 4428 } | 4522 } |
| 4429 /** | 4523 /** |
| 4430 * Instances of the class {@code ShowElementCombinatorImpl} implement a{@link Sh
owElementCombinator}. | 4524 * Instances of the class `ShowElementCombinatorImpl` implement a[ShowElementCom
binator]. |
| 4431 * @coverage dart.engine.element | 4525 * @coverage dart.engine.element |
| 4432 */ | 4526 */ |
| 4433 class ShowElementCombinatorImpl implements ShowElementCombinator { | 4527 class ShowElementCombinatorImpl implements ShowElementCombinator { |
| 4434 | 4528 |
| 4435 /** | 4529 /** |
| 4436 * The names that are to be made visible in the importing library if they are
defined in the | 4530 * The names that are to be made visible in the importing library if they are
defined in the |
| 4437 * imported library. | 4531 * imported library. |
| 4438 */ | 4532 */ |
| 4439 List<String> _shownNames = StringUtilities.EMPTY_ARRAY; | 4533 List<String> _shownNames = StringUtilities.EMPTY_ARRAY; |
| 4440 List<String> get shownNames => _shownNames; | 4534 List<String> get shownNames => _shownNames; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 4454 for (int i = 0; i < count; i++) { | 4548 for (int i = 0; i < count; i++) { |
| 4455 if (i > 0) { | 4549 if (i > 0) { |
| 4456 builder.append(", "); | 4550 builder.append(", "); |
| 4457 } | 4551 } |
| 4458 builder.append(_shownNames[i]); | 4552 builder.append(_shownNames[i]); |
| 4459 } | 4553 } |
| 4460 return builder.toString(); | 4554 return builder.toString(); |
| 4461 } | 4555 } |
| 4462 } | 4556 } |
| 4463 /** | 4557 /** |
| 4464 * Instances of the class {@code TopLevelVariableElementImpl} implement a{@code
TopLevelVariableElement}. | 4558 * Instances of the class `TopLevelVariableElementImpl` implement a`TopLevelVari
ableElement`. |
| 4465 * @coverage dart.engine.element | 4559 * @coverage dart.engine.element |
| 4466 */ | 4560 */ |
| 4467 class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements
TopLevelVariableElement { | 4561 class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements
TopLevelVariableElement { |
| 4468 | 4562 |
| 4469 /** | 4563 /** |
| 4470 * An empty array of top-level variable elements. | 4564 * An empty array of top-level variable elements. |
| 4471 */ | 4565 */ |
| 4472 static List<TopLevelVariableElement> EMPTY_ARRAY = new List<TopLevelVariableEl
ement>(0); | 4566 static List<TopLevelVariableElement> EMPTY_ARRAY = new List<TopLevelVariableEl
ement>(0); |
| 4473 | 4567 |
| 4474 /** | 4568 /** |
| 4475 * Initialize a newly created top-level variable element to have the given nam
e. | 4569 * Initialize a newly created top-level variable element to have the given nam
e. |
| 4476 * @param name the name of this element | 4570 * @param name the name of this element |
| 4477 */ | 4571 */ |
| 4478 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) { | 4572 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) { |
| 4479 _jtd_constructor_228_impl(name); | 4573 _jtd_constructor_229_impl(name); |
| 4480 } | 4574 } |
| 4481 _jtd_constructor_228_impl(Identifier name) { | 4575 _jtd_constructor_229_impl(Identifier name) { |
| 4482 } | 4576 } |
| 4483 | 4577 |
| 4484 /** | 4578 /** |
| 4485 * 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. |
| 4486 * @param name the name of this element | 4580 * @param name the name of this element |
| 4487 */ | 4581 */ |
| 4488 TopLevelVariableElementImpl.con2(String name) : super.con2(name) { | 4582 TopLevelVariableElementImpl.con2(String name) : super.con2(name) { |
| 4489 _jtd_constructor_229_impl(name); | 4583 _jtd_constructor_230_impl(name); |
| 4490 } | 4584 } |
| 4491 _jtd_constructor_229_impl(String name) { | 4585 _jtd_constructor_230_impl(String name) { |
| 4492 } | 4586 } |
| 4493 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); | 4587 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); |
| 4494 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; | 4588 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; |
| 4495 bool isStatic() => true; | 4589 bool isStatic() => true; |
| 4496 } | 4590 } |
| 4497 /** | 4591 /** |
| 4498 * Instances of the class {@code TypeVariableElementImpl} implement a {@code Typ
eVariableElement}. | 4592 * Instances of the class `TypeVariableElementImpl` implement a `TypeVariableEle
ment`. |
| 4499 * @coverage dart.engine.element | 4593 * @coverage dart.engine.element |
| 4500 */ | 4594 */ |
| 4501 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement
{ | 4595 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement
{ |
| 4502 | 4596 |
| 4503 /** | 4597 /** |
| 4504 * The type defined by this type variable. | 4598 * The type defined by this type variable. |
| 4505 */ | 4599 */ |
| 4506 TypeVariableType _type; | 4600 TypeVariableType _type; |
| 4507 | 4601 |
| 4508 /** | 4602 /** |
| 4509 * The type representing the bound associated with this variable, or {@code nu
ll} if this variable | 4603 * The type representing the bound associated with this variable, or `null` if
this variable |
| 4510 * does not have an explicit bound. | 4604 * does not have an explicit bound. |
| 4511 */ | 4605 */ |
| 4512 Type2 _bound; | 4606 Type2 _bound; |
| 4513 | 4607 |
| 4514 /** | 4608 /** |
| 4515 * An empty array of type variable elements. | 4609 * An empty array of type variable elements. |
| 4516 */ | 4610 */ |
| 4517 static List<TypeVariableElement> EMPTY_ARRAY = new List<TypeVariableElement>(0
); | 4611 static List<TypeVariableElement> EMPTY_ARRAY = new List<TypeVariableElement>(0
); |
| 4518 | 4612 |
| 4519 /** | 4613 /** |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4544 } | 4638 } |
| 4545 void appendTo(JavaStringBuilder builder) { | 4639 void appendTo(JavaStringBuilder builder) { |
| 4546 builder.append(displayName); | 4640 builder.append(displayName); |
| 4547 if (_bound != null) { | 4641 if (_bound != null) { |
| 4548 builder.append(" extends "); | 4642 builder.append(" extends "); |
| 4549 builder.append(_bound); | 4643 builder.append(_bound); |
| 4550 } | 4644 } |
| 4551 } | 4645 } |
| 4552 } | 4646 } |
| 4553 /** | 4647 /** |
| 4554 * Instances of the class {@code VariableElementImpl} implement a {@code Variabl
eElement}. | 4648 * Instances of the class `VariableElementImpl` implement a `VariableElement`. |
| 4555 * @coverage dart.engine.element | 4649 * @coverage dart.engine.element |
| 4556 */ | 4650 */ |
| 4557 abstract class VariableElementImpl extends ElementImpl implements VariableElemen
t { | 4651 abstract class VariableElementImpl extends ElementImpl implements VariableElemen
t { |
| 4558 | 4652 |
| 4559 /** | 4653 /** |
| 4560 * The declared type of this variable. | 4654 * The declared type of this variable. |
| 4561 */ | 4655 */ |
| 4562 Type2 _type; | 4656 Type2 _type; |
| 4563 | 4657 |
| 4564 /** | 4658 /** |
| 4565 * A synthetic function representing this variable's initializer, or {@code nu
ll} if this variable | 4659 * A synthetic function representing this variable's initializer, or `null` if
this variable |
| 4566 * does not have an initializer. | 4660 * does not have an initializer. |
| 4567 */ | 4661 */ |
| 4568 FunctionElement _initializer; | 4662 FunctionElement _initializer; |
| 4569 | 4663 |
| 4570 /** | 4664 /** |
| 4571 * An empty array of variable elements. | 4665 * An empty array of variable elements. |
| 4572 */ | 4666 */ |
| 4573 static List<VariableElement> EMPTY_ARRAY = new List<VariableElement>(0); | 4667 static List<VariableElement> EMPTY_ARRAY = new List<VariableElement>(0); |
| 4574 | 4668 |
| 4575 /** | 4669 /** |
| 4576 * Initialize a newly created variable element to have the given name. | 4670 * Initialize a newly created variable element to have the given name. |
| 4577 * @param name the name of this element | 4671 * @param name the name of this element |
| 4578 */ | 4672 */ |
| 4579 VariableElementImpl.con1(Identifier name) : super.con1(name) { | 4673 VariableElementImpl.con1(Identifier name) : super.con1(name) { |
| 4580 _jtd_constructor_231_impl(name); | 4674 _jtd_constructor_232_impl(name); |
| 4581 } | 4675 } |
| 4582 _jtd_constructor_231_impl(Identifier name) { | 4676 _jtd_constructor_232_impl(Identifier name) { |
| 4583 } | 4677 } |
| 4584 | 4678 |
| 4585 /** | 4679 /** |
| 4586 * Initialize a newly created variable element to have the given name. | 4680 * Initialize a newly created variable element to have the given name. |
| 4587 * @param name the name of this element | 4681 * @param name the name of this element |
| 4588 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 4682 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 4589 * declaration of this element | 4683 * declaration of this element |
| 4590 */ | 4684 */ |
| 4591 VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameO
ffset) { | 4685 VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameO
ffset) { |
| 4592 _jtd_constructor_232_impl(name, nameOffset); | 4686 _jtd_constructor_233_impl(name, nameOffset); |
| 4593 } | 4687 } |
| 4594 _jtd_constructor_232_impl(String name, int nameOffset) { | 4688 _jtd_constructor_233_impl(String name, int nameOffset) { |
| 4595 } | 4689 } |
| 4596 | 4690 |
| 4597 /** | 4691 /** |
| 4598 * 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 |
| 4599 * expression, or {@code null} if this variable is not a 'const' variable or d
oes not have an | 4693 * expression, or `null` if this variable is not a 'const' variable or does no
t have an |
| 4600 * initializer. | 4694 * initializer. |
| 4601 * @return the result of evaluating this variable's initializer | 4695 * @return the result of evaluating this variable's initializer |
| 4602 */ | 4696 */ |
| 4603 EvaluationResultImpl get evaluationResult => null; | 4697 EvaluationResultImpl get evaluationResult => null; |
| 4604 FunctionElement get initializer => _initializer; | 4698 FunctionElement get initializer => _initializer; |
| 4605 Type2 get type => _type; | 4699 Type2 get type => _type; |
| 4606 bool isConst() => hasModifier(Modifier.CONST); | 4700 bool isConst() => hasModifier(Modifier.CONST); |
| 4607 bool isFinal() => hasModifier(Modifier.FINAL); | 4701 bool isFinal() => hasModifier(Modifier.FINAL); |
| 4608 | 4702 |
| 4609 /** | 4703 /** |
| 4610 * 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. |
| 4611 * @param isConst {@code true} if the variable is const | 4705 * @param isConst `true` if the variable is const |
| 4612 */ | 4706 */ |
| 4613 void set const3(bool isConst) { | 4707 void set const3(bool isConst) { |
| 4614 setModifier(Modifier.CONST, isConst); | 4708 setModifier(Modifier.CONST, isConst); |
| 4615 } | 4709 } |
| 4616 | 4710 |
| 4617 /** | 4711 /** |
| 4618 * Set the result of evaluating this variable's initializer as a compile-time
constant expression | 4712 * Set the result of evaluating this variable's initializer as a compile-time
constant expression |
| 4619 * to the given result. | 4713 * to the given result. |
| 4620 * @param result the result of evaluating this variable's initializer | 4714 * @param result the result of evaluating this variable's initializer |
| 4621 */ | 4715 */ |
| 4622 void set evaluationResult(EvaluationResultImpl result) { | 4716 void set evaluationResult(EvaluationResultImpl result) { |
| 4623 throw new IllegalStateException("Invalid attempt to set a compile-time const
ant result"); | 4717 throw new IllegalStateException("Invalid attempt to set a compile-time const
ant result"); |
| 4624 } | 4718 } |
| 4625 | 4719 |
| 4626 /** | 4720 /** |
| 4627 * Set whether this variable is final to correspond to the given value. | 4721 * Set whether this variable is final to correspond to the given value. |
| 4628 * @param isFinal {@code true} if the variable is final | 4722 * @param isFinal `true` if the variable is final |
| 4629 */ | 4723 */ |
| 4630 void set final2(bool isFinal) { | 4724 void set final2(bool isFinal) { |
| 4631 setModifier(Modifier.FINAL, isFinal); | 4725 setModifier(Modifier.FINAL, isFinal); |
| 4632 } | 4726 } |
| 4633 | 4727 |
| 4634 /** | 4728 /** |
| 4635 * Set the function representing this variable's initializer to the given func
tion. | 4729 * Set the function representing this variable's initializer to the given func
tion. |
| 4636 * @param initializer the function representing this variable's initializer | 4730 * @param initializer the function representing this variable's initializer |
| 4637 */ | 4731 */ |
| 4638 void set initializer(FunctionElement initializer2) { | 4732 void set initializer(FunctionElement initializer2) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 4653 super.visitChildren(visitor); | 4747 super.visitChildren(visitor); |
| 4654 safelyVisitChild(_initializer, visitor); | 4748 safelyVisitChild(_initializer, visitor); |
| 4655 } | 4749 } |
| 4656 void appendTo(JavaStringBuilder builder) { | 4750 void appendTo(JavaStringBuilder builder) { |
| 4657 builder.append(type); | 4751 builder.append(type); |
| 4658 builder.append(" "); | 4752 builder.append(" "); |
| 4659 builder.append(displayName); | 4753 builder.append(displayName); |
| 4660 } | 4754 } |
| 4661 } | 4755 } |
| 4662 /** | 4756 /** |
| 4663 * Instances of the class {@code ConstructorMember} represent a constructor elem
ent defined in a | 4757 * Instances of the class `ConstructorMember` represent a constructor element de
fined in a |
| 4664 * parameterized type where the values of the type parameters are known. | 4758 * parameterized type where the values of the type parameters are known. |
| 4665 */ | 4759 */ |
| 4666 class ConstructorMember extends ExecutableMember implements ConstructorElement { | 4760 class ConstructorMember extends ExecutableMember implements ConstructorElement { |
| 4667 | 4761 |
| 4668 /** | 4762 /** |
| 4669 * If the given constructor's type is different when any type parameters from
the defining type's | 4763 * If the given constructor's type is different when any type parameters from
the defining type's |
| 4670 * declaration are replaced with the actual type arguments from the defining t
ype, create a | 4764 * declaration are replaced with the actual type arguments from the defining t
ype, create a |
| 4671 * constructor member representing the given constructor. Return the member th
at was created, or | 4765 * constructor member representing the given constructor. Return the member th
at was created, or |
| 4672 * the base constructor if no member was created. | 4766 * the base constructor if no member was created. |
| 4673 * @param baseConstructor the base constructor for which a member might be cre
ated | 4767 * @param baseConstructor the base constructor for which a member might be cre
ated |
| 4674 * @param definingType the type defining the parameters and arguments to be us
ed in the | 4768 * @param definingType the type defining the parameters and arguments to be us
ed in the |
| 4675 * substitution | 4769 * substitution |
| 4676 * @return the constructor element that will return the correctly substituted
types | 4770 * @return the constructor element that will return the correctly substituted
types |
| 4677 */ | 4771 */ |
| 4678 static ConstructorElement from(ConstructorElement baseConstructor, InterfaceTy
pe definingType) { | 4772 static ConstructorElement from(ConstructorElement baseConstructor, InterfaceTy
pe definingType) { |
| 4679 if (baseConstructor == null || definingType.typeArguments.length == 0) { | 4773 if (baseConstructor == null || definingType.typeArguments.length == 0) { |
| 4680 return baseConstructor; | 4774 return baseConstructor; |
| 4681 } | 4775 } |
| 4682 FunctionType baseType = baseConstructor.type; | 4776 FunctionType baseType = baseConstructor.type; |
| 4683 List<Type2> argumentTypes = definingType.typeArguments; | 4777 List<Type2> argumentTypes = definingType.typeArguments; |
| 4684 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem
ent.typeVariables); | 4778 List<Type2> parameterTypes = definingType.element.type.typeArguments; |
| 4685 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); | 4779 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); |
| 4686 if (baseType == substitutedType) { | 4780 if (baseType == substitutedType) { |
| 4687 return baseConstructor; | 4781 return baseConstructor; |
| 4688 } | 4782 } |
| 4689 return new ConstructorMember(baseConstructor, definingType); | 4783 return new ConstructorMember(baseConstructor, definingType); |
| 4690 } | 4784 } |
| 4691 | 4785 |
| 4692 /** | 4786 /** |
| 4693 * 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. |
| 4694 * @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 |
| 4695 * @param definingType the type in which the element is defined | 4789 * @param definingType the type in which the element is defined |
| 4696 */ | 4790 */ |
| 4697 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { | 4791 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { |
| 4698 } | 4792 } |
| 4699 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 4793 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 4700 ConstructorElement get baseElement => super.baseElement as ConstructorElement; | 4794 ConstructorElement get baseElement => super.baseElement as ConstructorElement; |
| 4701 ClassElement get enclosingElement => baseElement.enclosingElement; | 4795 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 4702 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); | 4796 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); |
| 4703 bool isConst() => baseElement.isConst(); | 4797 bool isConst() => baseElement.isConst(); |
| 4798 bool isDefaultConstructor() => baseElement.isDefaultConstructor(); |
| 4704 bool isFactory() => baseElement.isFactory(); | 4799 bool isFactory() => baseElement.isFactory(); |
| 4705 String toString() { | 4800 String toString() { |
| 4706 ConstructorElement baseElement = this.baseElement; | 4801 ConstructorElement baseElement = this.baseElement; |
| 4707 List<ParameterElement> parameters = this.parameters; | 4802 List<ParameterElement> parameters = this.parameters; |
| 4708 FunctionType type = this.type; | 4803 FunctionType type = this.type; |
| 4709 JavaStringBuilder builder = new JavaStringBuilder(); | 4804 JavaStringBuilder builder = new JavaStringBuilder(); |
| 4710 builder.append(baseElement.enclosingElement.displayName); | 4805 builder.append(baseElement.enclosingElement.displayName); |
| 4711 String name = displayName; | 4806 String name = displayName; |
| 4712 if (name != null && !name.isEmpty) { | 4807 if (name != null && !name.isEmpty) { |
| 4713 builder.append("."); | 4808 builder.append("."); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4724 builder.append(")"); | 4819 builder.append(")"); |
| 4725 if (type != null) { | 4820 if (type != null) { |
| 4726 builder.append(" -> "); | 4821 builder.append(" -> "); |
| 4727 builder.append(type.returnType); | 4822 builder.append(type.returnType); |
| 4728 } | 4823 } |
| 4729 return builder.toString(); | 4824 return builder.toString(); |
| 4730 } | 4825 } |
| 4731 InterfaceType get definingType => super.definingType as InterfaceType; | 4826 InterfaceType get definingType => super.definingType as InterfaceType; |
| 4732 } | 4827 } |
| 4733 /** | 4828 /** |
| 4734 * The abstract class {@code ExecutableMember} defines the behavior common to me
mbers that represent | 4829 * The abstract class `ExecutableMember` defines the behavior common to members
that represent |
| 4735 * an executable element defined in a parameterized type where the values of the
type parameters are | 4830 * an executable element defined in a parameterized type where the values of the
type parameters are |
| 4736 * known. | 4831 * known. |
| 4737 */ | 4832 */ |
| 4738 abstract class ExecutableMember extends Member implements ExecutableElement { | 4833 abstract class ExecutableMember extends Member implements ExecutableElement { |
| 4739 | 4834 |
| 4740 /** | 4835 /** |
| 4741 * Initialize a newly created element to represent an executable element of th
e given | 4836 * Initialize a newly created element to represent an executable element of th
e given |
| 4742 * parameterized type. | 4837 * parameterized type. |
| 4743 * @param baseElement the element on which the parameterized element was creat
ed | 4838 * @param baseElement the element on which the parameterized element was creat
ed |
| 4744 * @param definingType the type in which the element is defined | 4839 * @param definingType the type in which the element is defined |
| (...skipping 13 matching lines...) Expand all Loading... |
| 4758 int parameterCount = baseParameters.length; | 4853 int parameterCount = baseParameters.length; |
| 4759 if (parameterCount == 0) { | 4854 if (parameterCount == 0) { |
| 4760 return baseParameters; | 4855 return baseParameters; |
| 4761 } | 4856 } |
| 4762 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 4857 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 4763 for (int i = 0; i < parameterCount; i++) { | 4858 for (int i = 0; i < parameterCount; i++) { |
| 4764 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 4859 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
| 4765 } | 4860 } |
| 4766 return parameterizedParameters; | 4861 return parameterizedParameters; |
| 4767 } | 4862 } |
| 4863 Type2 get returnType => substituteFor(baseElement.returnType); |
| 4768 FunctionType get type => substituteFor(baseElement.type); | 4864 FunctionType get type => substituteFor(baseElement.type); |
| 4769 bool isOperator() => baseElement.isOperator(); | 4865 bool isOperator() => baseElement.isOperator(); |
| 4770 bool isStatic() => baseElement.isStatic(); | 4866 bool isStatic() => baseElement.isStatic(); |
| 4771 void visitChildren(ElementVisitor<Object> visitor) { | 4867 void visitChildren(ElementVisitor<Object> visitor) { |
| 4772 super.visitChildren(visitor); | 4868 super.visitChildren(visitor); |
| 4773 safelyVisitChildren(baseElement.functions, visitor); | 4869 safelyVisitChildren(baseElement.functions, visitor); |
| 4774 safelyVisitChildren(labels, visitor); | 4870 safelyVisitChildren(labels, visitor); |
| 4775 safelyVisitChildren(baseElement.localVariables, visitor); | 4871 safelyVisitChildren(baseElement.localVariables, visitor); |
| 4776 safelyVisitChildren(parameters, visitor); | 4872 safelyVisitChildren(parameters, visitor); |
| 4777 } | 4873 } |
| 4778 } | 4874 } |
| 4779 /** | 4875 /** |
| 4780 * Instances of the class {@code FieldMember} represent a field element defined
in a parameterized | 4876 * Instances of the class `FieldMember` represent a field element defined in a p
arameterized |
| 4781 * type where the values of the type parameters are known. | 4877 * type where the values of the type parameters are known. |
| 4782 */ | 4878 */ |
| 4783 class FieldMember extends VariableMember implements FieldElement { | 4879 class FieldMember extends VariableMember implements FieldElement { |
| 4784 | 4880 |
| 4785 /** | 4881 /** |
| 4786 * If the given field's type is different when any type parameters from the de
fining type's | 4882 * If the given field's type is different when any type parameters from the de
fining type's |
| 4787 * declaration are replaced with the actual type arguments from the defining t
ype, create a field | 4883 * declaration are replaced with the actual type arguments from the defining t
ype, create a field |
| 4788 * member representing the given field. Return the member that was created, or
the base field if | 4884 * member representing the given field. Return the member that was created, or
the base field if |
| 4789 * no member was created. | 4885 * no member was created. |
| 4790 * @param baseField the base field for which a member might be created | 4886 * @param baseField the base field for which a member might be created |
| 4791 * @param definingType the type defining the parameters and arguments to be us
ed in the | 4887 * @param definingType the type defining the parameters and arguments to be us
ed in the |
| 4792 * substitution | 4888 * substitution |
| 4793 * @return the field element that will return the correctly substituted types | 4889 * @return the field element that will return the correctly substituted types |
| 4794 */ | 4890 */ |
| 4795 static FieldElement from(FieldElement baseField, InterfaceType definingType) { | 4891 static FieldElement from(FieldElement baseField, InterfaceType definingType) { |
| 4796 if (baseField == null || definingType.typeArguments.length == 0) { | 4892 if (baseField == null || definingType.typeArguments.length == 0) { |
| 4797 return baseField; | 4893 return baseField; |
| 4798 } | 4894 } |
| 4799 Type2 baseType = baseField.type; | 4895 Type2 baseType = baseField.type; |
| 4800 if (baseType == null) { | 4896 if (baseType == null) { |
| 4801 return baseField; | 4897 return baseField; |
| 4802 } | 4898 } |
| 4803 List<Type2> argumentTypes = definingType.typeArguments; | 4899 List<Type2> argumentTypes = definingType.typeArguments; |
| 4804 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem
ent.typeVariables); | 4900 List<Type2> parameterTypes = definingType.element.type.typeArguments; |
| 4805 Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes); | 4901 Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes); |
| 4806 if (baseType == substitutedType) { | 4902 if (baseType == substitutedType) { |
| 4807 return baseField; | 4903 return baseField; |
| 4808 } | 4904 } |
| 4809 return new FieldMember(baseField, definingType); | 4905 return new FieldMember(baseField, definingType); |
| 4810 } | 4906 } |
| 4811 | 4907 |
| 4812 /** | 4908 /** |
| 4813 * Initialize a newly created element to represent a field of the given parame
terized type. | 4909 * Initialize a newly created element to represent a field of the given parame
terized type. |
| 4814 * @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 |
| 4815 * @param definingType the type in which the element is defined | 4911 * @param definingType the type in which the element is defined |
| 4816 */ | 4912 */ |
| 4817 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType) { | 4913 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType) { |
| 4818 } | 4914 } |
| 4819 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 4915 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 4820 FieldElement get baseElement => super.baseElement as FieldElement; | 4916 FieldElement get baseElement => super.baseElement as FieldElement; |
| 4821 ClassElement get enclosingElement => baseElement.enclosingElement; | 4917 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 4822 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); | 4918 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); |
| 4823 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); | 4919 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); |
| 4824 bool isStatic() => baseElement.isStatic(); | 4920 bool isStatic() => baseElement.isStatic(); |
| 4825 InterfaceType get definingType => super.definingType as InterfaceType; | 4921 InterfaceType get definingType => super.definingType as InterfaceType; |
| 4826 } | 4922 } |
| 4827 /** | 4923 /** |
| 4828 * The abstract class {@code Member} defines the behavior common to elements tha
t represent members | 4924 * The abstract class `Member` defines the behavior common to elements that repr
esent members |
| 4829 * of parameterized types. | 4925 * of parameterized types. |
| 4830 */ | 4926 */ |
| 4831 abstract class Member implements Element { | 4927 abstract class Member implements Element { |
| 4832 | 4928 |
| 4833 /** | 4929 /** |
| 4834 * The element on which the parameterized element was created. | 4930 * The element on which the parameterized element was created. |
| 4835 */ | 4931 */ |
| 4836 Element _baseElement; | 4932 Element _baseElement; |
| 4837 | 4933 |
| 4838 /** | 4934 /** |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4871 void visitChildren(ElementVisitor<Object> visitor) { | 4967 void visitChildren(ElementVisitor<Object> visitor) { |
| 4872 } | 4968 } |
| 4873 | 4969 |
| 4874 /** | 4970 /** |
| 4875 * Return the type in which the element is defined. | 4971 * Return the type in which the element is defined. |
| 4876 * @return the type in which the element is defined | 4972 * @return the type in which the element is defined |
| 4877 */ | 4973 */ |
| 4878 ParameterizedType get definingType => _definingType; | 4974 ParameterizedType get definingType => _definingType; |
| 4879 | 4975 |
| 4880 /** | 4976 /** |
| 4881 * If the given child is not {@code null}, use the given visitor to visit it. | 4977 * If the given child is not `null`, use the given visitor to visit it. |
| 4882 * @param child the child to be visited | 4978 * @param child the child to be visited |
| 4883 * @param visitor the visitor to be used to visit the child | 4979 * @param visitor the visitor to be used to visit the child |
| 4884 */ | 4980 */ |
| 4885 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { | 4981 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { |
| 4886 if (child != null) { | 4982 if (child != null) { |
| 4887 child.accept(visitor); | 4983 child.accept(visitor); |
| 4888 } | 4984 } |
| 4889 } | 4985 } |
| 4890 | 4986 |
| 4891 /** | 4987 /** |
| (...skipping 30 matching lines...) Expand all Loading... |
| 4922 List<InterfaceType> substituteFor2(List<InterfaceType> types) { | 5018 List<InterfaceType> substituteFor2(List<InterfaceType> types) { |
| 4923 int count = types.length; | 5019 int count = types.length; |
| 4924 List<InterfaceType> substitutedTypes = new List<InterfaceType>(count); | 5020 List<InterfaceType> substitutedTypes = new List<InterfaceType>(count); |
| 4925 for (int i = 0; i < count; i++) { | 5021 for (int i = 0; i < count; i++) { |
| 4926 substitutedTypes[i] = substituteFor(types[i]); | 5022 substitutedTypes[i] = substituteFor(types[i]); |
| 4927 } | 5023 } |
| 4928 return substitutedTypes; | 5024 return substitutedTypes; |
| 4929 } | 5025 } |
| 4930 } | 5026 } |
| 4931 /** | 5027 /** |
| 4932 * Instances of the class {@code MethodMember} represent a method element define
d in a parameterized | 5028 * Instances of the class `MethodMember` represent a method element defined in a
parameterized |
| 4933 * type where the values of the type parameters are known. | 5029 * type where the values of the type parameters are known. |
| 4934 */ | 5030 */ |
| 4935 class MethodMember extends ExecutableMember implements MethodElement { | 5031 class MethodMember extends ExecutableMember implements MethodElement { |
| 4936 | 5032 |
| 4937 /** | 5033 /** |
| 4938 * If the given method's type is different when any type parameters from the d
efining type's | 5034 * If the given method's type is different when any type parameters from the d
efining type's |
| 4939 * declaration are replaced with the actual type arguments from the defining t
ype, create a method | 5035 * declaration are replaced with the actual type arguments from the defining t
ype, create a method |
| 4940 * member representing the given method. Return the member that was created, o
r the base method if | 5036 * member representing the given method. Return the member that was created, o
r the base method if |
| 4941 * no member was created. | 5037 * no member was created. |
| 4942 * @param baseMethod the base method for which a member might be created | 5038 * @param baseMethod the base method for which a member might be created |
| 4943 * @param definingType the type defining the parameters and arguments to be us
ed in the | 5039 * @param definingType the type defining the parameters and arguments to be us
ed in the |
| 4944 * substitution | 5040 * substitution |
| 4945 * @return the method element that will return the correctly substituted types | 5041 * @return the method element that will return the correctly substituted types |
| 4946 */ | 5042 */ |
| 4947 static MethodElement from(MethodElement baseMethod, InterfaceType definingType
) { | 5043 static MethodElement from(MethodElement baseMethod, InterfaceType definingType
) { |
| 4948 if (baseMethod == null || definingType.typeArguments.length == 0) { | 5044 if (baseMethod == null || definingType.typeArguments.length == 0) { |
| 4949 return baseMethod; | 5045 return baseMethod; |
| 4950 } | 5046 } |
| 4951 FunctionType baseType = baseMethod.type; | 5047 FunctionType baseType = baseMethod.type; |
| 4952 List<Type2> argumentTypes = definingType.typeArguments; | 5048 List<Type2> argumentTypes = definingType.typeArguments; |
| 4953 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem
ent.typeVariables); | 5049 List<Type2> parameterTypes = definingType.element.type.typeArguments; |
| 4954 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); | 5050 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); |
| 4955 if (baseType == substitutedType) { | 5051 if (baseType == substitutedType) { |
| 4956 return baseMethod; | 5052 return baseMethod; |
| 4957 } | 5053 } |
| 4958 return new MethodMember(baseMethod, definingType); | 5054 return new MethodMember(baseMethod, definingType); |
| 4959 } | 5055 } |
| 4960 | 5056 |
| 4961 /** | 5057 /** |
| 4962 * 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. |
| 4963 * @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 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 4987 } | 5083 } |
| 4988 builder.append(")"); | 5084 builder.append(")"); |
| 4989 if (type != null) { | 5085 if (type != null) { |
| 4990 builder.append(" -> "); | 5086 builder.append(" -> "); |
| 4991 builder.append(type.returnType); | 5087 builder.append(type.returnType); |
| 4992 } | 5088 } |
| 4993 return builder.toString(); | 5089 return builder.toString(); |
| 4994 } | 5090 } |
| 4995 } | 5091 } |
| 4996 /** | 5092 /** |
| 4997 * Instances of the class {@code ParameterMember} represent a parameter element
defined in a | 5093 * Instances of the class `ParameterMember` represent a parameter element define
d in a |
| 4998 * parameterized type where the values of the type parameters are known. | 5094 * parameterized type where the values of the type parameters are known. |
| 4999 */ | 5095 */ |
| 5000 class ParameterMember extends VariableMember implements ParameterElement { | 5096 class ParameterMember extends VariableMember implements ParameterElement { |
| 5001 | 5097 |
| 5002 /** | 5098 /** |
| 5003 * If the given parameter's type is different when any type parameters from th
e defining type's | 5099 * If the given parameter's type is different when any type parameters from th
e defining type's |
| 5004 * declaration are replaced with the actual type arguments from the defining t
ype, create a | 5100 * declaration are replaced with the actual type arguments from the defining t
ype, create a |
| 5005 * parameter member representing the given parameter. Return the member that w
as created, or the | 5101 * parameter member representing the given parameter. Return the member that w
as created, or the |
| 5006 * base parameter if no member was created. | 5102 * base parameter if no member was created. |
| 5007 * @param baseParameter the base parameter for which a member might be created | 5103 * @param baseParameter the base parameter for which a member might be created |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5085 builder.append(baseElement.displayName); | 5181 builder.append(baseElement.displayName); |
| 5086 builder.append(right); | 5182 builder.append(right); |
| 5087 return builder.toString(); | 5183 return builder.toString(); |
| 5088 } | 5184 } |
| 5089 void visitChildren(ElementVisitor<Object> visitor) { | 5185 void visitChildren(ElementVisitor<Object> visitor) { |
| 5090 super.visitChildren(visitor); | 5186 super.visitChildren(visitor); |
| 5091 safelyVisitChildren(parameters, visitor); | 5187 safelyVisitChildren(parameters, visitor); |
| 5092 } | 5188 } |
| 5093 } | 5189 } |
| 5094 /** | 5190 /** |
| 5095 * Instances of the class {@code PropertyAccessorMember} represent a property ac
cessor element | 5191 * Instances of the class `PropertyAccessorMember` represent a property accessor
element |
| 5096 * defined in a parameterized type where the values of the type parameters are k
nown. | 5192 * defined in a parameterized type where the values of the type parameters are k
nown. |
| 5097 */ | 5193 */ |
| 5098 class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso
rElement { | 5194 class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso
rElement { |
| 5099 | 5195 |
| 5100 /** | 5196 /** |
| 5101 * If the given property accessor's type is different when any type parameters
from the defining | 5197 * If the given property accessor's type is different when any type parameters
from the defining |
| 5102 * type's declaration are replaced with the actual type arguments from the def
ining type, create a | 5198 * type's declaration are replaced with the actual type arguments from the def
ining type, create a |
| 5103 * property accessor member representing the given property accessor. Return t
he member that was | 5199 * property accessor member representing the given property accessor. Return t
he member that was |
| 5104 * created, or the base accessor if no member was created. | 5200 * created, or the base accessor if no member was created. |
| 5105 * @param baseAccessor the base property accessor for which a member might be
created | 5201 * @param baseAccessor the base property accessor for which a member might be
created |
| 5106 * @param definingType the type defining the parameters and arguments to be us
ed in the | 5202 * @param definingType the type defining the parameters and arguments to be us
ed in the |
| 5107 * substitution | 5203 * substitution |
| 5108 * @return the property accessor element that will return the correctly substi
tuted types | 5204 * @return the property accessor element that will return the correctly substi
tuted types |
| 5109 */ | 5205 */ |
| 5110 static PropertyAccessorElement from(PropertyAccessorElement baseAccessor, Inte
rfaceType definingType) { | 5206 static PropertyAccessorElement from(PropertyAccessorElement baseAccessor, Inte
rfaceType definingType) { |
| 5111 if (baseAccessor == null || definingType.typeArguments.length == 0) { | 5207 if (baseAccessor == null || definingType.typeArguments.length == 0) { |
| 5112 return baseAccessor; | 5208 return baseAccessor; |
| 5113 } | 5209 } |
| 5114 FunctionType baseType = baseAccessor.type; | 5210 FunctionType baseType = baseAccessor.type; |
| 5115 List<Type2> argumentTypes = definingType.typeArguments; | 5211 List<Type2> argumentTypes = definingType.typeArguments; |
| 5116 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem
ent.typeVariables); | 5212 List<Type2> parameterTypes = definingType.element.type.typeArguments; |
| 5117 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); | 5213 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter
Types); |
| 5118 if (baseType == substitutedType) { | 5214 if (baseType == substitutedType) { |
| 5119 return baseAccessor; | 5215 return baseAccessor; |
| 5120 } | 5216 } |
| 5121 return new PropertyAccessorMember(baseAccessor, definingType); | 5217 return new PropertyAccessorMember(baseAccessor, definingType); |
| 5122 } | 5218 } |
| 5123 | 5219 |
| 5124 /** | 5220 /** |
| 5125 * Initialize a newly created element to represent a property accessor of the
given parameterized | 5221 * Initialize a newly created element to represent a property accessor of the
given parameterized |
| 5126 * type. | 5222 * type. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5140 return FieldMember.from(((variable as FieldElement)), definingType); | 5236 return FieldMember.from(((variable as FieldElement)), definingType); |
| 5141 } | 5237 } |
| 5142 return variable; | 5238 return variable; |
| 5143 } | 5239 } |
| 5144 bool isAbstract() => baseElement.isAbstract(); | 5240 bool isAbstract() => baseElement.isAbstract(); |
| 5145 bool isGetter() => baseElement.isGetter(); | 5241 bool isGetter() => baseElement.isGetter(); |
| 5146 bool isSetter() => baseElement.isSetter(); | 5242 bool isSetter() => baseElement.isSetter(); |
| 5147 InterfaceType get definingType => super.definingType as InterfaceType; | 5243 InterfaceType get definingType => super.definingType as InterfaceType; |
| 5148 } | 5244 } |
| 5149 /** | 5245 /** |
| 5150 * The abstract class {@code VariableMember} defines the behavior common to memb
ers that represent a | 5246 * The abstract class `VariableMember` defines the behavior common to members th
at represent a |
| 5151 * 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 |
| 5152 * known. | 5248 * known. |
| 5153 */ | 5249 */ |
| 5154 abstract class VariableMember extends Member implements VariableElement { | 5250 abstract class VariableMember extends Member implements VariableElement { |
| 5155 | 5251 |
| 5156 /** | 5252 /** |
| 5157 * 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 |
| 5158 * parameterized type. | 5254 * parameterized type. |
| 5159 * @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 |
| 5160 * @param definingType the type in which the element is defined | 5256 * @param definingType the type in which the element is defined |
| 5161 */ | 5257 */ |
| 5162 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType) { | 5258 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType) { |
| 5163 } | 5259 } |
| 5164 VariableElement get baseElement => super.baseElement as VariableElement; | 5260 VariableElement get baseElement => super.baseElement as VariableElement; |
| 5165 FunctionElement get initializer { | 5261 FunctionElement get initializer { |
| 5166 throw new UnsupportedOperationException(); | 5262 throw new UnsupportedOperationException(); |
| 5167 } | 5263 } |
| 5168 Type2 get type => substituteFor(baseElement.type); | 5264 Type2 get type => substituteFor(baseElement.type); |
| 5169 bool isConst() => baseElement.isConst(); | 5265 bool isConst() => baseElement.isConst(); |
| 5170 bool isFinal() => baseElement.isFinal(); | 5266 bool isFinal() => baseElement.isFinal(); |
| 5171 void visitChildren(ElementVisitor<Object> visitor) { | 5267 void visitChildren(ElementVisitor<Object> visitor) { |
| 5172 super.visitChildren(visitor); | 5268 super.visitChildren(visitor); |
| 5173 safelyVisitChild(baseElement.initializer, visitor); | 5269 safelyVisitChild(baseElement.initializer, visitor); |
| 5174 } | 5270 } |
| 5175 } | 5271 } |
| 5176 /** | 5272 /** |
| 5177 * Instances of the class {@code AnonymousFunctionTypeImpl} extend the behavior
of{@link FunctionTypeImpl} to support anonymous function types created for funct
ion typed | 5273 * The unique instance of the class `BottomTypeImpl` implements the type `bottom
`. |
| 5178 * parameters. | |
| 5179 * @coverage dart.engine.type | |
| 5180 */ | |
| 5181 class AnonymousFunctionTypeImpl extends FunctionTypeImpl { | |
| 5182 | |
| 5183 /** | |
| 5184 * An array of parameters elements of this type of function. | |
| 5185 */ | |
| 5186 List<ParameterElement> _baseParameters = ParameterElementImpl.EMPTY_ARRAY; | |
| 5187 AnonymousFunctionTypeImpl() : super.con2((null as FunctionTypeAliasElement)) { | |
| 5188 } | |
| 5189 | |
| 5190 /** | |
| 5191 * Sets the parameters elements of this type of function. | |
| 5192 * @param parameters the parameters elements of this type of function | |
| 5193 */ | |
| 5194 void set baseParameters(List<ParameterElement> parameters) { | |
| 5195 this._baseParameters = parameters; | |
| 5196 } | |
| 5197 List<ParameterElement> get baseParameters => _baseParameters; | |
| 5198 } | |
| 5199 /** | |
| 5200 * The unique instance of the class {@code BottomTypeImpl} implements the type {
@code bottom}. | |
| 5201 * @coverage dart.engine.type | 5274 * @coverage dart.engine.type |
| 5202 */ | 5275 */ |
| 5203 class BottomTypeImpl extends TypeImpl { | 5276 class BottomTypeImpl extends TypeImpl { |
| 5204 | 5277 |
| 5205 /** | 5278 /** |
| 5206 * The unique instance of this class. | 5279 * The unique instance of this class. |
| 5207 */ | 5280 */ |
| 5208 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); | 5281 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); |
| 5209 | 5282 |
| 5210 /** | 5283 /** |
| 5211 * Return the unique instance of this class. | 5284 * Return the unique instance of this class. |
| 5212 * @return the unique instance of this class | 5285 * @return the unique instance of this class |
| 5213 */ | 5286 */ |
| 5214 static BottomTypeImpl get instance => _INSTANCE; | 5287 static BottomTypeImpl get instance => _INSTANCE; |
| 5215 | 5288 |
| 5216 /** | 5289 /** |
| 5217 * Prevent the creation of instances of this class. | 5290 * Prevent the creation of instances of this class. |
| 5218 */ | 5291 */ |
| 5219 BottomTypeImpl() : super(null, "<bottom>") { | 5292 BottomTypeImpl() : super(null, "<bottom>") { |
| 5220 } | 5293 } |
| 5221 bool operator ==(Object object) => identical(object, this); | 5294 bool operator ==(Object object) => identical(object, this); |
| 5222 bool isMoreSpecificThan(Type2 type) => true; | 5295 bool isMoreSpecificThan(Type2 type) => true; |
| 5223 bool isSubtypeOf(Type2 type) => true; | 5296 bool isSubtypeOf(Type2 type) => true; |
| 5224 bool isSupertypeOf(Type2 type) => false; | 5297 bool isSupertypeOf(Type2 type) => false; |
| 5225 BottomTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTyp
es) => this; | 5298 BottomTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTyp
es) => this; |
| 5226 } | 5299 } |
| 5227 /** | 5300 /** |
| 5228 * The unique instance of the class {@code DynamicTypeImpl} implements the type
{@code dynamic}. | 5301 * The unique instance of the class `DynamicTypeImpl` implements the type `dynam
ic`. |
| 5229 * @coverage dart.engine.type | 5302 * @coverage dart.engine.type |
| 5230 */ | 5303 */ |
| 5231 class DynamicTypeImpl extends TypeImpl { | 5304 class DynamicTypeImpl extends TypeImpl { |
| 5232 | 5305 |
| 5233 /** | 5306 /** |
| 5234 * The unique instance of this class. | 5307 * The unique instance of this class. |
| 5235 */ | 5308 */ |
| 5236 static DynamicTypeImpl _INSTANCE = new DynamicTypeImpl(); | 5309 static DynamicTypeImpl _INSTANCE = new DynamicTypeImpl(); |
| 5237 | 5310 |
| 5238 /** | 5311 /** |
| 5239 * Return the unique instance of this class. | 5312 * Return the unique instance of this class. |
| 5240 * @return the unique instance of this class | 5313 * @return the unique instance of this class |
| 5241 */ | 5314 */ |
| 5242 static DynamicTypeImpl get instance => _INSTANCE; | 5315 static DynamicTypeImpl get instance => _INSTANCE; |
| 5243 | 5316 |
| 5244 /** | 5317 /** |
| 5245 * Prevent the creation of instances of this class. | 5318 * Prevent the creation of instances of this class. |
| 5246 */ | 5319 */ |
| 5247 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { | 5320 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { |
| 5248 ((element as DynamicElementImpl)).type = this; | 5321 ((element as DynamicElementImpl)).type = this; |
| 5249 } | 5322 } |
| 5250 bool operator ==(Object object) => object is DynamicTypeImpl; | 5323 bool operator ==(Object object) => object is DynamicTypeImpl; |
| 5251 bool isDynamic() => true; | 5324 bool isDynamic() => true; |
| 5252 bool isMoreSpecificThan(Type2 type) => false; | 5325 bool isMoreSpecificThan(Type2 type) => false; |
| 5253 bool isSubtypeOf(Type2 type) => identical(this, type); | 5326 bool isSubtypeOf(Type2 type) => identical(this, type); |
| 5254 bool isSupertypeOf(Type2 type) => true; | 5327 bool isSupertypeOf(Type2 type) => true; |
| 5255 DynamicTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTy
pes) => this; | 5328 DynamicTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTy
pes) => this; |
| 5256 } | 5329 } |
| 5257 /** | 5330 /** |
| 5258 * Instances of the class {@code FunctionTypeImpl} defines the behavior common t
o objects | 5331 * Instances of the class `FunctionTypeImpl` defines the behavior common to obje
cts |
| 5259 * representing the type of a function, method, constructor, getter, or setter. | 5332 * representing the type of a function, method, constructor, getter, or setter. |
| 5260 * @coverage dart.engine.type | 5333 * @coverage dart.engine.type |
| 5261 */ | 5334 */ |
| 5262 class FunctionTypeImpl extends TypeImpl implements FunctionType { | 5335 class FunctionTypeImpl extends TypeImpl implements FunctionType { |
| 5263 | 5336 |
| 5264 /** | 5337 /** |
| 5265 * Return {@code true} if all of the name/type pairs in the first map are equa
l to the | 5338 * Return `true` if all of the name/type pairs in the first map are equal to t
he |
| 5266 * corresponding name/type pairs in the second map. The maps are expected to i
terate over their | 5339 * corresponding name/type pairs in the second map. The maps are expected to i
terate over their |
| 5267 * entries in the same order in which those entries were added to the map. | 5340 * entries in the same order in which those entries were added to the map. |
| 5268 * @param firstTypes the first map of name/type pairs being compared | 5341 * @param firstTypes the first map of name/type pairs being compared |
| 5269 * @param secondTypes the second map of name/type pairs being compared | 5342 * @param secondTypes the second map of name/type pairs being compared |
| 5270 * @return {@code true} if all of the name/type pairs in the first map are equ
al to the | 5343 * @return `true` if all of the name/type pairs in the first map are equal to
the |
| 5271 * corresponding name/type pairs in the second map | 5344 * corresponding name/type pairs in the second map |
| 5272 */ | 5345 */ |
| 5273 static bool equals2(Map<String, Type2> firstTypes, Map<String, Type2> secondTy
pes) { | 5346 static bool equals2(Map<String, Type2> firstTypes, Map<String, Type2> secondTy
pes) { |
| 5274 if (secondTypes.length != firstTypes.length) { | 5347 if (secondTypes.length != firstTypes.length) { |
| 5275 return false; | 5348 return false; |
| 5276 } | 5349 } |
| 5277 JavaIterator<MapEntry<String, Type2>> firstIterator = new JavaIterator(getMa
pEntrySet(firstTypes)); | 5350 JavaIterator<MapEntry<String, Type2>> firstIterator = new JavaIterator(getMa
pEntrySet(firstTypes)); |
| 5278 JavaIterator<MapEntry<String, Type2>> secondIterator = new JavaIterator(getM
apEntrySet(secondTypes)); | 5351 JavaIterator<MapEntry<String, Type2>> secondIterator = new JavaIterator(getM
apEntrySet(secondTypes)); |
| 5279 while (firstIterator.hasNext) { | 5352 while (firstIterator.hasNext) { |
| 5280 MapEntry<String, Type2> firstEntry = firstIterator.next(); | 5353 MapEntry<String, Type2> firstEntry = firstIterator.next(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5324 */ | 5397 */ |
| 5325 List<Type2> _optionalParameterTypes = TypeImpl.EMPTY_ARRAY; | 5398 List<Type2> _optionalParameterTypes = TypeImpl.EMPTY_ARRAY; |
| 5326 | 5399 |
| 5327 /** | 5400 /** |
| 5328 * A table mapping the names of named parameters to the types of the named par
ameters of this type | 5401 * A table mapping the names of named parameters to the types of the named par
ameters of this type |
| 5329 * of function. | 5402 * of function. |
| 5330 */ | 5403 */ |
| 5331 Map<String, Type2> _namedParameterTypes = new Map(); | 5404 Map<String, Type2> _namedParameterTypes = new Map(); |
| 5332 | 5405 |
| 5333 /** | 5406 /** |
| 5334 * The type of object returned by this type of function. | |
| 5335 */ | |
| 5336 Type2 _returnType = VoidTypeImpl.instance; | |
| 5337 | |
| 5338 /** | |
| 5339 * Initialize a newly created function type to be declared by the given elemen
t and to have the | 5407 * Initialize a newly created function type to be declared by the given elemen
t and to have the |
| 5340 * given name. | 5408 * given name. |
| 5341 * @param element the element representing the declaration of the function typ
e | 5409 * @param element the element representing the declaration of the function typ
e |
| 5342 */ | 5410 */ |
| 5343 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n
ull ? null : element.name) { | 5411 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n
ull ? null : element.name) { |
| 5344 _jtd_constructor_299_impl(element); | 5412 _jtd_constructor_299_impl(element); |
| 5345 } | 5413 } |
| 5346 _jtd_constructor_299_impl(ExecutableElement element) { | 5414 _jtd_constructor_299_impl(ExecutableElement element) { |
| 5347 } | 5415 } |
| 5348 | 5416 |
| 5349 /** | 5417 /** |
| 5350 * Initialize a newly created function type to be declared by the given elemen
t and to have the | 5418 * Initialize a newly created function type to be declared by the given elemen
t and to have the |
| 5351 * given name. | 5419 * given name. |
| 5352 * @param element the element representing the declaration of the function typ
e | 5420 * @param element the element representing the declaration of the function typ
e |
| 5353 */ | 5421 */ |
| 5354 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme
nt == null ? null : element.name) { | 5422 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme
nt == null ? null : element.name) { |
| 5355 _jtd_constructor_300_impl(element); | 5423 _jtd_constructor_300_impl(element); |
| 5356 } | 5424 } |
| 5357 _jtd_constructor_300_impl(FunctionTypeAliasElement element) { | 5425 _jtd_constructor_300_impl(FunctionTypeAliasElement element) { |
| 5358 } | 5426 } |
| 5359 bool operator ==(Object object) { | 5427 bool operator ==(Object object) { |
| 5360 if (object is! FunctionTypeImpl) { | 5428 if (object is! FunctionTypeImpl) { |
| 5361 return false; | 5429 return false; |
| 5362 } | 5430 } |
| 5363 FunctionTypeImpl otherType = object as FunctionTypeImpl; | 5431 FunctionTypeImpl otherType = object as FunctionTypeImpl; |
| 5364 return element == otherType.element && JavaArrays.equals(_normalParameterTyp
es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType
s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType
._namedParameterTypes) && _returnType == otherType._returnType; | 5432 return element == otherType.element && JavaArrays.equals(_normalParameterTyp
es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType
s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType
._namedParameterTypes) && returnType == otherType.returnType; |
| 5365 } | 5433 } |
| 5366 String get displayName { | 5434 String get displayName { |
| 5367 String name = this.name; | 5435 String name = this.name; |
| 5368 if (name == null) { | 5436 if (name == null) { |
| 5437 Type2 returnType = this.returnType; |
| 5369 JavaStringBuilder builder = new JavaStringBuilder(); | 5438 JavaStringBuilder builder = new JavaStringBuilder(); |
| 5370 builder.append("("); | 5439 builder.append("("); |
| 5371 bool needsComma = false; | 5440 bool needsComma = false; |
| 5372 if (_normalParameterTypes.length > 0) { | 5441 if (_normalParameterTypes.length > 0) { |
| 5373 for (Type2 type in _normalParameterTypes) { | 5442 for (Type2 type in _normalParameterTypes) { |
| 5374 if (needsComma) { | 5443 if (needsComma) { |
| 5375 builder.append(", "); | 5444 builder.append(", "); |
| 5376 } else { | 5445 } else { |
| 5377 needsComma = true; | 5446 needsComma = true; |
| 5378 } | 5447 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 5409 needsComma = true; | 5478 needsComma = true; |
| 5410 } | 5479 } |
| 5411 builder.append(entry.getKey()); | 5480 builder.append(entry.getKey()); |
| 5412 builder.append(": "); | 5481 builder.append(": "); |
| 5413 builder.append(entry.getValue().displayName); | 5482 builder.append(entry.getValue().displayName); |
| 5414 } | 5483 } |
| 5415 builder.append("}"); | 5484 builder.append("}"); |
| 5416 needsComma = true; | 5485 needsComma = true; |
| 5417 } | 5486 } |
| 5418 builder.append(") -> "); | 5487 builder.append(") -> "); |
| 5419 if (_returnType == null) { | 5488 if (returnType == null) { |
| 5420 builder.append("null"); | 5489 builder.append("null"); |
| 5421 } else { | 5490 } else { |
| 5422 builder.append(_returnType.displayName); | 5491 builder.append(returnType.displayName); |
| 5423 } | 5492 } |
| 5424 name = builder.toString(); | 5493 name = builder.toString(); |
| 5425 } | 5494 } |
| 5426 return name; | 5495 return name; |
| 5427 } | 5496 } |
| 5428 Map<String, Type2> get namedParameterTypes => _namedParameterTypes; | 5497 Map<String, Type2> get namedParameterTypes => _namedParameterTypes; |
| 5429 List<Type2> get normalParameterTypes => _normalParameterTypes; | 5498 List<Type2> get normalParameterTypes => _normalParameterTypes; |
| 5430 List<Type2> get optionalParameterTypes => _optionalParameterTypes; | 5499 List<Type2> get optionalParameterTypes => _optionalParameterTypes; |
| 5431 List<ParameterElement> get parameters { | 5500 List<ParameterElement> get parameters { |
| 5432 List<ParameterElement> baseParameters = this.baseParameters; | 5501 List<ParameterElement> baseParameters = this.baseParameters; |
| 5433 int parameterCount = baseParameters.length; | 5502 int parameterCount = baseParameters.length; |
| 5434 if (parameterCount == 0) { | 5503 if (parameterCount == 0) { |
| 5435 return baseParameters; | 5504 return baseParameters; |
| 5436 } | 5505 } |
| 5437 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); | 5506 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); |
| 5438 for (int i = 0; i < parameterCount; i++) { | 5507 for (int i = 0; i < parameterCount; i++) { |
| 5439 specializedParameters[i] = ParameterMember.from(baseParameters[i], this); | 5508 specializedParameters[i] = ParameterMember.from(baseParameters[i], this); |
| 5440 } | 5509 } |
| 5441 return specializedParameters; | 5510 return specializedParameters; |
| 5442 } | 5511 } |
| 5443 Type2 get returnType => _returnType; | 5512 Type2 get returnType { |
| 5513 Type2 baseReturnType = this.baseReturnType; |
| 5514 return baseReturnType.substitute2(_typeArguments, TypeVariableTypeImpl.getTy
pes(typeVariables)); |
| 5515 } |
| 5444 List<Type2> get typeArguments => _typeArguments; | 5516 List<Type2> get typeArguments => _typeArguments; |
| 5445 List<TypeVariableElement> get typeVariables { | 5517 List<TypeVariableElement> get typeVariables { |
| 5446 Element element = this.element; | 5518 Element element = this.element; |
| 5447 if (element is FunctionTypeAliasElement) { | 5519 if (element is FunctionTypeAliasElement) { |
| 5448 return ((element as FunctionTypeAliasElement)).typeVariables; | 5520 return ((element as FunctionTypeAliasElement)).typeVariables; |
| 5449 } | 5521 } |
| 5522 ClassElement definingClass = element.getAncestor(ClassElement); |
| 5523 if (definingClass != null) { |
| 5524 return definingClass.typeVariables; |
| 5525 } |
| 5450 return TypeVariableElementImpl.EMPTY_ARRAY; | 5526 return TypeVariableElementImpl.EMPTY_ARRAY; |
| 5451 } | 5527 } |
| 5452 int get hashCode { | 5528 int get hashCode { |
| 5453 Element element = this.element; | 5529 Element element = this.element; |
| 5454 if (element == null) { | 5530 if (element == null) { |
| 5455 return 0; | 5531 return 0; |
| 5456 } | 5532 } |
| 5457 return element.hashCode; | 5533 return element.hashCode; |
| 5458 } | 5534 } |
| 5459 bool isSubtypeOf(Type2 type) { | 5535 bool isSubtypeOf(Type2 type) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5554 /** | 5630 /** |
| 5555 * Set the types of the optional parameters of this type of function to the ty
pes in the given | 5631 * Set the types of the optional parameters of this type of function to the ty
pes in the given |
| 5556 * array. | 5632 * array. |
| 5557 * @param optionalParameterTypes the types of the optional parameters of this
type of function | 5633 * @param optionalParameterTypes the types of the optional parameters of this
type of function |
| 5558 */ | 5634 */ |
| 5559 void set optionalParameterTypes(List<Type2> optionalParameterTypes2) { | 5635 void set optionalParameterTypes(List<Type2> optionalParameterTypes2) { |
| 5560 this._optionalParameterTypes = optionalParameterTypes2; | 5636 this._optionalParameterTypes = optionalParameterTypes2; |
| 5561 } | 5637 } |
| 5562 | 5638 |
| 5563 /** | 5639 /** |
| 5564 * Set the type of object returned by this type of function to the given type. | |
| 5565 * @param returnType the type of object returned by this type of function | |
| 5566 */ | |
| 5567 void set returnType(Type2 returnType2) { | |
| 5568 this._returnType = returnType2; | |
| 5569 } | |
| 5570 | |
| 5571 /** | |
| 5572 * Set the actual types of the type arguments to the given types. | 5640 * Set the actual types of the type arguments to the given types. |
| 5573 * @param typeArguments the actual types of the type arguments | 5641 * @param typeArguments the actual types of the type arguments |
| 5574 */ | 5642 */ |
| 5575 void set typeArguments(List<Type2> typeArguments2) { | 5643 void set typeArguments(List<Type2> typeArguments2) { |
| 5576 this._typeArguments = typeArguments2; | 5644 this._typeArguments = typeArguments2; |
| 5577 } | 5645 } |
| 5578 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen
tTypes, typeArguments); | 5646 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen
tTypes, typeArguments); |
| 5579 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT
ypes) { | 5647 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT
ypes) { |
| 5580 if (argumentTypes.length != parameterTypes.length) { | 5648 if (argumentTypes.length != parameterTypes.length) { |
| 5581 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); | 5649 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); |
| 5582 } | 5650 } |
| 5583 if (argumentTypes.length == 0) { | 5651 if (argumentTypes.length == 0) { |
| 5584 return this; | 5652 return this; |
| 5585 } | 5653 } |
| 5586 Element element = this.element; | 5654 Element element = this.element; |
| 5587 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType
Impl.con1((element as ExecutableElement)) : new FunctionTypeImpl.con2((element a
s FunctionTypeAliasElement)); | 5655 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType
Impl.con1((element as ExecutableElement)) : new FunctionTypeImpl.con2((element a
s FunctionTypeAliasElement)); |
| 5588 newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes); | |
| 5589 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar
gumentTypes, parameterTypes); | 5656 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar
gumentTypes, parameterTypes); |
| 5590 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes
, argumentTypes, parameterTypes); | 5657 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes
, argumentTypes, parameterTypes); |
| 5591 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp
es, parameterTypes); | 5658 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp
es, parameterTypes); |
| 5592 newType.typeArguments = argumentTypes; | 5659 newType.typeArguments = TypeImpl.substitute(_typeArguments, argumentTypes, p
arameterTypes); |
| 5593 return newType; | 5660 return newType; |
| 5594 } | 5661 } |
| 5595 void appendTo(JavaStringBuilder builder) { | 5662 void appendTo(JavaStringBuilder builder) { |
| 5663 Type2 returnType = this.returnType; |
| 5596 builder.append("("); | 5664 builder.append("("); |
| 5597 bool needsComma = false; | 5665 bool needsComma = false; |
| 5598 if (_normalParameterTypes.length > 0) { | 5666 if (_normalParameterTypes.length > 0) { |
| 5599 for (Type2 type in _normalParameterTypes) { | 5667 for (Type2 type in _normalParameterTypes) { |
| 5600 if (needsComma) { | 5668 if (needsComma) { |
| 5601 builder.append(", "); | 5669 builder.append(", "); |
| 5602 } else { | 5670 } else { |
| 5603 needsComma = true; | 5671 needsComma = true; |
| 5604 } | 5672 } |
| 5605 ((type as TypeImpl)).appendTo(builder); | 5673 ((type as TypeImpl)).appendTo(builder); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5635 needsComma = true; | 5703 needsComma = true; |
| 5636 } | 5704 } |
| 5637 builder.append(entry.getKey()); | 5705 builder.append(entry.getKey()); |
| 5638 builder.append(": "); | 5706 builder.append(": "); |
| 5639 ((entry.getValue() as TypeImpl)).appendTo(builder); | 5707 ((entry.getValue() as TypeImpl)).appendTo(builder); |
| 5640 } | 5708 } |
| 5641 builder.append("}"); | 5709 builder.append("}"); |
| 5642 needsComma = true; | 5710 needsComma = true; |
| 5643 } | 5711 } |
| 5644 builder.append(") -> "); | 5712 builder.append(") -> "); |
| 5645 if (_returnType == null) { | 5713 if (returnType == null) { |
| 5646 builder.append("null"); | 5714 builder.append("null"); |
| 5647 } else { | 5715 } else { |
| 5648 ((_returnType as TypeImpl)).appendTo(builder); | 5716 ((returnType as TypeImpl)).appendTo(builder); |
| 5649 } | 5717 } |
| 5650 } | 5718 } |
| 5651 | 5719 |
| 5652 /** | 5720 /** |
| 5653 * @return the base parameter elements of this function element, not {@code nu
ll}. | 5721 * @return the base parameter elements of this function element, not `null`. |
| 5654 */ | 5722 */ |
| 5655 List<ParameterElement> get baseParameters { | 5723 List<ParameterElement> get baseParameters { |
| 5656 Element element = this.element; | 5724 Element element = this.element; |
| 5657 if (element is ExecutableElement) { | 5725 if (element is ExecutableElement) { |
| 5658 return ((element as ExecutableElement)).parameters; | 5726 return ((element as ExecutableElement)).parameters; |
| 5659 } else { | 5727 } else { |
| 5660 return ((element as FunctionTypeAliasElement)).parameters; | 5728 return ((element as FunctionTypeAliasElement)).parameters; |
| 5661 } | 5729 } |
| 5662 } | 5730 } |
| 5731 |
| 5732 /** |
| 5733 * Return the return type defined by this function's element. |
| 5734 * @return the return type defined by this function's element |
| 5735 */ |
| 5736 Type2 get baseReturnType { |
| 5737 Element element = this.element; |
| 5738 if (element is ExecutableElement) { |
| 5739 return ((element as ExecutableElement)).returnType; |
| 5740 } else { |
| 5741 return ((element as FunctionTypeAliasElement)).returnType; |
| 5742 } |
| 5743 } |
| 5663 } | 5744 } |
| 5664 /** | 5745 /** |
| 5665 * Instances of the class {@code InterfaceTypeImpl} defines the behavior common
to objects | 5746 * Instances of the class `InterfaceTypeImpl` defines the behavior common to obj
ects |
| 5666 * representing the type introduced by either a class or an interface, or a refe
rence to such a | 5747 * representing the type introduced by either a class or an interface, or a refe
rence to such a |
| 5667 * type. | 5748 * type. |
| 5668 * @coverage dart.engine.type | 5749 * @coverage dart.engine.type |
| 5669 */ | 5750 */ |
| 5670 class InterfaceTypeImpl extends TypeImpl implements InterfaceType { | 5751 class InterfaceTypeImpl extends TypeImpl implements InterfaceType { |
| 5671 | 5752 |
| 5672 /** | 5753 /** |
| 5673 * An empty array of types. | 5754 * An empty array of types. |
| 5674 */ | 5755 */ |
| 5675 static List<InterfaceType> EMPTY_ARRAY = new List<InterfaceType>(0); | 5756 static List<InterfaceType> EMPTY_ARRAY = new List<InterfaceType>(0); |
| 5676 | 5757 |
| 5677 /** | 5758 /** |
| 5678 * This method computes the longest inheritance path from some passed {@link T
ype} to Object. | 5759 * This method computes the longest inheritance path from some passed [Type] t
o Object. |
| 5679 * @param type the {@link Type} to compute the longest inheritance path of fro
m the passed{@link Type} to Object | 5760 * @param type the [Type] to compute the longest inheritance path of from the
passed[Type] to Object |
| 5680 * @return the computed longest inheritance path to Object | 5761 * @return the computed longest inheritance path to Object |
| 5681 * @see InterfaceType#getLeastUpperBound(Type) | 5762 * @see InterfaceType#getLeastUpperBound(Type) |
| 5682 */ | 5763 */ |
| 5683 static int computeLongestInheritancePathToObject(InterfaceType type) => comput
eLongestInheritancePathToObject2(type, 0, new Set<ClassElement>()); | 5764 static int computeLongestInheritancePathToObject(InterfaceType type) => comput
eLongestInheritancePathToObject2(type, 0, new Set<ClassElement>()); |
| 5684 | 5765 |
| 5685 /** | 5766 /** |
| 5686 * Returns the set of all superinterfaces of the passed {@link Type}. | 5767 * Returns the set of all superinterfaces of the passed [Type]. |
| 5687 * @param type the {@link Type} to compute the set of superinterfaces of | 5768 * @param type the [Type] to compute the set of superinterfaces of |
| 5688 * @return the {@link Set} of superinterfaces of the passed {@link Type} | 5769 * @return the [Set] of superinterfaces of the passed [Type] |
| 5689 * @see #getLeastUpperBound(Type) | 5770 * @see #getLeastUpperBound(Type) |
| 5690 */ | 5771 */ |
| 5691 static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => comp
uteSuperinterfaceSet2(type, new Set<InterfaceType>()); | 5772 static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => comp
uteSuperinterfaceSet2(type, new Set<InterfaceType>()); |
| 5692 | 5773 |
| 5693 /** | 5774 /** |
| 5694 * This method computes the longest inheritance path from some passed {@link T
ype} to Object. This | 5775 * This method computes the longest inheritance path from some passed [Type] t
o Object. This |
| 5695 * method calls itself recursively, callers should use the public method{@link
#computeLongestInheritancePathToObject(Type)}. | 5776 * method calls itself recursively, callers should use the public method[compu
teLongestInheritancePathToObject]. |
| 5696 * @param type the {@link Type} to compute the longest inheritance path of fro
m the passed{@link Type} to Object | 5777 * @param type the [Type] to compute the longest inheritance path of from the
passed[Type] to Object |
| 5697 * @param depth a field used recursively | 5778 * @param depth a field used recursively |
| 5698 * @param visitedClasses the classes that have already been visited | 5779 * @param visitedClasses the classes that have already been visited |
| 5699 * @return the computed longest inheritance path to Object | 5780 * @return the computed longest inheritance path to Object |
| 5700 * @see #computeLongestInheritancePathToObject(Type) | 5781 * @see #computeLongestInheritancePathToObject(Type) |
| 5701 * @see #getLeastUpperBound(Type) | 5782 * @see #getLeastUpperBound(Type) |
| 5702 */ | 5783 */ |
| 5703 static int computeLongestInheritancePathToObject2(InterfaceType type, int dept
h, Set<ClassElement> visitedClasses) { | 5784 static int computeLongestInheritancePathToObject2(InterfaceType type, int dept
h, Set<ClassElement> visitedClasses) { |
| 5704 ClassElement classElement = type.element; | 5785 ClassElement classElement = type.element; |
| 5705 if (classElement.supertype == null || visitedClasses.contains(classElement))
{ | 5786 if (classElement.supertype == null || visitedClasses.contains(classElement))
{ |
| 5706 return depth; | 5787 return depth; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5723 if (pathLength > longestPath) { | 5804 if (pathLength > longestPath) { |
| 5724 longestPath = pathLength; | 5805 longestPath = pathLength; |
| 5725 } | 5806 } |
| 5726 } finally { | 5807 } finally { |
| 5727 visitedClasses.remove(classElement); | 5808 visitedClasses.remove(classElement); |
| 5728 } | 5809 } |
| 5729 return longestPath; | 5810 return longestPath; |
| 5730 } | 5811 } |
| 5731 | 5812 |
| 5732 /** | 5813 /** |
| 5733 * Returns the set of all superinterfaces of the passed {@link Type}. This is
a recursive method, | 5814 * Returns the set of all superinterfaces of the passed [Type]. This is a recu
rsive method, |
| 5734 * callers should call the public {@link #computeSuperinterfaceSet(Type)}. | 5815 * callers should call the public [computeSuperinterfaceSet]. |
| 5735 * @param type the {@link Type} to compute the set of superinterfaces of | 5816 * @param type the [Type] to compute the set of superinterfaces of |
| 5736 * @param set a {@link HashSet} used recursively by this method | 5817 * @param set a [HashSet] used recursively by this method |
| 5737 * @return the {@link Set} of superinterfaces of the passed {@link Type} | 5818 * @return the [Set] of superinterfaces of the passed [Type] |
| 5738 * @see #computeSuperinterfaceSet(Type) | 5819 * @see #computeSuperinterfaceSet(Type) |
| 5739 * @see #getLeastUpperBound(Type) | 5820 * @see #getLeastUpperBound(Type) |
| 5740 */ | 5821 */ |
| 5741 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In
terfaceType> set) { | 5822 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In
terfaceType> set) { |
| 5742 Element element = type.element; | 5823 Element element = type.element; |
| 5743 if (element != null && element is ClassElement) { | 5824 if (element != null && element is ClassElement) { |
| 5744 ClassElement classElement = element as ClassElement; | 5825 ClassElement classElement = element as ClassElement; |
| 5745 List<InterfaceType> superinterfaces = classElement.interfaces; | 5826 List<InterfaceType> superinterfaces = classElement.interfaces; |
| 5746 for (InterfaceType superinterface in superinterfaces) { | 5827 for (InterfaceType superinterface in superinterfaces) { |
| 5747 if (javaSetAdd(set, superinterface)) { | 5828 if (javaSetAdd(set, superinterface)) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5841 } | 5922 } |
| 5842 _jtd_constructor_302_impl(String name) { | 5923 _jtd_constructor_302_impl(String name) { |
| 5843 } | 5924 } |
| 5844 bool operator ==(Object object) { | 5925 bool operator ==(Object object) { |
| 5845 if (object is! InterfaceTypeImpl) { | 5926 if (object is! InterfaceTypeImpl) { |
| 5846 return false; | 5927 return false; |
| 5847 } | 5928 } |
| 5848 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; | 5929 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; |
| 5849 return element == otherType.element && JavaArrays.equals(_typeArguments, oth
erType._typeArguments); | 5930 return element == otherType.element && JavaArrays.equals(_typeArguments, oth
erType._typeArguments); |
| 5850 } | 5931 } |
| 5932 List<PropertyAccessorElement> get accessors { |
| 5933 List<PropertyAccessorElement> accessors = element.accessors; |
| 5934 List<PropertyAccessorElement> members = new List<PropertyAccessorElement>(ac
cessors.length); |
| 5935 for (int i = 0; i < accessors.length; i++) { |
| 5936 members[i] = PropertyAccessorMember.from(accessors[i], this); |
| 5937 } |
| 5938 return members; |
| 5939 } |
| 5851 ClassElement get element => super.element as ClassElement; | 5940 ClassElement get element => super.element as ClassElement; |
| 5852 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getGetter(getterName), this); | 5941 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getGetter(getterName), this); |
| 5853 List<InterfaceType> get interfaces { | 5942 List<InterfaceType> get interfaces { |
| 5854 ClassElement classElement = element; | 5943 ClassElement classElement = element; |
| 5855 List<InterfaceType> interfaces = classElement.interfaces; | 5944 List<InterfaceType> interfaces = classElement.interfaces; |
| 5856 List<TypeVariableElement> typeVariables = classElement.typeVariables; | 5945 List<TypeVariableElement> typeVariables = classElement.typeVariables; |
| 5946 List<Type2> parameterTypes = classElement.type.typeArguments; |
| 5857 if (typeVariables.length == 0) { | 5947 if (typeVariables.length == 0) { |
| 5858 return interfaces; | 5948 return interfaces; |
| 5859 } | 5949 } |
| 5860 int count = interfaces.length; | 5950 int count = interfaces.length; |
| 5861 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); | 5951 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); |
| 5862 for (int i = 0; i < count; i++) { | 5952 for (int i = 0; i < count; i++) { |
| 5863 typedInterfaces[i] = interfaces[i].substitute2(_typeArguments, TypeVariabl
eTypeImpl.getTypes(typeVariables)); | 5953 typedInterfaces[i] = interfaces[i].substitute2(_typeArguments, parameterTy
pes); |
| 5864 } | 5954 } |
| 5865 return typedInterfaces; | 5955 return typedInterfaces; |
| 5866 } | 5956 } |
| 5867 Type2 getLeastUpperBound(Type2 type) { | 5957 Type2 getLeastUpperBound(Type2 type) { |
| 5868 if (identical(type, this)) { | 5958 if (identical(type, this)) { |
| 5869 return this; | 5959 return this; |
| 5870 } | 5960 } |
| 5871 Type2 dynamicType = DynamicTypeImpl.instance; | 5961 Type2 dynamicType = DynamicTypeImpl.instance; |
| 5872 if (identical(this, dynamicType) || identical(type, dynamicType)) { | 5962 if (identical(this, dynamicType) || identical(type, dynamicType)) { |
| 5873 return dynamicType; | 5963 return dynamicType; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 5899 indexOfLeastUpperBound = m; | 5989 indexOfLeastUpperBound = m; |
| 5900 } | 5990 } |
| 5901 } | 5991 } |
| 5902 if (numberOfTypesAtMaxDepth == 1) { | 5992 if (numberOfTypesAtMaxDepth == 1) { |
| 5903 return s[indexOfLeastUpperBound]; | 5993 return s[indexOfLeastUpperBound]; |
| 5904 } | 5994 } |
| 5905 } | 5995 } |
| 5906 return null; | 5996 return null; |
| 5907 } | 5997 } |
| 5908 MethodElement getMethod(String methodName) => MethodMember.from(((element as C
lassElementImpl)).getMethod(methodName), this); | 5998 MethodElement getMethod(String methodName) => MethodMember.from(((element as C
lassElementImpl)).getMethod(methodName), this); |
| 5999 List<MethodElement> get methods { |
| 6000 List<MethodElement> methods = element.methods; |
| 6001 List<MethodElement> members = new List<MethodElement>(methods.length); |
| 6002 for (int i = 0; i < methods.length; i++) { |
| 6003 members[i] = MethodMember.from(methods[i], this); |
| 6004 } |
| 6005 return members; |
| 6006 } |
| 5909 List<InterfaceType> get mixins { | 6007 List<InterfaceType> get mixins { |
| 5910 ClassElement classElement = element; | 6008 ClassElement classElement = element; |
| 5911 List<InterfaceType> mixins = classElement.mixins; | 6009 List<InterfaceType> mixins = classElement.mixins; |
| 5912 List<TypeVariableElement> typeVariables = classElement.typeVariables; | 6010 List<TypeVariableElement> typeVariables = classElement.typeVariables; |
| 6011 List<Type2> parameterTypes = classElement.type.typeArguments; |
| 5913 if (typeVariables.length == 0) { | 6012 if (typeVariables.length == 0) { |
| 5914 return mixins; | 6013 return mixins; |
| 5915 } | 6014 } |
| 5916 int count = mixins.length; | 6015 int count = mixins.length; |
| 5917 List<InterfaceType> typedMixins = new List<InterfaceType>(count); | 6016 List<InterfaceType> typedMixins = new List<InterfaceType>(count); |
| 5918 for (int i = 0; i < count; i++) { | 6017 for (int i = 0; i < count; i++) { |
| 5919 typedMixins[i] = mixins[i].substitute2(_typeArguments, TypeVariableTypeImp
l.getTypes(typeVariables)); | 6018 typedMixins[i] = mixins[i].substitute2(_typeArguments, parameterTypes); |
| 5920 } | 6019 } |
| 5921 return typedMixins; | 6020 return typedMixins; |
| 5922 } | 6021 } |
| 5923 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getSetter(setterName), this); | 6022 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getSetter(setterName), this); |
| 5924 InterfaceType get superclass { | 6023 InterfaceType get superclass { |
| 5925 ClassElement classElement = element; | 6024 ClassElement classElement = element; |
| 5926 InterfaceType supertype = classElement.supertype; | 6025 InterfaceType supertype = classElement.supertype; |
| 5927 if (supertype == null) { | 6026 if (supertype == null) { |
| 5928 return null; | 6027 return null; |
| 5929 } | 6028 } |
| 5930 return supertype.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(c
lassElement.typeVariables)); | 6029 return supertype.substitute2(_typeArguments, classElement.type.typeArguments
); |
| 5931 } | 6030 } |
| 5932 List<Type2> get typeArguments => _typeArguments; | 6031 List<Type2> get typeArguments => _typeArguments; |
| 5933 List<TypeVariableElement> get typeVariables => element.typeVariables; | 6032 List<TypeVariableElement> get typeVariables => element.typeVariables; |
| 5934 int get hashCode { | 6033 int get hashCode { |
| 5935 ClassElement element = this.element; | 6034 ClassElement element = this.element; |
| 5936 if (element == null) { | 6035 if (element == null) { |
| 5937 return 0; | 6036 return 0; |
| 5938 } | 6037 } |
| 5939 return element.hashCode; | 6038 return element.hashCode; |
| 5940 } | 6039 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6180 return true; | 6279 return true; |
| 6181 } | 6280 } |
| 6182 } | 6281 } |
| 6183 for (InterfaceType mixinType in element.mixins) { | 6282 for (InterfaceType mixinType in element.mixins) { |
| 6184 if (((mixinType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedClass
es)) { | 6283 if (((mixinType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedClass
es)) { |
| 6185 return true; | 6284 return true; |
| 6186 } | 6285 } |
| 6187 } | 6286 } |
| 6188 return false; | 6287 return false; |
| 6189 } | 6288 } |
| 6190 bool isSubtypeOf2(InterfaceType type, Set<ClassElement> visitedClasses) { | 6289 bool isSubtypeOf2(InterfaceType type2, Set<ClassElement> visitedClasses) { |
| 6191 InterfaceType typeT = this; | 6290 InterfaceType typeT = this; |
| 6192 InterfaceType typeS = type; | 6291 InterfaceType typeS = type2; |
| 6193 ClassElement elementT = element; | 6292 ClassElement elementT = element; |
| 6194 if (elementT == null || visitedClasses.contains(elementT)) { | 6293 if (elementT == null || visitedClasses.contains(elementT)) { |
| 6195 return false; | 6294 return false; |
| 6196 } | 6295 } |
| 6197 javaSetAdd(visitedClasses, elementT); | 6296 javaSetAdd(visitedClasses, elementT); |
| 6198 typeT = substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(elementT.t
ypeVariables)); | 6297 typeT = substitute2(_typeArguments, elementT.type.typeArguments); |
| 6199 if (typeT == typeS) { | 6298 if (typeT == typeS) { |
| 6200 return true; | 6299 return true; |
| 6201 } else if (elementT == typeS.element) { | 6300 } else if (elementT == typeS.element) { |
| 6202 List<Type2> typeTArgs = typeT.typeArguments; | 6301 List<Type2> typeTArgs = typeT.typeArguments; |
| 6203 List<Type2> typeSArgs = typeS.typeArguments; | 6302 List<Type2> typeSArgs = typeS.typeArguments; |
| 6204 if (typeTArgs.length != typeSArgs.length) { | 6303 if (typeTArgs.length != typeSArgs.length) { |
| 6205 return false; | 6304 return false; |
| 6206 } | 6305 } |
| 6207 for (int i = 0; i < typeTArgs.length; i++) { | 6306 for (int i = 0; i < typeTArgs.length; i++) { |
| 6208 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { | 6307 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 6226 List<InterfaceType> mixinTypes = elementT.mixins; | 6325 List<InterfaceType> mixinTypes = elementT.mixins; |
| 6227 for (InterfaceType mixinType in mixinTypes) { | 6326 for (InterfaceType mixinType in mixinTypes) { |
| 6228 if (((mixinType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClasses)
) { | 6327 if (((mixinType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClasses)
) { |
| 6229 return true; | 6328 return true; |
| 6230 } | 6329 } |
| 6231 } | 6330 } |
| 6232 return false; | 6331 return false; |
| 6233 } | 6332 } |
| 6234 } | 6333 } |
| 6235 /** | 6334 /** |
| 6236 * The abstract class {@code TypeImpl} implements the behavior common to objects
representing the | 6335 * The abstract class `TypeImpl` implements the behavior common to objects repre
senting the |
| 6237 * declared type of elements in the element model. | 6336 * declared type of elements in the element model. |
| 6238 * @coverage dart.engine.type | 6337 * @coverage dart.engine.type |
| 6239 */ | 6338 */ |
| 6240 abstract class TypeImpl implements Type2 { | 6339 abstract class TypeImpl implements Type2 { |
| 6241 | 6340 |
| 6242 /** | 6341 /** |
| 6243 * Return an array containing the results of using the given argument types an
d parameter types to | 6342 * Return an array containing the results of using the given argument types an
d parameter types to |
| 6244 * perform a substitution on all of the given types. | 6343 * perform a substitution on all of the given types. |
| 6245 * @param types the types on which a substitution is to be performed | 6344 * @param types the types on which a substitution is to be performed |
| 6246 * @param argumentTypes the argument types for the substitution | 6345 * @param argumentTypes the argument types for the substitution |
| 6247 * @param parameterTypes the parameter types for the substitution | 6346 * @param parameterTypes the parameter types for the substitution |
| 6248 * @return the result of performing the substitution on each of the types | 6347 * @return the result of performing the substitution on each of the types |
| 6249 */ | 6348 */ |
| 6250 static List<Type2> substitute(List<Type2> types, List<Type2> argumentTypes, Li
st<Type2> parameterTypes) { | 6349 static List<Type2> substitute(List<Type2> types, List<Type2> argumentTypes, Li
st<Type2> parameterTypes) { |
| 6251 int length = types.length; | 6350 int length = types.length; |
| 6252 if (length == 0) { | 6351 if (length == 0) { |
| 6253 return types; | 6352 return types; |
| 6254 } | 6353 } |
| 6255 List<Type2> newTypes = new List<Type2>(length); | 6354 List<Type2> newTypes = new List<Type2>(length); |
| 6256 for (int i = 0; i < length; i++) { | 6355 for (int i = 0; i < length; i++) { |
| 6257 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); | 6356 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); |
| 6258 } | 6357 } |
| 6259 return newTypes; | 6358 return newTypes; |
| 6260 } | 6359 } |
| 6261 | 6360 |
| 6262 /** | 6361 /** |
| 6263 * The element representing the declaration of this type, or {@code null} if t
he type has not, or | 6362 * The element representing the declaration of this type, or `null` if the typ
e has not, or |
| 6264 * cannot, be associated with an element. | 6363 * cannot, be associated with an element. |
| 6265 */ | 6364 */ |
| 6266 Element _element; | 6365 Element _element; |
| 6267 | 6366 |
| 6268 /** | 6367 /** |
| 6269 * The name of this type, or {@code null} if the type does not have a name. | 6368 * The name of this type, or `null` if the type does not have a name. |
| 6270 */ | 6369 */ |
| 6271 String _name; | 6370 String _name; |
| 6272 | 6371 |
| 6273 /** | 6372 /** |
| 6274 * An empty array of types. | 6373 * An empty array of types. |
| 6275 */ | 6374 */ |
| 6276 static List<Type2> EMPTY_ARRAY = new List<Type2>(0); | 6375 static List<Type2> EMPTY_ARRAY = new List<Type2>(0); |
| 6277 | 6376 |
| 6278 /** | 6377 /** |
| 6279 * Initialize a newly created type to be declared by the given element and to
have the given name. | 6378 * Initialize a newly created type to be declared by the given element and to
have the given name. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 6307 */ | 6406 */ |
| 6308 void appendTo(JavaStringBuilder builder) { | 6407 void appendTo(JavaStringBuilder builder) { |
| 6309 if (_name == null) { | 6408 if (_name == null) { |
| 6310 builder.append("<unnamed type>"); | 6409 builder.append("<unnamed type>"); |
| 6311 } else { | 6410 } else { |
| 6312 builder.append(_name); | 6411 builder.append(_name); |
| 6313 } | 6412 } |
| 6314 } | 6413 } |
| 6315 } | 6414 } |
| 6316 /** | 6415 /** |
| 6317 * Instances of the class {@code TypeVariableTypeImpl} defines the behavior of o
bjects representing | 6416 * Instances of the class `TypeVariableTypeImpl` defines the behavior of objects
representing |
| 6318 * the type introduced by a type variable. | 6417 * the type introduced by a type variable. |
| 6319 * @coverage dart.engine.type | 6418 * @coverage dart.engine.type |
| 6320 */ | 6419 */ |
| 6321 class TypeVariableTypeImpl extends TypeImpl implements TypeVariableType { | 6420 class TypeVariableTypeImpl extends TypeImpl implements TypeVariableType { |
| 6322 | 6421 |
| 6323 /** | 6422 /** |
| 6423 * An empty array of type variable types. |
| 6424 */ |
| 6425 static List<TypeVariableType> EMPTY_ARRAY = new List<TypeVariableType>(0); |
| 6426 |
| 6427 /** |
| 6324 * Return an array containing the type variable types defined by the given arr
ay of type variable | 6428 * Return an array containing the type variable types defined by the given arr
ay of type variable |
| 6325 * elements. | 6429 * elements. |
| 6326 * @param typeVariables the type variable elements defining the type variable
types to be returned | 6430 * @param typeVariables the type variable elements defining the type variable
types to be returned |
| 6327 * @return the type variable types defined by the type variable elements | 6431 * @return the type variable types defined by the type variable elements |
| 6328 */ | 6432 */ |
| 6329 static List<TypeVariableType> getTypes(List<TypeVariableElement> typeVariables
) { | 6433 static List<TypeVariableType> getTypes(List<TypeVariableElement> typeVariables
) { |
| 6330 int count = typeVariables.length; | 6434 int count = typeVariables.length; |
| 6435 if (count == 0) { |
| 6436 return EMPTY_ARRAY; |
| 6437 } |
| 6331 List<TypeVariableType> types = new List<TypeVariableType>(count); | 6438 List<TypeVariableType> types = new List<TypeVariableType>(count); |
| 6332 for (int i = 0; i < count; i++) { | 6439 for (int i = 0; i < count; i++) { |
| 6333 types[i] = typeVariables[i].type; | 6440 types[i] = typeVariables[i].type; |
| 6334 } | 6441 } |
| 6335 return types; | 6442 return types; |
| 6336 } | 6443 } |
| 6337 | 6444 |
| 6338 /** | 6445 /** |
| 6339 * Initialize a newly created type variable to be declared by the given elemen
t and to have the | 6446 * Initialize a newly created type variable to be declared by the given elemen
t and to have the |
| 6340 * given name. | 6447 * given name. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6354 int length = parameterTypes.length; | 6461 int length = parameterTypes.length; |
| 6355 for (int i = 0; i < length; i++) { | 6462 for (int i = 0; i < length; i++) { |
| 6356 if (parameterTypes[i] == this) { | 6463 if (parameterTypes[i] == this) { |
| 6357 return argumentTypes[i]; | 6464 return argumentTypes[i]; |
| 6358 } | 6465 } |
| 6359 } | 6466 } |
| 6360 return this; | 6467 return this; |
| 6361 } | 6468 } |
| 6362 } | 6469 } |
| 6363 /** | 6470 /** |
| 6364 * The unique instance of the class {@code VoidTypeImpl} implements the type {@c
ode void}. | 6471 * The unique instance of the class `VoidTypeImpl` implements the type `void`. |
| 6365 * @coverage dart.engine.type | 6472 * @coverage dart.engine.type |
| 6366 */ | 6473 */ |
| 6367 class VoidTypeImpl extends TypeImpl implements VoidType { | 6474 class VoidTypeImpl extends TypeImpl implements VoidType { |
| 6368 | 6475 |
| 6369 /** | 6476 /** |
| 6370 * The unique instance of this class. | 6477 * The unique instance of this class. |
| 6371 */ | 6478 */ |
| 6372 static VoidTypeImpl _INSTANCE = new VoidTypeImpl(); | 6479 static VoidTypeImpl _INSTANCE = new VoidTypeImpl(); |
| 6373 | 6480 |
| 6374 /** | 6481 /** |
| 6375 * Return the unique instance of this class. | 6482 * Return the unique instance of this class. |
| 6376 * @return the unique instance of this class | 6483 * @return the unique instance of this class |
| 6377 */ | 6484 */ |
| 6378 static VoidTypeImpl get instance => _INSTANCE; | 6485 static VoidTypeImpl get instance => _INSTANCE; |
| 6379 | 6486 |
| 6380 /** | 6487 /** |
| 6381 * Prevent the creation of instances of this class. | 6488 * Prevent the creation of instances of this class. |
| 6382 */ | 6489 */ |
| 6383 VoidTypeImpl() : super(null, Keyword.VOID.syntax) { | 6490 VoidTypeImpl() : super(null, Keyword.VOID.syntax) { |
| 6384 } | 6491 } |
| 6385 bool operator ==(Object object) => identical(object, this); | 6492 bool operator ==(Object object) => identical(object, this); |
| 6386 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); |
| 6387 bool isVoid() => true; | 6494 bool isVoid() => true; |
| 6388 VoidTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
) => this; | 6495 VoidTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
) => this; |
| 6389 } | 6496 } |
| 6390 /** | 6497 /** |
| 6391 * The interface {@code FunctionType} defines the behavior common to objects rep
resenting the type | 6498 * The interface `FunctionType` defines the behavior common to objects represent
ing the type |
| 6392 * 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: |
| 6393 * <ol> | 6500 * <ol> |
| 6394 * <li>The types of functions that only have required parameters. These have the
general form | 6501 * * The types of functions that only have required parameters. These have the g
eneral form |
| 6395 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>.</li> | 6502 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>. |
| 6396 * <li>The types of functions with optional positional parameters. These have th
e general form | 6503 * * The types of functions with optional positional parameters. These have the
general form |
| 6397 * <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>\]) → |
| 6398 * T</i>.</li> | 6505 * T</i>. |
| 6399 * <li>The types of functions with named parameters. These have the general form
<i>(T<sub>1</sub>, | 6506 * * The types of functions with named parameters. These have the general form <
i>(T<sub>1</sub>, |
| 6400 * …, T<sub>n</sub>, {T<sub>x1</sub> x1, …, T<sub>xk</sub> xk}) &r
arr; T</i>.</li> | 6507 * …, T<sub>n</sub>, {T<sub>x1</sub> x1, …, T<sub>xk</sub> xk}) &r
arr; T</i>. |
| 6401 * </ol> | 6508 * </ol> |
| 6402 * @coverage dart.engine.type | 6509 * @coverage dart.engine.type |
| 6403 */ | 6510 */ |
| 6404 abstract class FunctionType implements ParameterizedType { | 6511 abstract class FunctionType implements ParameterizedType { |
| 6405 | 6512 |
| 6406 /** | 6513 /** |
| 6407 * Return a map from the names of named parameters to the types of the named p
arameters of this | 6514 * Return a map from the names of named parameters to the types of the named p
arameters of this |
| 6408 * type of function. The entries in the map will be iterated in the same order
as the order in | 6515 * type of function. The entries in the map will be iterated in the same order
as the order in |
| 6409 * which the named parameters were defined. If there were no named parameters
declared then the | 6516 * which the named parameters were defined. If there were no named parameters
declared then the |
| 6410 * map will be empty. | 6517 * map will be empty. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 6435 */ | 6542 */ |
| 6436 List<ParameterElement> get parameters; | 6543 List<ParameterElement> get parameters; |
| 6437 | 6544 |
| 6438 /** | 6545 /** |
| 6439 * Return the type of object returned by this type of function. | 6546 * Return the type of object returned by this type of function. |
| 6440 * @return the type of object returned by this type of function | 6547 * @return the type of object returned by this type of function |
| 6441 */ | 6548 */ |
| 6442 Type2 get returnType; | 6549 Type2 get returnType; |
| 6443 | 6550 |
| 6444 /** | 6551 /** |
| 6445 * Return {@code true} if this type is a subtype of the given type. | 6552 * Return `true` if this type is a subtype of the given type. |
| 6446 * <p> | 6553 * |
| 6447 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i> is
a subtype of the | 6554 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i> is
a subtype of the |
| 6448 * function type <i>(S<sub>1</sub>, …, S<sub>n</sub>) → S</i>, if
all of the following | 6555 * function type <i>(S<sub>1</sub>, …, S<sub>n</sub>) → S</i>, if
all of the following |
| 6449 * conditions are met: | 6556 * conditions are met: |
| 6450 * <ul> | 6557 * |
| 6451 * <li>Either | 6558 * * Either |
| 6452 * <ul> | 6559 * |
| 6453 * <li><i>S</i> is void, or</li> | 6560 * * <i>S</i> is void, or |
| 6454 * <li><i>T ⇔ S</i>.</li> | 6561 * * <i>T ⇔ S</i>. |
| 6455 * </ul> | 6562 * |
| 6456 * </li> | 6563 * |
| 6457 * <li>For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<
sub>i</sub></i>.</li> | 6564 * * For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<su
b>i</sub></i>. |
| 6458 * </ul> | 6565 * |
| 6459 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</su
b>, …, | 6566 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</su
b>, …, |
| 6460 * T<sub>n+k</sub>\]) → T</i> is a subtype of the function type <i>(S<sub
>1</sub>, …, | 6567 * T<sub>n+k</sub>\]) → T</i> is a subtype of the function type <i>(S<sub
>1</sub>, …, |
| 6461 * S<sub>n</sub>, \[S<sub>n+1</sub>, …, S<sub>n+m</sub>\]) → S</i>
, if all of the | 6568 * S<sub>n</sub>, \[S<sub>n+1</sub>, …, S<sub>n+m</sub>\]) → S</i>
, if all of the |
| 6462 * following conditions are met: | 6569 * following conditions are met: |
| 6463 * <ul> | 6570 * |
| 6464 * <li>Either | 6571 * * Either |
| 6465 * <ul> | 6572 * |
| 6466 * <li><i>S</i> is void, or</li> | 6573 * * <i>S</i> is void, or |
| 6467 * <li><i>T ⇔ S</i>.</li> | 6574 * * <i>T ⇔ S</i>. |
| 6468 * </ul> | 6575 * |
| 6469 * </li> | 6576 * |
| 6470 * <li><i>k</i> >= <i>m</i> and for all <i>i</i>, 1 <= <i>i</i> <= <i>n+m</i>,
<i>T<sub>i</sub> | 6577 * * <i>k</i> >= <i>m</i> and for all <i>i</i>, 1 <= <i>i</i> <= <i>n+m</i>, <
i>T<sub>i</sub> |
| 6471 * ⇔ S<sub>i</sub></i>.</li> | 6578 * ⇔ S<sub>i</sub></i>. |
| 6472 * </ul> | 6579 * |
| 6473 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, {T<sub>x1</sub>
x1, …, | 6580 * A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, {T<sub>x1</sub>
x1, …, |
| 6474 * T<sub>xk</sub> xk}) → T</i> is a subtype of the function type <i>(S<su
b>1</sub>, …, | 6581 * T<sub>xk</sub> xk}) → T</i> is a subtype of the function type <i>(S<su
b>1</sub>, …, |
| 6475 * S<sub>n</sub>, {S<sub>y1</sub> y1, …, S<sub>ym</sub> ym}) → S</
i>, if all of the | 6582 * S<sub>n</sub>, {S<sub>y1</sub> y1, …, S<sub>ym</sub> ym}) → S</
i>, if all of the |
| 6476 * following conditions are met: | 6583 * following conditions are met: |
| 6477 * <ul> | 6584 * |
| 6478 * <li>Either | 6585 * * Either |
| 6479 * <ul> | 6586 * |
| 6480 * <li><i>S</i> is void,</li> | 6587 * * <i>S</i> is void, |
| 6481 * <li>or <i>T ⇔ S</i>.</li> | 6588 * * or <i>T ⇔ S</i>. |
| 6482 * </ul> | 6589 * |
| 6483 * </li> | 6590 * |
| 6484 * <li>For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<
sub>i</sub></i>.</li> | 6591 * * For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<su
b>i</sub></i>. |
| 6485 * <li><i>k</i> >= <i>m</i> and <i>y<sub>i</sub></i> in <i>{x<sub>1</sub>, &he
llip;, | 6592 * * <i>k</i> >= <i>m</i> and <i>y<sub>i</sub></i> in <i>{x<sub>1</sub>, &hell
ip;, |
| 6486 * x<sub>k</sub>}</i>, 1 <= <i>i</i> <= <i>m</i>.</li> | 6593 * x<sub>k</sub>}</i>, 1 <= <i>i</i> <= <i>m</i>. |
| 6487 * <li>For all <i>y<sub>i</sub></i> in <i>{y<sub>1</sub>, …, y<sub>m</s
ub>}</i>, | 6594 * * For all <i>y<sub>i</sub></i> in <i>{y<sub>1</sub>, …, y<sub>m</sub
>}</i>, |
| 6488 * <i>y<sub>i</sub> = x<sub>j</sub> => Tj ⇔ Si</i>.</li> | 6595 * <i>y<sub>i</sub> = x<sub>j</sub> => Tj ⇔ Si</i>. |
| 6489 * </ul> | 6596 * |
| 6490 * In addition, the following subtype rules apply: | 6597 * In addition, the following subtype rules apply: |
| 6491 * <p> | 6598 * |
| 6492 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[\]) → T <: (T<sub>1</sub
>, …, | 6599 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[\]) → T <: (T<sub>1</sub
>, …, |
| 6493 * T<sub>n</sub>) → T.</i><br> | 6600 * T<sub>n</sub>) → T.</i><br> |
| 6494 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, &he
llip;, | 6601 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, &he
llip;, |
| 6495 * T<sub>n</sub>, {}) → T.</i><br> | 6602 * T<sub>n</sub>, {}) → T.</i><br> |
| 6496 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, {}) → T <: (T<sub>1</sub>,
…, | 6603 * <i>(T<sub>1</sub>, …, T<sub>n</sub>, {}) → T <: (T<sub>1</sub>,
…, |
| 6497 * T<sub>n</sub>) → T.</i><br> | 6604 * T<sub>n</sub>) → T.</i><br> |
| 6498 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, &he
llip;, | 6605 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, &he
llip;, |
| 6499 * T<sub>n</sub>, \[\]) → T.</i> | 6606 * T<sub>n</sub>, \[\]) → T.</i> |
| 6500 * <p> | 6607 * |
| 6501 * All functions implement the class {@code Function}. However not all functio
n types are a | 6608 * All functions implement the class `Function`. However not all function type
s are a |
| 6502 * subtype of {@code Function}. If an interface type <i>I</i> includes a metho
d named{@code call()}, and the type of {@code call()} is the function type <i>F<
/i>, then <i>I</i> is | 6609 * subtype of `Function`. If an interface type <i>I</i> includes a method name
d`call()`, and the type of `call()` is the function type <i>F</i>, then <i>I</i>
is |
| 6503 * considered to be a subtype of <i>F</i>. | 6610 * considered to be a subtype of <i>F</i>. |
| 6504 * @param type the type being compared with this type | 6611 * @param type the type being compared with this type |
| 6505 * @return {@code true} if this type is a subtype of the given type | 6612 * @return `true` if this type is a subtype of the given type |
| 6506 */ | 6613 */ |
| 6507 bool isSubtypeOf(Type2 type); | 6614 bool isSubtypeOf(Type2 type); |
| 6508 | 6615 |
| 6509 /** | 6616 /** |
| 6510 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. | 6617 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. |
| 6511 * This is fully equivalent to {@code substitute(argumentTypes, getTypeArgumen
ts())}. | 6618 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. |
| 6512 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters | 6619 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters |
| 6513 * @return the result of performing the substitution | 6620 * @return the result of performing the substitution |
| 6514 */ | 6621 */ |
| 6515 FunctionType substitute4(List<Type2> argumentTypes); | 6622 FunctionType substitute4(List<Type2> argumentTypes); |
| 6516 FunctionType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
); | 6623 FunctionType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes
); |
| 6517 } | 6624 } |
| 6518 /** | 6625 /** |
| 6519 * The interface {@code InterfaceType} defines the behavior common to objects re
presenting the type | 6626 * The interface `InterfaceType` defines the behavior common to objects represen
ting the type |
| 6520 * introduced by either a class or an interface, or a reference to such a type. | 6627 * introduced by either a class or an interface, or a reference to such a type. |
| 6521 * @coverage dart.engine.type | 6628 * @coverage dart.engine.type |
| 6522 */ | 6629 */ |
| 6523 abstract class InterfaceType implements ParameterizedType { | 6630 abstract class InterfaceType implements ParameterizedType { |
| 6631 |
| 6632 /** |
| 6633 * Return an array containing all of the accessors (getters and setters) decla
red in this type. |
| 6634 * @return the accessors declared in this type |
| 6635 */ |
| 6636 List<PropertyAccessorElement> get accessors; |
| 6524 ClassElement get element; | 6637 ClassElement get element; |
| 6525 | 6638 |
| 6526 /** | 6639 /** |
| 6527 * Return the element representing the getter with the given name that is decl
ared in this class, | 6640 * Return the element representing the getter with the given name that is decl
ared in this class, |
| 6528 * or {@code null} if this class does not declare a getter with the given name
. | 6641 * or `null` if this class does not declare a getter with the given name. |
| 6529 * @param getterName the name of the getter to be returned | 6642 * @param getterName the name of the getter to be returned |
| 6530 * @return the getter declared in this class with the given name | 6643 * @return the getter declared in this class with the given name |
| 6531 */ | 6644 */ |
| 6532 PropertyAccessorElement getGetter(String getterName); | 6645 PropertyAccessorElement getGetter(String getterName); |
| 6533 | 6646 |
| 6534 /** | 6647 /** |
| 6535 * Return an array containing all of the interfaces that are implemented by th
is interface. Note | 6648 * Return an array containing all of the interfaces that are implemented by th
is interface. Note |
| 6536 * that this is <b>not</b>, in general, equivalent to getting the interfaces f
rom this type's | 6649 * that this is <b>not</b>, in general, equivalent to getting the interfaces f
rom this type's |
| 6537 * element because the types returned by this method will have had their type
parameters replaced. | 6650 * element because the types returned by this method will have had their type
parameters replaced. |
| 6538 * @return the interfaces that are implemented by this type | 6651 * @return the interfaces that are implemented by this type |
| 6539 */ | 6652 */ |
| 6540 List<InterfaceType> get interfaces; | 6653 List<InterfaceType> get interfaces; |
| 6541 | 6654 |
| 6542 /** | 6655 /** |
| 6543 * Return the least upper bound of this type and the given type, or {@code nul
l} if there is no | 6656 * Return the least upper bound of this type and the given type, or `null` if
there is no |
| 6544 * least upper bound. | 6657 * least upper bound. |
| 6545 * <p> | 6658 * |
| 6546 * Given two interfaces <i>I</i> and <i>J</i>, let <i>S<sub>I</sub></i> be the
set of | 6659 * Given two interfaces <i>I</i> and <i>J</i>, let <i>S<sub>I</sub></i> be the
set of |
| 6547 * superinterfaces of <i>I<i>, let <i>S<sub>J</sub></i> be the set of superint
erfaces of <i>J</i> | 6660 * superinterfaces of <i>I<i>, let <i>S<sub>J</sub></i> be the set of superint
erfaces of <i>J</i> |
| 6548 * and let <i>S = (I ∪ S<sub>I</sub>) ∩ (J ∪ S<sub>J</sub>)</i>. F
urthermore, we | 6661 * and let <i>S = (I ∪ S<sub>I</sub>) ∩ (J ∪ S<sub>J</sub>)</i>. F
urthermore, we |
| 6549 * define <i>S<sub>n</sub> = {T | T ∈ S ∧ depth(T) = n}</i> for any f
inite <i>n</i>, | 6662 * define <i>S<sub>n</sub> = {T | T ∈ S ∧ depth(T) = n}</i> for any f
inite <i>n</i>, |
| 6550 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat
h from <i>T</i> to | 6663 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat
h from <i>T</i> to |
| 6551 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub
></i> has | 6664 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub
></i> has |
| 6552 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole
element of | 6665 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole
element of |
| 6553 * <i>S<sub>q</sub></i>. | 6666 * <i>S<sub>q</sub></i>. |
| 6554 * @param type the other type used to compute the least upper bound | 6667 * @param type the other type used to compute the least upper bound |
| 6555 * @return the least upper bound of this type and the given type | 6668 * @return the least upper bound of this type and the given type |
| 6556 */ | 6669 */ |
| 6557 Type2 getLeastUpperBound(Type2 type); | 6670 Type2 getLeastUpperBound(Type2 type); |
| 6558 | 6671 |
| 6559 /** | 6672 /** |
| 6560 * Return the element representing the method with the given name that is decl
ared in this class, | 6673 * Return the element representing the method with the given name that is decl
ared in this class, |
| 6561 * or {@code null} if this class does not declare a method with the given name
. | 6674 * or `null` if this class does not declare a method with the given name. |
| 6562 * @param methodName the name of the method to be returned | 6675 * @param methodName the name of the method to be returned |
| 6563 * @return the method declared in this class with the given name | 6676 * @return the method declared in this class with the given name |
| 6564 */ | 6677 */ |
| 6565 MethodElement getMethod(String methodName); | 6678 MethodElement getMethod(String methodName); |
| 6566 | 6679 |
| 6567 /** | 6680 /** |
| 6681 * Return an array containing all of the methods declared in this type. |
| 6682 * @return the methods declared in this type |
| 6683 */ |
| 6684 List<MethodElement> get methods; |
| 6685 |
| 6686 /** |
| 6568 * Return an array containing all of the mixins that are applied to the class
being extended in | 6687 * Return an array containing all of the mixins that are applied to the class
being extended in |
| 6569 * order to derive the superclass of this class. Note that this is <b>not</b>,
in general, | 6688 * order to derive the superclass of this class. Note that this is <b>not</b>,
in general, |
| 6570 * equivalent to getting the mixins from this type's element because the types
returned by this | 6689 * equivalent to getting the mixins from this type's element because the types
returned by this |
| 6571 * method will have had their type parameters replaced. | 6690 * method will have had their type parameters replaced. |
| 6572 * @return the mixins that are applied to derive the superclass of this class | 6691 * @return the mixins that are applied to derive the superclass of this class |
| 6573 */ | 6692 */ |
| 6574 List<InterfaceType> get mixins; | 6693 List<InterfaceType> get mixins; |
| 6575 | 6694 |
| 6576 /** | 6695 /** |
| 6577 * Return the element representing the setter with the given name that is decl
ared in this class, | 6696 * Return the element representing the setter with the given name that is decl
ared in this class, |
| 6578 * or {@code null} if this class does not declare a setter with the given name
. | 6697 * or `null` if this class does not declare a setter with the given name. |
| 6579 * @param setterName the name of the setter to be returned | 6698 * @param setterName the name of the setter to be returned |
| 6580 * @return the setter declared in this class with the given name | 6699 * @return the setter declared in this class with the given name |
| 6581 */ | 6700 */ |
| 6582 PropertyAccessorElement getSetter(String setterName); | 6701 PropertyAccessorElement getSetter(String setterName); |
| 6583 | 6702 |
| 6584 /** | 6703 /** |
| 6585 * Return the type representing the superclass of this type, or null if this t
ype represents the | 6704 * Return the type representing the superclass of this type, or null if this t
ype represents the |
| 6586 * class 'Object'. Note that this is <b>not</b>, in general, equivalent to get
ting the superclass | 6705 * class 'Object'. Note that this is <b>not</b>, in general, equivalent to get
ting the superclass |
| 6587 * from this type's element because the type returned by this method will have
had it's type | 6706 * from this type's element because the type returned by this method will have
had it's type |
| 6588 * parameters replaced. | 6707 * parameters replaced. |
| 6589 * @return the superclass of this type | 6708 * @return the superclass of this type |
| 6590 */ | 6709 */ |
| 6591 InterfaceType get superclass; | 6710 InterfaceType get superclass; |
| 6592 | 6711 |
| 6593 /** | 6712 /** |
| 6594 * Return {@code true} if this type is a direct supertype of the given type. T
he implicit | 6713 * Return `true` if this type is a direct supertype of the given type. The imp
licit |
| 6595 * interface of class <i>I</i> is a direct supertype of the implicit interface
of class <i>J</i> | 6714 * interface of class <i>I</i> is a direct supertype of the implicit interface
of class <i>J</i> |
| 6596 * iff: | 6715 * iff: |
| 6597 * <ul> | 6716 * |
| 6598 * <li><i>I</i> is Object, and <i>J</i> has no extends clause.</li> | 6717 * * <i>I</i> is Object, and <i>J</i> has no extends clause. |
| 6599 * <li><i>I</i> is listed in the extends clause of <i>J</i>.</li> | 6718 * * <i>I</i> is listed in the extends clause of <i>J</i>. |
| 6600 * <li><i>I</i> is listed in the implements clause of <i>J</i>.</li> | 6719 * * <i>I</i> is listed in the implements clause of <i>J</i>. |
| 6601 * <li><i>I</i> is listed in the with clause of <i>J</i>.</li> | 6720 * * <i>I</i> is listed in the with clause of <i>J</i>. |
| 6602 * <li><i>J</i> is a mixin application of the mixin of <i>I</i>.</li> | 6721 * * <i>J</i> is a mixin application of the mixin of <i>I</i>. |
| 6603 * </ul> | 6722 * |
| 6604 * @param type the type being compared with this type | 6723 * @param type the type being compared with this type |
| 6605 * @return {@code true} if this type is a direct supertype of the given type | 6724 * @return `true` if this type is a direct supertype of the given type |
| 6606 */ | 6725 */ |
| 6607 bool isDirectSupertypeOf(InterfaceType type); | 6726 bool isDirectSupertypeOf(InterfaceType type); |
| 6608 | 6727 |
| 6609 /** | 6728 /** |
| 6610 * Return {@code true} if this type is more specific than the given type. An i
nterface type | 6729 * Return `true` if this type is more specific than the given type. An interfa
ce type |
| 6611 * <i>T</i> is more specific than an interface type <i>S</i>, written <i>T &la
quo; S</i>, if one | 6730 * <i>T</i> is more specific than an interface type <i>S</i>, written <i>T &la
quo; S</i>, if one |
| 6612 * of the following conditions is met: | 6731 * of the following conditions is met: |
| 6613 * <ul> | 6732 * |
| 6614 * <li>Reflexivity: <i>T</i> is <i>S</i>. | 6733 * * Reflexivity: <i>T</i> is <i>S</i>. |
| 6615 * <li><i>T</i> is bottom. | 6734 * * <i>T</i> is bottom. |
| 6616 * <li><i>S</i> is dynamic. | 6735 * * <i>S</i> is dynamic. |
| 6617 * <li>Direct supertype: <i>S</i> is a direct supertype of <i>T</i>. | 6736 * * Direct supertype: <i>S</i> is a direct supertype of <i>T</i>. |
| 6618 * <li><i>T</i> is a type variable and <i>S</i> is the upper bound of <i>T</i>
. | 6737 * * <i>T</i> is a type variable and <i>S</i> is the upper bound of <i>T</i>. |
| 6619 * <li>Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<
sub>n</sub>></i> | 6738 * * Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<su
b>n</sub>></i> |
| 6620 * and S</i> is of the form <i>I<S<sub>1</sub>, …, S<sub>n</sub>>
</i> and | 6739 * and S</i> is of the form <i>I<S<sub>1</sub>, …, S<sub>n</sub>>
</i> and |
| 6621 * <i>T<sub>i</sub> « S<sub>i</sub></i>, <i>1 <= i <= n</i>. | 6740 * <i>T<sub>i</sub> « S<sub>i</sub></i>, <i>1 <= i <= n</i>. |
| 6622 * <li>Transitivity: <i>T « U</i> and <i>U « S</i>. | 6741 * * Transitivity: <i>T « U</i> and <i>U « S</i>. |
| 6623 * </ul> | 6742 * |
| 6624 * @param type the type being compared with this type | 6743 * @param type the type being compared with this type |
| 6625 * @return {@code true} if this type is more specific than the given type | 6744 * @return `true` if this type is more specific than the given type |
| 6626 */ | 6745 */ |
| 6627 bool isMoreSpecificThan(Type2 type); | 6746 bool isMoreSpecificThan(Type2 type); |
| 6628 | 6747 |
| 6629 /** | 6748 /** |
| 6630 * Return {@code true} if this type is a subtype of the given type. An interfa
ce type <i>T</i> is | 6749 * Return `true` if this type is a subtype of the given type. An interface typ
e <i>T</i> is |
| 6631 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff | 6750 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff |
| 6632 * <i>\[bottom/dynamic\]T</i> « <i>S</i> (<i>T</i> is more specific than
<i>S</i>). If an | 6751 * <i>\[bottom/dynamic\]T</i> « <i>S</i> (<i>T</i> is more specific than
<i>S</i>). If an |
| 6633 * interface type <i>I</i> includes a method named <i>call()</i>, and the type
of <i>call()</i> is | 6752 * interface type <i>I</i> includes a method named <i>call()</i>, and the type
of <i>call()</i> is |
| 6634 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of
<i>F</i>. | 6753 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of
<i>F</i>. |
| 6635 * @param type the type being compared with this type | 6754 * @param type the type being compared with this type |
| 6636 * @return {@code true} if this type is a subtype of the given type | 6755 * @return `true` if this type is a subtype of the given type |
| 6637 */ | 6756 */ |
| 6638 bool isSubtypeOf(Type2 type); | 6757 bool isSubtypeOf(Type2 type); |
| 6639 | 6758 |
| 6640 /** | 6759 /** |
| 6641 * Return the element representing the constructor that results from looking u
p the given | 6760 * Return the element representing the constructor that results from looking u
p the given |
| 6642 * constructor in this class with respect to the given library, or {@code null
} if the look up | 6761 * constructor in this class with respect to the given library, or `null` if t
he look up |
| 6643 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section | 6762 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section |
| 6644 * 12.11.1: <blockquote>If <i>e</i> is of the form <b>new</b> <i>T.id()</i> th
en let <i>q<i> be | 6763 * 12.11.1: <blockquote>If <i>e</i> is of the form <b>new</b> <i>T.id()</i> th
en let <i>q<i> be |
| 6645 * the constructor <i>T.id</i>, otherwise let <i>q<i> be the constructor <i>T<
i>. Otherwise, if | 6764 * the constructor <i>T.id</i>, otherwise let <i>q<i> be the constructor <i>T<
i>. Otherwise, if |
| 6646 * <i>q</i> is not defined or not accessible, a NoSuchMethodException is throw
n. </blockquote> | 6765 * <i>q</i> is not defined or not accessible, a NoSuchMethodException is throw
n. </blockquote> |
| 6647 * @param constructorName the name of the constructor being looked up | 6766 * @param constructorName the name of the constructor being looked up |
| 6648 * @param library the library with respect to which the lookup is being perfor
med | 6767 * @param library the library with respect to which the lookup is being perfor
med |
| 6649 * @return the result of looking up the given constructor in this class with r
espect to the given | 6768 * @return the result of looking up the given constructor in this class with r
espect to the given |
| 6650 * library | 6769 * library |
| 6651 */ | 6770 */ |
| 6652 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary); | 6771 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary); |
| 6653 | 6772 |
| 6654 /** | 6773 /** |
| 6655 * Return the element representing the getter that results from looking up the
given getter in | 6774 * Return the element representing the getter that results from looking up the
given getter in |
| 6656 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 6775 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 6657 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: | 6776 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: |
| 6658 * <blockquote>The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> | 6777 * <blockquote>The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> |
| 6659 * with respect to library <i>L</i> is: | 6778 * with respect to library <i>L</i> is: |
| 6660 * <ul> | 6779 * |
| 6661 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>
m</i> that is | 6780 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 6662 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 6781 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| 6663 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 6782 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 6664 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 6783 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 6665 * Otherwise, we say that the lookup has failed.</li> | 6784 * Otherwise, we say that the lookup has failed. |
| 6666 * </ul> | 6785 * |
| 6667 * </blockquote> | 6786 * </blockquote> |
| 6668 * @param getterName the name of the getter being looked up | 6787 * @param getterName the name of the getter being looked up |
| 6669 * @param library the library with respect to which the lookup is being perfor
med | 6788 * @param library the library with respect to which the lookup is being perfor
med |
| 6670 * @return the result of looking up the given getter in this class with respec
t to the given | 6789 * @return the result of looking up the given getter in this class with respec
t to the given |
| 6671 * library | 6790 * library |
| 6672 */ | 6791 */ |
| 6673 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
); | 6792 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
); |
| 6674 | 6793 |
| 6675 /** | 6794 /** |
| 6676 * Return the element representing the getter that results from looking up the
given getter in the | 6795 * Return the element representing the getter that results from looking up the
given getter in the |
| 6677 * superclass of this class with respect to the given library, or {@code null}
if the look up | 6796 * superclass of this class with respect to the given library, or `null` if th
e look up |
| 6678 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section | 6797 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section |
| 6679 * 12.15.1: <blockquote>The result of looking up getter (respectively setter)
<i>m</i> in class | 6798 * 12.15.1: <blockquote>The result of looking up getter (respectively setter)
<i>m</i> in class |
| 6680 * <i>C</i> with respect to library <i>L</i> is: | 6799 * <i>C</i> with respect to library <i>L</i> is: |
| 6681 * <ul> | 6800 * |
| 6682 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>
m</i> that is | 6801 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 6683 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 6802 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| 6684 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 6803 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 6685 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 6804 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 6686 * Otherwise, we say that the lookup has failed.</li> | 6805 * Otherwise, we say that the lookup has failed. |
| 6687 * </ul> | 6806 * |
| 6688 * </blockquote> | 6807 * </blockquote> |
| 6689 * @param getterName the name of the getter being looked up | 6808 * @param getterName the name of the getter being looked up |
| 6690 * @param library the library with respect to which the lookup is being perfor
med | 6809 * @param library the library with respect to which the lookup is being perfor
med |
| 6691 * @return the result of looking up the given getter in this class with respec
t to the given | 6810 * @return the result of looking up the given getter in this class with respec
t to the given |
| 6692 * library | 6811 * library |
| 6693 */ | 6812 */ |
| 6694 PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryEle
ment library); | 6813 PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryEle
ment library); |
| 6695 | 6814 |
| 6696 /** | 6815 /** |
| 6697 * Return the element representing the method that results from looking up the
given method in | 6816 * Return the element representing the method that results from looking up the
given method in |
| 6698 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 6817 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 6699 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: | 6818 * behavior of this method is defined by the Dart Language Specification in se
ction 12.15.1: |
| 6700 * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> wit
h respect to library | 6819 * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> wit
h respect to library |
| 6701 * <i>L</i> is: | 6820 * <i>L</i> is: |
| 6702 * <ul> | 6821 * |
| 6703 * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessib
le to <i>L</i>, then | 6822 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible
to <i>L</i>, then |
| 6704 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then | 6823 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then |
| 6705 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect | 6824 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect |
| 6706 * to <i>L</i>. Otherwise, we say that the lookup has failed.</li> | 6825 * to <i>L</i>. Otherwise, we say that the lookup has failed. |
| 6707 * </ul> | 6826 * |
| 6708 * </blockquote> | 6827 * </blockquote> |
| 6709 * @param methodName the name of the method being looked up | 6828 * @param methodName the name of the method being looked up |
| 6710 * @param library the library with respect to which the lookup is being perfor
med | 6829 * @param library the library with respect to which the lookup is being perfor
med |
| 6711 * @return the result of looking up the given method in this class with respec
t to the given | 6830 * @return the result of looking up the given method in this class with respec
t to the given |
| 6712 * library | 6831 * library |
| 6713 */ | 6832 */ |
| 6714 MethodElement lookUpMethod(String methodName, LibraryElement library); | 6833 MethodElement lookUpMethod(String methodName, LibraryElement library); |
| 6715 | 6834 |
| 6716 /** | 6835 /** |
| 6717 * Return the element representing the method that results from looking up the
given method in the | 6836 * Return the element representing the method that results from looking up the
given method in the |
| 6718 * superclass of this class with respect to the given library, or {@code null}
if the look up | 6837 * superclass of this class with respect to the given library, or `null` if th
e look up |
| 6719 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section | 6838 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section |
| 6720 * 12.15.1: <blockquote> The result of looking up method <i>m</i> in class <i>
C</i> with respect | 6839 * 12.15.1: <blockquote> The result of looking up method <i>m</i> in class <i>
C</i> with respect |
| 6721 * to library <i>L</i> is: | 6840 * to library <i>L</i> is: |
| 6722 * <ul> | 6841 * |
| 6723 * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessib
le to <i>L</i>, then | 6842 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible
to <i>L</i>, then |
| 6724 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then | 6843 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super
class <i>S</i>, then |
| 6725 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect | 6844 * the result of the lookup is the result of looking up method <i>m</i> in <i>
S</i> with respect |
| 6726 * to <i>L</i>. Otherwise, we say that the lookup has failed.</li> | 6845 * to <i>L</i>. Otherwise, we say that the lookup has failed. |
| 6727 * </ul> | 6846 * |
| 6728 * </blockquote> | 6847 * </blockquote> |
| 6729 * @param methodName the name of the method being looked up | 6848 * @param methodName the name of the method being looked up |
| 6730 * @param library the library with respect to which the lookup is being perfor
med | 6849 * @param library the library with respect to which the lookup is being perfor
med |
| 6731 * @return the result of looking up the given method in this class with respec
t to the given | 6850 * @return the result of looking up the given method in this class with respec
t to the given |
| 6732 * library | 6851 * library |
| 6733 */ | 6852 */ |
| 6734 MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement libra
ry); | 6853 MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement libra
ry); |
| 6735 | 6854 |
| 6736 /** | 6855 /** |
| 6737 * Return the element representing the setter that results from looking up the
given setter in | 6856 * Return the element representing the setter that results from looking up the
given setter in |
| 6738 * this class with respect to the given library, or {@code null} if the look u
p fails. The | 6857 * this class with respect to the given library, or `null` if the look up fail
s. The |
| 6739 * behavior of this method is defined by the Dart Language Specification in se
ction 12.16: | 6858 * behavior of this method is defined by the Dart Language Specification in se
ction 12.16: |
| 6740 * <blockquote> The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> | 6859 * <blockquote> The result of looking up getter (respectively setter) <i>m</i>
in class <i>C</i> |
| 6741 * with respect to library <i>L</i> is: | 6860 * with respect to library <i>L</i> is: |
| 6742 * <ul> | 6861 * |
| 6743 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>
m</i> that is | 6862 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 6744 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 6863 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| 6745 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 6864 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 6746 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 6865 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 6747 * Otherwise, we say that the lookup has failed.</li> | 6866 * Otherwise, we say that the lookup has failed. |
| 6748 * </ul> | 6867 * |
| 6749 * </blockquote> | 6868 * </blockquote> |
| 6750 * @param setterName the name of the setter being looked up | 6869 * @param setterName the name of the setter being looked up |
| 6751 * @param library the library with respect to which the lookup is being perfor
med | 6870 * @param library the library with respect to which the lookup is being perfor
med |
| 6752 * @return the result of looking up the given setter in this class with respec
t to the given | 6871 * @return the result of looking up the given setter in this class with respec
t to the given |
| 6753 * library | 6872 * library |
| 6754 */ | 6873 */ |
| 6755 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); | 6874 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); |
| 6756 | 6875 |
| 6757 /** | 6876 /** |
| 6758 * Return the element representing the setter that results from looking up the
given setter in the | 6877 * Return the element representing the setter that results from looking up the
given setter in the |
| 6759 * superclass of this class with respect to the given library, or {@code null}
if the look up | 6878 * superclass of this class with respect to the given library, or `null` if th
e look up |
| 6760 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section | 6879 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section |
| 6761 * 12.16: <blockquote> The result of looking up getter (respectively setter) <
i>m</i> in class | 6880 * 12.16: <blockquote> The result of looking up getter (respectively setter) <
i>m</i> in class |
| 6762 * <i>C</i> with respect to library <i>L</i> is: | 6881 * <i>C</i> with respect to library <i>L</i> is: |
| 6763 * <ul> | 6882 * |
| 6764 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>
m</i> that is | 6883 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m<
/i> that is |
| 6765 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. | 6884 * accessible to <i>L</i>, then that getter (respectively setter) is the resul
t of the lookup. |
| 6766 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result | 6885 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo
okup is the result |
| 6767 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. | 6886 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec
t to <i>L</i>. |
| 6768 * Otherwise, we say that the lookup has failed.</li> | 6887 * Otherwise, we say that the lookup has failed. |
| 6769 * </ul> | 6888 * |
| 6770 * </blockquote> | 6889 * </blockquote> |
| 6771 * @param setterName the name of the setter being looked up | 6890 * @param setterName the name of the setter being looked up |
| 6772 * @param library the library with respect to which the lookup is being perfor
med | 6891 * @param library the library with respect to which the lookup is being perfor
med |
| 6773 * @return the result of looking up the given setter in this class with respec
t to the given | 6892 * @return the result of looking up the given setter in this class with respec
t to the given |
| 6774 * library | 6893 * library |
| 6775 */ | 6894 */ |
| 6776 PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryEle
ment library); | 6895 PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryEle
ment library); |
| 6777 | 6896 |
| 6778 /** | 6897 /** |
| 6779 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. | 6898 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. |
| 6780 * This is fully equivalent to {@code substitute(argumentTypes, getTypeArgumen
ts())}. | 6899 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. |
| 6781 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters | 6900 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters |
| 6782 * @return the result of performing the substitution | 6901 * @return the result of performing the substitution |
| 6783 */ | 6902 */ |
| 6784 InterfaceType substitute5(List<Type2> argumentTypes); | 6903 InterfaceType substitute5(List<Type2> argumentTypes); |
| 6785 InterfaceType substitute2(List<Type2> argumentTypes, List<Type2> parameterType
s); | 6904 InterfaceType substitute2(List<Type2> argumentTypes, List<Type2> parameterType
s); |
| 6786 } | 6905 } |
| 6787 /** | 6906 /** |
| 6788 * The interface {@code ParameterizedType} defines the behavior common to object
s representing the | 6907 * The interface `ParameterizedType` defines the behavior common to objects repr
esenting the |
| 6789 * type with type parameters, such as class and function type alias. | 6908 * type with type parameters, such as class and function type alias. |
| 6790 * @coverage dart.engine.type | 6909 * @coverage dart.engine.type |
| 6791 */ | 6910 */ |
| 6792 abstract class ParameterizedType implements Type2 { | 6911 abstract class ParameterizedType implements Type2 { |
| 6793 | 6912 |
| 6794 /** | 6913 /** |
| 6795 * Return an array containing the actual types of the type arguments. If this
type's element does | 6914 * Return an array containing the actual types of the type arguments. If this
type's element does |
| 6796 * not have type parameters, then the array should be empty (although it is po
ssible for type | 6915 * not have type parameters, then the array should be empty (although it is po
ssible for type |
| 6797 * arguments to be erroneously declared). If the element has type parameters a
nd the actual type | 6916 * arguments to be erroneously declared). If the element has type parameters a
nd the actual type |
| 6798 * does not explicitly include argument values, then the type "dynamic" will b
e automatically | 6917 * does not explicitly include argument values, then the type "dynamic" will b
e automatically |
| 6799 * provided. | 6918 * provided. |
| 6800 * @return the actual types of the type arguments | 6919 * @return the actual types of the type arguments |
| 6801 */ | 6920 */ |
| 6802 List<Type2> get typeArguments; | 6921 List<Type2> get typeArguments; |
| 6803 | 6922 |
| 6804 /** | 6923 /** |
| 6805 * Return an array containing all of the type variables declared for this type
. | 6924 * Return an array containing all of the type variables declared for this type
. |
| 6806 * @return the type variables declared for this type | 6925 * @return the type variables declared for this type |
| 6807 */ | 6926 */ |
| 6808 List<TypeVariableElement> get typeVariables; | 6927 List<TypeVariableElement> get typeVariables; |
| 6809 } | 6928 } |
| 6810 /** | 6929 /** |
| 6811 * The interface {@code Type} defines the behavior of objects representing the d
eclared type of | 6930 * The interface `Type` defines the behavior of objects representing the declare
d type of |
| 6812 * elements in the element model. | 6931 * elements in the element model. |
| 6813 * @coverage dart.engine.type | 6932 * @coverage dart.engine.type |
| 6814 */ | 6933 */ |
| 6815 abstract class Type2 { | 6934 abstract class Type2 { |
| 6816 | 6935 |
| 6817 /** | 6936 /** |
| 6818 * Return the name of this type as it should appear when presented to users in
contexts such as | 6937 * Return the name of this type as it should appear when presented to users in
contexts such as |
| 6819 * error messages. | 6938 * error messages. |
| 6820 * @return the name of this type | 6939 * @return the name of this type |
| 6821 */ | 6940 */ |
| 6822 String get displayName; | 6941 String get displayName; |
| 6823 | 6942 |
| 6824 /** | 6943 /** |
| 6825 * Return the element representing the declaration of this type, or {@code nul
l} if the type has | 6944 * Return the element representing the declaration of this type, or `null` if
the type has |
| 6826 * not, or cannot, be associated with an element. The former case will occur i
f the element model | 6945 * not, or cannot, be associated with an element. The former case will occur i
f the element model |
| 6827 * is not yet complete; the latter case will occur if this object represents a
n undefined type. | 6946 * is not yet complete; the latter case will occur if this object represents a
n undefined type. |
| 6828 * @return the element representing the declaration of this type | 6947 * @return the element representing the declaration of this type |
| 6829 */ | 6948 */ |
| 6830 Element get element; | 6949 Element get element; |
| 6831 | 6950 |
| 6832 /** | 6951 /** |
| 6833 * Return the least upper bound of this type and the given type, or {@code nul
l} if there is no | 6952 * Return the least upper bound of this type and the given type, or `null` if
there is no |
| 6834 * least upper bound. | 6953 * least upper bound. |
| 6835 * @param type the other type used to compute the least upper bound | 6954 * @param type the other type used to compute the least upper bound |
| 6836 * @return the least upper bound of this type and the given type | 6955 * @return the least upper bound of this type and the given type |
| 6837 */ | 6956 */ |
| 6838 Type2 getLeastUpperBound(Type2 type); | 6957 Type2 getLeastUpperBound(Type2 type); |
| 6839 | 6958 |
| 6840 /** | 6959 /** |
| 6841 * Return the name of this type, or {@code null} if the type does not have a n
ame, such as when | 6960 * Return the name of this type, or `null` if the type does not have a name, s
uch as when |
| 6842 * the type represents the type of an unnamed function. | 6961 * the type represents the type of an unnamed function. |
| 6843 * @return the name of this type | 6962 * @return the name of this type |
| 6844 */ | 6963 */ |
| 6845 String get name; | 6964 String get name; |
| 6846 | 6965 |
| 6847 /** | 6966 /** |
| 6848 * Return {@code true} if this type is assignable to the given type. A type <i
>T</i> may be | 6967 * Return `true` if this type is assignable to the given type. A type <i>T</i>
may be |
| 6849 * assigned to a type <i>S</i>, written <i>T</i> ⇔ <i>S</i>, iff either <
i>T</i> <: <i>S</i> | 6968 * assigned to a type <i>S</i>, written <i>T</i> ⇔ <i>S</i>, iff either <
i>T</i> <: <i>S</i> |
| 6850 * or <i>S</i> <: <i>T</i>. | 6969 * or <i>S</i> <: <i>T</i>. |
| 6851 * @param type the type being compared with this type | 6970 * @param type the type being compared with this type |
| 6852 * @return {@code true} if this type is assignable to the given type | 6971 * @return `true` if this type is assignable to the given type |
| 6853 */ | 6972 */ |
| 6854 bool isAssignableTo(Type2 type); | 6973 bool isAssignableTo(Type2 type); |
| 6855 | 6974 |
| 6856 /** | 6975 /** |
| 6857 * Return {@code true} if this type represents the type 'Function' defined in
the dart:core | 6976 * Return `true` if this type represents the type 'Function' defined in the da
rt:core |
| 6858 * library. | 6977 * library. |
| 6859 * @return {@code true} if this type represents the type 'Function' defined in
the dart:core | 6978 * @return `true` if this type represents the type 'Function' defined in the d
art:core |
| 6860 * library | 6979 * library |
| 6861 */ | 6980 */ |
| 6862 bool isDartCoreFunction(); | 6981 bool isDartCoreFunction(); |
| 6863 | 6982 |
| 6864 /** | 6983 /** |
| 6865 * Return {@code true} if this type represents the type 'dynamic'. | 6984 * Return `true` if this type represents the type 'dynamic'. |
| 6866 * @return {@code true} if this type represents the type 'dynamic' | 6985 * @return `true` if this type represents the type 'dynamic' |
| 6867 */ | 6986 */ |
| 6868 bool isDynamic(); | 6987 bool isDynamic(); |
| 6869 | 6988 |
| 6870 /** | 6989 /** |
| 6871 * Return {@code true} if this type is more specific than the given type. | 6990 * Return `true` if this type is more specific than the given type. |
| 6872 * @param type the type being compared with this type | 6991 * @param type the type being compared with this type |
| 6873 * @return {@code true} if this type is more specific than the given type | 6992 * @return `true` if this type is more specific than the given type |
| 6874 */ | 6993 */ |
| 6875 bool isMoreSpecificThan(Type2 type); | 6994 bool isMoreSpecificThan(Type2 type); |
| 6876 | 6995 |
| 6877 /** | 6996 /** |
| 6878 * Return {@code true} if this type represents the type 'Object'. | 6997 * Return `true` if this type represents the type 'Object'. |
| 6879 * @return {@code true} if this type represents the type 'Object' | 6998 * @return `true` if this type represents the type 'Object' |
| 6880 */ | 6999 */ |
| 6881 bool isObject(); | 7000 bool isObject(); |
| 6882 | 7001 |
| 6883 /** | 7002 /** |
| 6884 * Return {@code true} if this type is a subtype of the given type. | 7003 * Return `true` if this type is a subtype of the given type. |
| 6885 * @param type the type being compared with this type | 7004 * @param type the type being compared with this type |
| 6886 * @return {@code true} if this type is a subtype of the given type | 7005 * @return `true` if this type is a subtype of the given type |
| 6887 */ | 7006 */ |
| 6888 bool isSubtypeOf(Type2 type); | 7007 bool isSubtypeOf(Type2 type); |
| 6889 | 7008 |
| 6890 /** | 7009 /** |
| 6891 * Return {@code 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 |
| 6892 * 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>. |
| 6893 * @param type the type being compared with this type | 7012 * @param type the type being compared with this type |
| 6894 * @return {@code true} if this type is a supertype of the given type | 7013 * @return `true` if this type is a supertype of the given type |
| 6895 */ | 7014 */ |
| 6896 bool isSupertypeOf(Type2 type); | 7015 bool isSupertypeOf(Type2 type); |
| 6897 | 7016 |
| 6898 /** | 7017 /** |
| 6899 * Return {@code true} if this type represents the type 'void'. | 7018 * Return `true` if this type represents the type 'void'. |
| 6900 * @return {@code true} if this type represents the type 'void' | 7019 * @return `true` if this type represents the type 'void' |
| 6901 */ | 7020 */ |
| 6902 bool isVoid(); | 7021 bool isVoid(); |
| 6903 | 7022 |
| 6904 /** | 7023 /** |
| 6905 * 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 |
| 6906 * 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 |
| 6907 * <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 |
| 6908 * <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 |
| 6909 * <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 |
| 6910 * 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 |
| 6911 * directly. | 7030 * directly. |
| 6912 * @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 |
| 6913 * @param parameterTypes the parameters to be replaced | 7032 * @param parameterTypes the parameters to be replaced |
| 6914 * @return the result of performing the substitution | 7033 * @return the result of performing the substitution |
| 6915 */ | 7034 */ |
| 6916 Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 7035 Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
| 6917 } | 7036 } |
| 6918 /** | 7037 /** |
| 6919 * The interface {@code TypeVariableType} defines the behavior of objects repres
enting the type | 7038 * The interface `TypeVariableType` defines the behavior of objects representing
the type |
| 6920 * introduced by a type variable. | 7039 * introduced by a type variable. |
| 6921 * @coverage dart.engine.type | 7040 * @coverage dart.engine.type |
| 6922 */ | 7041 */ |
| 6923 abstract class TypeVariableType implements Type2 { | 7042 abstract class TypeVariableType implements Type2 { |
| 6924 TypeVariableElement get element; | 7043 TypeVariableElement get element; |
| 6925 } | 7044 } |
| 6926 /** | 7045 /** |
| 6927 * The interface {@code VoidType} defines the behavior of the unique object repr
esenting the type{@code void}. | 7046 * The interface `VoidType` defines the behavior of the unique object representi
ng the type`void`. |
| 6928 * @coverage dart.engine.type | 7047 * @coverage dart.engine.type |
| 6929 */ | 7048 */ |
| 6930 abstract class VoidType implements Type2 { | 7049 abstract class VoidType implements Type2 { |
| 6931 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 7050 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
| 6932 } | 7051 } |
| OLD | NEW |