| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.element; | 8 library engine.element; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 ConstructorElement getNamedConstructor(String name); | 122 ConstructorElement getNamedConstructor(String name); |
| 123 | 123 |
| 124 /** | 124 /** |
| 125 * Return the resolved [ClassDeclaration] node that declares this [ClassElemen
t]. | 125 * Return the resolved [ClassDeclaration] node that declares this [ClassElemen
t]. |
| 126 * | 126 * |
| 127 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 127 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 128 * resolving will be performed. | 128 * resolving will be performed. |
| 129 * | 129 * |
| 130 * @return the resolved [ClassDeclaration], not `null`. | 130 * @return the resolved [ClassDeclaration], not `null`. |
| 131 */ | 131 */ |
| 132 @override |
| 132 ClassDeclaration get node; | 133 ClassDeclaration get node; |
| 133 | 134 |
| 134 /** | 135 /** |
| 135 * Return the element representing the setter with the given name that is decl
ared in this class, | 136 * Return the element representing the setter with the given name that is decl
ared in this class, |
| 136 * or `null` if this class does not declare a setter with the given name. | 137 * or `null` if this class does not declare a setter with the given name. |
| 137 * | 138 * |
| 138 * @param setterName the name of the getter to be returned | 139 * @param setterName the name of the getter to be returned |
| 139 * @return the setter declared in this class with the given name | 140 * @return the setter declared in this class with the given name |
| 140 */ | 141 */ |
| 141 PropertyAccessorElement getSetter(String setterName); | 142 PropertyAccessorElement getSetter(String setterName); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 /** | 309 /** |
| 309 * The interface `ClassMemberElement` defines the behavior of elements that are
contained | 310 * The interface `ClassMemberElement` defines the behavior of elements that are
contained |
| 310 * within a [ClassElement]. | 311 * within a [ClassElement]. |
| 311 */ | 312 */ |
| 312 abstract class ClassMemberElement implements Element { | 313 abstract class ClassMemberElement implements Element { |
| 313 /** | 314 /** |
| 314 * Return the type in which this member is defined. | 315 * Return the type in which this member is defined. |
| 315 * | 316 * |
| 316 * @return the type in which this member is defined | 317 * @return the type in which this member is defined |
| 317 */ | 318 */ |
| 319 @override |
| 318 ClassElement get enclosingElement; | 320 ClassElement get enclosingElement; |
| 319 | 321 |
| 320 /** | 322 /** |
| 321 * Return `true` if this element is a static element. A static element is an e
lement that is | 323 * Return `true` if this element is a static element. A static element is an e
lement that is |
| 322 * not associated with a particular instance, but rather with an entire librar
y or class. | 324 * not associated with a particular instance, but rather with an entire librar
y or class. |
| 323 * | 325 * |
| 324 * @return `true` if this executable element is a static element | 326 * @return `true` if this executable element is a static element |
| 325 */ | 327 */ |
| 326 bool get isStatic; | 328 bool get isStatic; |
| 327 } | 329 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 346 * | 348 * |
| 347 * @return the Angular views defined in this compilation unit. | 349 * @return the Angular views defined in this compilation unit. |
| 348 */ | 350 */ |
| 349 List<AngularViewElement> get angularViews; | 351 List<AngularViewElement> get angularViews; |
| 350 | 352 |
| 351 /** | 353 /** |
| 352 * Return the library in which this compilation unit is defined. | 354 * Return the library in which this compilation unit is defined. |
| 353 * | 355 * |
| 354 * @return the library in which this compilation unit is defined | 356 * @return the library in which this compilation unit is defined |
| 355 */ | 357 */ |
| 358 @override |
| 356 LibraryElement get enclosingElement; | 359 LibraryElement get enclosingElement; |
| 357 | 360 |
| 358 /** | 361 /** |
| 359 * Return an array containing all of the top-level functions contained in this
compilation unit. | 362 * Return an array containing all of the top-level functions contained in this
compilation unit. |
| 360 * | 363 * |
| 361 * @return the top-level functions contained in this compilation unit | 364 * @return the top-level functions contained in this compilation unit |
| 362 */ | 365 */ |
| 363 List<FunctionElement> get functions; | 366 List<FunctionElement> get functions; |
| 364 | 367 |
| 365 /** | 368 /** |
| 366 * Return an array containing all of the function type aliases contained in th
is compilation unit. | 369 * Return an array containing all of the function type aliases contained in th
is compilation unit. |
| 367 * | 370 * |
| 368 * @return the function type aliases contained in this compilation unit | 371 * @return the function type aliases contained in this compilation unit |
| 369 */ | 372 */ |
| 370 List<FunctionTypeAliasElement> get functionTypeAliases; | 373 List<FunctionTypeAliasElement> get functionTypeAliases; |
| 371 | 374 |
| 372 /** | 375 /** |
| 373 * Return the resolved [CompilationUnit] node that declares this element. | 376 * Return the resolved [CompilationUnit] node that declares this element. |
| 374 * | 377 * |
| 375 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 378 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 376 * resolving will be performed. | 379 * resolving will be performed. |
| 377 * | 380 * |
| 378 * @return the resolved [CompilationUnit], not `null`. | 381 * @return the resolved [CompilationUnit], not `null`. |
| 379 */ | 382 */ |
| 383 @override |
| 380 CompilationUnit get node; | 384 CompilationUnit get node; |
| 381 | 385 |
| 382 /** | 386 /** |
| 383 * Return an array containing all of the top-level variables contained in this
compilation unit. | 387 * Return an array containing all of the top-level variables contained in this
compilation unit. |
| 384 * | 388 * |
| 385 * @return the top-level variables contained in this compilation unit | 389 * @return the top-level variables contained in this compilation unit |
| 386 */ | 390 */ |
| 387 List<TopLevelVariableElement> get topLevelVariables; | 391 List<TopLevelVariableElement> get topLevelVariables; |
| 388 | 392 |
| 389 /** | 393 /** |
| (...skipping 20 matching lines...) Expand all Loading... |
| 410 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme
nt { | 414 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme
nt { |
| 411 /** | 415 /** |
| 412 * Return the resolved [ConstructorDeclaration] node that declares this | 416 * Return the resolved [ConstructorDeclaration] node that declares this |
| 413 * [ConstructorElement] . | 417 * [ConstructorElement] . |
| 414 * | 418 * |
| 415 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 419 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 416 * resolving will be performed. | 420 * resolving will be performed. |
| 417 * | 421 * |
| 418 * @return the resolved [ConstructorDeclaration], not `null`. | 422 * @return the resolved [ConstructorDeclaration], not `null`. |
| 419 */ | 423 */ |
| 424 @override |
| 420 ConstructorDeclaration get node; | 425 ConstructorDeclaration get node; |
| 421 | 426 |
| 422 /** | 427 /** |
| 423 * Return the constructor to which this constructor is redirecting, or `null`
if this constructor | 428 * Return the constructor to which this constructor is redirecting, or `null`
if this constructor |
| 424 * does not redirect to another constructor or if the library containing this
constructor has | 429 * does not redirect to another constructor or if the library containing this
constructor has |
| 425 * not yet been resolved. | 430 * not yet been resolved. |
| 426 * | 431 * |
| 427 * @return the constructor to which this constructor is redirecting | 432 * @return the constructor to which this constructor is redirecting |
| 428 */ | 433 */ |
| 429 ConstructorElement get redirectedConstructor; | 434 ConstructorElement get redirectedConstructor; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 abstract class FunctionElement implements ExecutableElement, LocalElement { | 1076 abstract class FunctionElement implements ExecutableElement, LocalElement { |
| 1072 /** | 1077 /** |
| 1073 * Return the resolved [FunctionDeclaration] node that declares this [Function
Element] | 1078 * Return the resolved [FunctionDeclaration] node that declares this [Function
Element] |
| 1074 * . | 1079 * . |
| 1075 * | 1080 * |
| 1076 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 1081 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 1077 * resolving will be performed. | 1082 * resolving will be performed. |
| 1078 * | 1083 * |
| 1079 * @return the resolved [FunctionDeclaration], not `null`. | 1084 * @return the resolved [FunctionDeclaration], not `null`. |
| 1080 */ | 1085 */ |
| 1086 @override |
| 1081 FunctionDeclaration get node; | 1087 FunctionDeclaration get node; |
| 1082 } | 1088 } |
| 1083 | 1089 |
| 1084 /** | 1090 /** |
| 1085 * The interface `FunctionTypeAliasElement` defines the behavior of elements rep
resenting a | 1091 * The interface `FunctionTypeAliasElement` defines the behavior of elements rep
resenting a |
| 1086 * function type alias (`typedef`). | 1092 * function type alias (`typedef`). |
| 1087 */ | 1093 */ |
| 1088 abstract class FunctionTypeAliasElement implements Element { | 1094 abstract class FunctionTypeAliasElement implements Element { |
| 1089 /** | 1095 /** |
| 1090 * Return the compilation unit in which this type alias is defined. | 1096 * Return the compilation unit in which this type alias is defined. |
| 1091 * | 1097 * |
| 1092 * @return the compilation unit in which this type alias is defined | 1098 * @return the compilation unit in which this type alias is defined |
| 1093 */ | 1099 */ |
| 1100 @override |
| 1094 CompilationUnitElement get enclosingElement; | 1101 CompilationUnitElement get enclosingElement; |
| 1095 | 1102 |
| 1096 /** | 1103 /** |
| 1097 * Return the resolved [FunctionTypeAlias] node that declares this | 1104 * Return the resolved [FunctionTypeAlias] node that declares this |
| 1098 * [FunctionTypeAliasElement] . | 1105 * [FunctionTypeAliasElement] . |
| 1099 * | 1106 * |
| 1100 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 1107 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 1101 * resolving will be performed. | 1108 * resolving will be performed. |
| 1102 * | 1109 * |
| 1103 * @return the resolved [FunctionTypeAlias], not `null`. | 1110 * @return the resolved [FunctionTypeAlias], not `null`. |
| 1104 */ | 1111 */ |
| 1112 @override |
| 1105 FunctionTypeAlias get node; | 1113 FunctionTypeAlias get node; |
| 1106 | 1114 |
| 1107 /** | 1115 /** |
| 1108 * Return an array containing all of the parameters defined by this type alias
. | 1116 * Return an array containing all of the parameters defined by this type alias
. |
| 1109 * | 1117 * |
| 1110 * @return the parameters defined by this type alias | 1118 * @return the parameters defined by this type alias |
| 1111 */ | 1119 */ |
| 1112 List<ParameterElement> get parameters; | 1120 List<ParameterElement> get parameters; |
| 1113 | 1121 |
| 1114 /** | 1122 /** |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 /** | 1239 /** |
| 1232 * The interface `LabelElement` defines the behavior of elements representing a
label | 1240 * The interface `LabelElement` defines the behavior of elements representing a
label |
| 1233 * associated with a statement. | 1241 * associated with a statement. |
| 1234 */ | 1242 */ |
| 1235 abstract class LabelElement implements Element { | 1243 abstract class LabelElement implements Element { |
| 1236 /** | 1244 /** |
| 1237 * Return the executable element in which this label is defined. | 1245 * Return the executable element in which this label is defined. |
| 1238 * | 1246 * |
| 1239 * @return the executable element in which this label is defined | 1247 * @return the executable element in which this label is defined |
| 1240 */ | 1248 */ |
| 1249 @override |
| 1241 ExecutableElement get enclosingElement; | 1250 ExecutableElement get enclosingElement; |
| 1242 } | 1251 } |
| 1243 | 1252 |
| 1244 /** | 1253 /** |
| 1245 * The interface `LibraryElement` defines the behavior of elements representing
a library. | 1254 * The interface `LibraryElement` defines the behavior of elements representing
a library. |
| 1246 */ | 1255 */ |
| 1247 abstract class LibraryElement implements Element { | 1256 abstract class LibraryElement implements Element { |
| 1248 /** | 1257 /** |
| 1249 * Return the compilation unit that defines this library. | 1258 * Return the compilation unit that defines this library. |
| 1250 * | 1259 * |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 */ | 1428 */ |
| 1420 abstract class MethodElement implements ClassMemberElement, ExecutableElement { | 1429 abstract class MethodElement implements ClassMemberElement, ExecutableElement { |
| 1421 /** | 1430 /** |
| 1422 * Return the resolved [MethodDeclaration] node that declares this [MethodElem
ent]. | 1431 * Return the resolved [MethodDeclaration] node that declares this [MethodElem
ent]. |
| 1423 * | 1432 * |
| 1424 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 1433 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 1425 * resolving will be performed. | 1434 * resolving will be performed. |
| 1426 * | 1435 * |
| 1427 * @return the resolved [MethodDeclaration], not `null`. | 1436 * @return the resolved [MethodDeclaration], not `null`. |
| 1428 */ | 1437 */ |
| 1438 @override |
| 1429 MethodDeclaration get node; | 1439 MethodDeclaration get node; |
| 1430 | 1440 |
| 1431 /** | 1441 /** |
| 1432 * Return `true` if this method is abstract. Methods are abstract if they are
not external | 1442 * Return `true` if this method is abstract. Methods are abstract if they are
not external |
| 1433 * and have no body. | 1443 * and have no body. |
| 1434 * | 1444 * |
| 1435 * @return `true` if this method is abstract | 1445 * @return `true` if this method is abstract |
| 1436 */ | 1446 */ |
| 1437 bool get isAbstract; | 1447 bool get isAbstract; |
| 1438 } | 1448 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 /** | 1536 /** |
| 1527 * The interface `PrefixElement` defines the behavior common to elements that re
present a | 1537 * The interface `PrefixElement` defines the behavior common to elements that re
present a |
| 1528 * prefix used to import one or more libraries into another library. | 1538 * prefix used to import one or more libraries into another library. |
| 1529 */ | 1539 */ |
| 1530 abstract class PrefixElement implements Element { | 1540 abstract class PrefixElement implements Element { |
| 1531 /** | 1541 /** |
| 1532 * Return the library into which other libraries are imported using this prefi
x. | 1542 * Return the library into which other libraries are imported using this prefi
x. |
| 1533 * | 1543 * |
| 1534 * @return the library into which other libraries are imported using this pref
ix | 1544 * @return the library into which other libraries are imported using this pref
ix |
| 1535 */ | 1545 */ |
| 1546 @override |
| 1536 LibraryElement get enclosingElement; | 1547 LibraryElement get enclosingElement; |
| 1537 | 1548 |
| 1538 /** | 1549 /** |
| 1539 * Return an array containing all of the libraries that are imported using thi
s prefix. | 1550 * Return an array containing all of the libraries that are imported using thi
s prefix. |
| 1540 * | 1551 * |
| 1541 * @return the libraries that are imported using this prefix | 1552 * @return the libraries that are imported using this prefix |
| 1542 */ | 1553 */ |
| 1543 List<LibraryElement> get importedLibraries; | 1554 List<LibraryElement> get importedLibraries; |
| 1544 } | 1555 } |
| 1545 | 1556 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 | 1767 |
| 1757 /** | 1768 /** |
| 1758 * Return the resolved [VariableDeclaration] node that declares this [Variable
Element] | 1769 * Return the resolved [VariableDeclaration] node that declares this [Variable
Element] |
| 1759 * . | 1770 * . |
| 1760 * | 1771 * |
| 1761 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and | 1772 * This method is expensive, because resolved AST might be evicted from cache,
so parsing and |
| 1762 * resolving will be performed. | 1773 * resolving will be performed. |
| 1763 * | 1774 * |
| 1764 * @return the resolved [VariableDeclaration], not `null`. | 1775 * @return the resolved [VariableDeclaration], not `null`. |
| 1765 */ | 1776 */ |
| 1777 @override |
| 1766 VariableDeclaration get node; | 1778 VariableDeclaration get node; |
| 1767 | 1779 |
| 1768 /** | 1780 /** |
| 1769 * Return the declared type of this variable, or `null` if the variable did no
t have a | 1781 * Return the declared type of this variable, or `null` if the variable did no
t have a |
| 1770 * declared type (such as if it was declared using the keyword 'var'). | 1782 * declared type (such as if it was declared using the keyword 'var'). |
| 1771 * | 1783 * |
| 1772 * @return the declared type of this variable | 1784 * @return the declared type of this variable |
| 1773 */ | 1785 */ |
| 1774 DartType get type; | 1786 DartType get type; |
| 1775 | 1787 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1996 * Returns `true` if property of this kind calls field setter. | 2008 * Returns `true` if property of this kind calls field setter. |
| 1997 */ | 2009 */ |
| 1998 bool callsSetter() => true; | 2010 bool callsSetter() => true; |
| 1999 | 2011 |
| 2000 AngularPropertyKind(String name, int ordinal) : super(name, ordinal); | 2012 AngularPropertyKind(String name, int ordinal) : super(name, ordinal); |
| 2001 } | 2013 } |
| 2002 | 2014 |
| 2003 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind { | 2015 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind { |
| 2004 AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordinal); | 2016 AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordinal); |
| 2005 | 2017 |
| 2018 @override |
| 2006 bool callsGetter() => true; | 2019 bool callsGetter() => true; |
| 2007 } | 2020 } |
| 2008 | 2021 |
| 2009 /** | 2022 /** |
| 2010 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</
code> | 2023 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</
code> |
| 2011 * property. They are created for every <code>scope['property'] = value;</code>
code snippet. | 2024 * property. They are created for every <code>scope['property'] = value;</code>
code snippet. |
| 2012 */ | 2025 */ |
| 2013 abstract class AngularScopePropertyElement implements AngularElement { | 2026 abstract class AngularScopePropertyElement implements AngularElement { |
| 2014 /** | 2027 /** |
| 2015 * An empty array of scope property elements. | 2028 * An empty array of scope property elements. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 * ParameterElement | 2119 * ParameterElement |
| 2107 * FieldFormalParameterElement | 2120 * FieldFormalParameterElement |
| 2108 * </pre> | 2121 * </pre> |
| 2109 * | 2122 * |
| 2110 * Subclasses that override a visit method must either invoke the overridden vis
it method or | 2123 * Subclasses that override a visit method must either invoke the overridden vis
it method or |
| 2111 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods | 2124 * explicitly invoke the more general visit method. Failure to do so will cause
the visit methods |
| 2112 * for superclasses of the element to not be invoked and will cause the children
of the visited node | 2125 * for superclasses of the element to not be invoked and will cause the children
of the visited node |
| 2113 * to not be visited. | 2126 * to not be visited. |
| 2114 */ | 2127 */ |
| 2115 class GeneralizingElementVisitor<R> implements ElementVisitor<R> { | 2128 class GeneralizingElementVisitor<R> implements ElementVisitor<R> { |
| 2129 @override |
| 2116 R visitAngularComponentElement(AngularComponentElement element) => visitAngula
rHasSelectorElement(element); | 2130 R visitAngularComponentElement(AngularComponentElement element) => visitAngula
rHasSelectorElement(element); |
| 2117 | 2131 |
| 2132 @override |
| 2118 R visitAngularControllerElement(AngularControllerElement element) => visitAngu
larHasSelectorElement(element); | 2133 R visitAngularControllerElement(AngularControllerElement element) => visitAngu
larHasSelectorElement(element); |
| 2119 | 2134 |
| 2135 @override |
| 2120 R visitAngularDirectiveElement(AngularDirectiveElement element) => visitAngula
rHasSelectorElement(element); | 2136 R visitAngularDirectiveElement(AngularDirectiveElement element) => visitAngula
rHasSelectorElement(element); |
| 2121 | 2137 |
| 2122 R visitAngularElement(AngularElement element) => visitToolkitObjectElement(ele
ment); | 2138 R visitAngularElement(AngularElement element) => visitToolkitObjectElement(ele
ment); |
| 2123 | 2139 |
| 2140 @override |
| 2124 R visitAngularFilterElement(AngularFilterElement element) => visitAngularEleme
nt(element); | 2141 R visitAngularFilterElement(AngularFilterElement element) => visitAngularEleme
nt(element); |
| 2125 | 2142 |
| 2126 R visitAngularHasSelectorElement(AngularHasSelectorElement element) => visitAn
gularElement(element); | 2143 R visitAngularHasSelectorElement(AngularHasSelectorElement element) => visitAn
gularElement(element); |
| 2127 | 2144 |
| 2145 @override |
| 2128 R visitAngularPropertyElement(AngularPropertyElement element) => visitAngularE
lement(element); | 2146 R visitAngularPropertyElement(AngularPropertyElement element) => visitAngularE
lement(element); |
| 2129 | 2147 |
| 2148 @override |
| 2130 R visitAngularScopePropertyElement(AngularScopePropertyElement element) => vis
itAngularElement(element); | 2149 R visitAngularScopePropertyElement(AngularScopePropertyElement element) => vis
itAngularElement(element); |
| 2131 | 2150 |
| 2151 @override |
| 2132 R visitAngularSelectorElement(AngularSelectorElement element) => visitAngularE
lement(element); | 2152 R visitAngularSelectorElement(AngularSelectorElement element) => visitAngularE
lement(element); |
| 2133 | 2153 |
| 2154 @override |
| 2134 R visitAngularViewElement(AngularViewElement element) => visitAngularElement(e
lement); | 2155 R visitAngularViewElement(AngularViewElement element) => visitAngularElement(e
lement); |
| 2135 | 2156 |
| 2157 @override |
| 2136 R visitClassElement(ClassElement element) => visitElement(element); | 2158 R visitClassElement(ClassElement element) => visitElement(element); |
| 2137 | 2159 |
| 2160 @override |
| 2138 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement(
element); | 2161 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement(
element); |
| 2139 | 2162 |
| 2163 @override |
| 2140 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen
t(element); | 2164 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen
t(element); |
| 2141 | 2165 |
| 2142 R visitElement(Element element) { | 2166 R visitElement(Element element) { |
| 2143 element.visitChildren(this); | 2167 element.visitChildren(this); |
| 2144 return null; | 2168 return null; |
| 2145 } | 2169 } |
| 2146 | 2170 |
| 2171 @override |
| 2147 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => visitHt
mlScriptElement(element); | 2172 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => visitHt
mlScriptElement(element); |
| 2148 | 2173 |
| 2149 R visitExecutableElement(ExecutableElement element) => visitElement(element); | 2174 R visitExecutableElement(ExecutableElement element) => visitElement(element); |
| 2150 | 2175 |
| 2176 @override |
| 2151 R visitExportElement(ExportElement element) => visitElement(element); | 2177 R visitExportElement(ExportElement element) => visitElement(element); |
| 2152 | 2178 |
| 2179 @override |
| 2153 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHt
mlScriptElement(element); | 2180 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHt
mlScriptElement(element); |
| 2154 | 2181 |
| 2182 @override |
| 2155 R visitFieldElement(FieldElement element) => visitPropertyInducingElement(elem
ent); | 2183 R visitFieldElement(FieldElement element) => visitPropertyInducingElement(elem
ent); |
| 2156 | 2184 |
| 2185 @override |
| 2157 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => vis
itParameterElement(element); | 2186 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => vis
itParameterElement(element); |
| 2158 | 2187 |
| 2188 @override |
| 2159 R visitFunctionElement(FunctionElement element) => visitLocalElement(element); | 2189 R visitFunctionElement(FunctionElement element) => visitLocalElement(element); |
| 2160 | 2190 |
| 2191 @override |
| 2161 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem
ent(element); | 2192 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem
ent(element); |
| 2162 | 2193 |
| 2194 @override |
| 2163 R visitHtmlElement(HtmlElement element) => visitElement(element); | 2195 R visitHtmlElement(HtmlElement element) => visitElement(element); |
| 2164 | 2196 |
| 2165 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element); | 2197 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element); |
| 2166 | 2198 |
| 2199 @override |
| 2167 R visitImportElement(ImportElement element) => visitElement(element); | 2200 R visitImportElement(ImportElement element) => visitElement(element); |
| 2168 | 2201 |
| 2202 @override |
| 2169 R visitLabelElement(LabelElement element) => visitElement(element); | 2203 R visitLabelElement(LabelElement element) => visitElement(element); |
| 2170 | 2204 |
| 2205 @override |
| 2171 R visitLibraryElement(LibraryElement element) => visitElement(element); | 2206 R visitLibraryElement(LibraryElement element) => visitElement(element); |
| 2172 | 2207 |
| 2173 R visitLocalElement(LocalElement element) { | 2208 R visitLocalElement(LocalElement element) { |
| 2174 if (element is LocalVariableElement) { | 2209 if (element is LocalVariableElement) { |
| 2175 return visitVariableElement(element); | 2210 return visitVariableElement(element); |
| 2176 } else if (element is ParameterElement) { | 2211 } else if (element is ParameterElement) { |
| 2177 return visitVariableElement(element); | 2212 return visitVariableElement(element); |
| 2178 } else if (element is FunctionElement) { | 2213 } else if (element is FunctionElement) { |
| 2179 return visitExecutableElement(element); | 2214 return visitExecutableElement(element); |
| 2180 } | 2215 } |
| 2181 return null; | 2216 return null; |
| 2182 } | 2217 } |
| 2183 | 2218 |
| 2219 @override |
| 2184 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement
(element); | 2220 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement
(element); |
| 2185 | 2221 |
| 2222 @override |
| 2186 R visitMethodElement(MethodElement element) => visitExecutableElement(element)
; | 2223 R visitMethodElement(MethodElement element) => visitExecutableElement(element)
; |
| 2187 | 2224 |
| 2225 @override |
| 2188 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement(
element); | 2226 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement(
element); |
| 2189 | 2227 |
| 2228 @override |
| 2190 R visitParameterElement(ParameterElement element) => visitLocalElement(element
); | 2229 R visitParameterElement(ParameterElement element) => visitLocalElement(element
); |
| 2191 | 2230 |
| 2231 @override |
| 2192 R visitPrefixElement(PrefixElement element) => visitElement(element); | 2232 R visitPrefixElement(PrefixElement element) => visitElement(element); |
| 2193 | 2233 |
| 2234 @override |
| 2194 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut
ableElement(element); | 2235 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut
ableElement(element); |
| 2195 | 2236 |
| 2196 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab
leElement(element); | 2237 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab
leElement(element); |
| 2197 | 2238 |
| 2198 R visitToolkitObjectElement(ToolkitObjectElement element) => visitElement(elem
ent); | 2239 R visitToolkitObjectElement(ToolkitObjectElement element) => visitElement(elem
ent); |
| 2199 | 2240 |
| 2241 @override |
| 2200 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper
tyInducingElement(element); | 2242 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper
tyInducingElement(element); |
| 2201 | 2243 |
| 2244 @override |
| 2202 R visitTypeParameterElement(TypeParameterElement element) => visitElement(elem
ent); | 2245 R visitTypeParameterElement(TypeParameterElement element) => visitElement(elem
ent); |
| 2203 | 2246 |
| 2204 R visitVariableElement(VariableElement element) => visitElement(element); | 2247 R visitVariableElement(VariableElement element) => visitElement(element); |
| 2205 } | 2248 } |
| 2206 | 2249 |
| 2207 /** | 2250 /** |
| 2208 * Instances of the class `RecursiveElementVisitor` implement an element visitor
that will | 2251 * Instances of the class `RecursiveElementVisitor` implement an element visitor
that will |
| 2209 * recursively visit all of the element in an element model. For example, using
an instance of this | 2252 * recursively visit all of the element in an element model. For example, using
an instance of this |
| 2210 * class to visit a [CompilationUnitElement] will also cause all of the types in
the | 2253 * class to visit a [CompilationUnitElement] will also cause all of the types in
the |
| 2211 * compilation unit to be visited. | 2254 * compilation unit to be visited. |
| 2212 * | 2255 * |
| 2213 * Subclasses that override a visit method must either invoke the overridden vis
it method or must | 2256 * Subclasses that override a visit method must either invoke the overridden vis
it method or must |
| 2214 * explicitly ask the visited element to visit its children. Failure to do so wi
ll cause the | 2257 * explicitly ask the visited element to visit its children. Failure to do so wi
ll cause the |
| 2215 * children of the visited element to not be visited. | 2258 * children of the visited element to not be visited. |
| 2216 */ | 2259 */ |
| 2217 class RecursiveElementVisitor<R> implements ElementVisitor<R> { | 2260 class RecursiveElementVisitor<R> implements ElementVisitor<R> { |
| 2261 @override |
| 2218 R visitAngularComponentElement(AngularComponentElement element) { | 2262 R visitAngularComponentElement(AngularComponentElement element) { |
| 2219 element.visitChildren(this); | 2263 element.visitChildren(this); |
| 2220 return null; | 2264 return null; |
| 2221 } | 2265 } |
| 2222 | 2266 |
| 2267 @override |
| 2223 R visitAngularControllerElement(AngularControllerElement element) { | 2268 R visitAngularControllerElement(AngularControllerElement element) { |
| 2224 element.visitChildren(this); | 2269 element.visitChildren(this); |
| 2225 return null; | 2270 return null; |
| 2226 } | 2271 } |
| 2227 | 2272 |
| 2273 @override |
| 2228 R visitAngularDirectiveElement(AngularDirectiveElement element) { | 2274 R visitAngularDirectiveElement(AngularDirectiveElement element) { |
| 2229 element.visitChildren(this); | 2275 element.visitChildren(this); |
| 2230 return null; | 2276 return null; |
| 2231 } | 2277 } |
| 2232 | 2278 |
| 2279 @override |
| 2233 R visitAngularFilterElement(AngularFilterElement element) { | 2280 R visitAngularFilterElement(AngularFilterElement element) { |
| 2234 element.visitChildren(this); | 2281 element.visitChildren(this); |
| 2235 return null; | 2282 return null; |
| 2236 } | 2283 } |
| 2237 | 2284 |
| 2285 @override |
| 2238 R visitAngularPropertyElement(AngularPropertyElement element) { | 2286 R visitAngularPropertyElement(AngularPropertyElement element) { |
| 2239 element.visitChildren(this); | 2287 element.visitChildren(this); |
| 2240 return null; | 2288 return null; |
| 2241 } | 2289 } |
| 2242 | 2290 |
| 2291 @override |
| 2243 R visitAngularScopePropertyElement(AngularScopePropertyElement element) { | 2292 R visitAngularScopePropertyElement(AngularScopePropertyElement element) { |
| 2244 element.visitChildren(this); | 2293 element.visitChildren(this); |
| 2245 return null; | 2294 return null; |
| 2246 } | 2295 } |
| 2247 | 2296 |
| 2297 @override |
| 2248 R visitAngularSelectorElement(AngularSelectorElement element) { | 2298 R visitAngularSelectorElement(AngularSelectorElement element) { |
| 2249 element.visitChildren(this); | 2299 element.visitChildren(this); |
| 2250 return null; | 2300 return null; |
| 2251 } | 2301 } |
| 2252 | 2302 |
| 2303 @override |
| 2253 R visitAngularViewElement(AngularViewElement element) { | 2304 R visitAngularViewElement(AngularViewElement element) { |
| 2254 element.visitChildren(this); | 2305 element.visitChildren(this); |
| 2255 return null; | 2306 return null; |
| 2256 } | 2307 } |
| 2257 | 2308 |
| 2309 @override |
| 2258 R visitClassElement(ClassElement element) { | 2310 R visitClassElement(ClassElement element) { |
| 2259 element.visitChildren(this); | 2311 element.visitChildren(this); |
| 2260 return null; | 2312 return null; |
| 2261 } | 2313 } |
| 2262 | 2314 |
| 2315 @override |
| 2263 R visitCompilationUnitElement(CompilationUnitElement element) { | 2316 R visitCompilationUnitElement(CompilationUnitElement element) { |
| 2264 element.visitChildren(this); | 2317 element.visitChildren(this); |
| 2265 return null; | 2318 return null; |
| 2266 } | 2319 } |
| 2267 | 2320 |
| 2321 @override |
| 2268 R visitConstructorElement(ConstructorElement element) { | 2322 R visitConstructorElement(ConstructorElement element) { |
| 2269 element.visitChildren(this); | 2323 element.visitChildren(this); |
| 2270 return null; | 2324 return null; |
| 2271 } | 2325 } |
| 2272 | 2326 |
| 2327 @override |
| 2273 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) { | 2328 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) { |
| 2274 element.visitChildren(this); | 2329 element.visitChildren(this); |
| 2275 return null; | 2330 return null; |
| 2276 } | 2331 } |
| 2277 | 2332 |
| 2333 @override |
| 2278 R visitExportElement(ExportElement element) { | 2334 R visitExportElement(ExportElement element) { |
| 2279 element.visitChildren(this); | 2335 element.visitChildren(this); |
| 2280 return null; | 2336 return null; |
| 2281 } | 2337 } |
| 2282 | 2338 |
| 2339 @override |
| 2283 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) { | 2340 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) { |
| 2284 element.visitChildren(this); | 2341 element.visitChildren(this); |
| 2285 return null; | 2342 return null; |
| 2286 } | 2343 } |
| 2287 | 2344 |
| 2345 @override |
| 2288 R visitFieldElement(FieldElement element) { | 2346 R visitFieldElement(FieldElement element) { |
| 2289 element.visitChildren(this); | 2347 element.visitChildren(this); |
| 2290 return null; | 2348 return null; |
| 2291 } | 2349 } |
| 2292 | 2350 |
| 2351 @override |
| 2293 R visitFieldFormalParameterElement(FieldFormalParameterElement element) { | 2352 R visitFieldFormalParameterElement(FieldFormalParameterElement element) { |
| 2294 element.visitChildren(this); | 2353 element.visitChildren(this); |
| 2295 return null; | 2354 return null; |
| 2296 } | 2355 } |
| 2297 | 2356 |
| 2357 @override |
| 2298 R visitFunctionElement(FunctionElement element) { | 2358 R visitFunctionElement(FunctionElement element) { |
| 2299 element.visitChildren(this); | 2359 element.visitChildren(this); |
| 2300 return null; | 2360 return null; |
| 2301 } | 2361 } |
| 2302 | 2362 |
| 2363 @override |
| 2303 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { | 2364 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { |
| 2304 element.visitChildren(this); | 2365 element.visitChildren(this); |
| 2305 return null; | 2366 return null; |
| 2306 } | 2367 } |
| 2307 | 2368 |
| 2369 @override |
| 2308 R visitHtmlElement(HtmlElement element) { | 2370 R visitHtmlElement(HtmlElement element) { |
| 2309 element.visitChildren(this); | 2371 element.visitChildren(this); |
| 2310 return null; | 2372 return null; |
| 2311 } | 2373 } |
| 2312 | 2374 |
| 2375 @override |
| 2313 R visitImportElement(ImportElement element) { | 2376 R visitImportElement(ImportElement element) { |
| 2314 element.visitChildren(this); | 2377 element.visitChildren(this); |
| 2315 return null; | 2378 return null; |
| 2316 } | 2379 } |
| 2317 | 2380 |
| 2381 @override |
| 2318 R visitLabelElement(LabelElement element) { | 2382 R visitLabelElement(LabelElement element) { |
| 2319 element.visitChildren(this); | 2383 element.visitChildren(this); |
| 2320 return null; | 2384 return null; |
| 2321 } | 2385 } |
| 2322 | 2386 |
| 2387 @override |
| 2323 R visitLibraryElement(LibraryElement element) { | 2388 R visitLibraryElement(LibraryElement element) { |
| 2324 element.visitChildren(this); | 2389 element.visitChildren(this); |
| 2325 return null; | 2390 return null; |
| 2326 } | 2391 } |
| 2327 | 2392 |
| 2393 @override |
| 2328 R visitLocalVariableElement(LocalVariableElement element) { | 2394 R visitLocalVariableElement(LocalVariableElement element) { |
| 2329 element.visitChildren(this); | 2395 element.visitChildren(this); |
| 2330 return null; | 2396 return null; |
| 2331 } | 2397 } |
| 2332 | 2398 |
| 2399 @override |
| 2333 R visitMethodElement(MethodElement element) { | 2400 R visitMethodElement(MethodElement element) { |
| 2334 element.visitChildren(this); | 2401 element.visitChildren(this); |
| 2335 return null; | 2402 return null; |
| 2336 } | 2403 } |
| 2337 | 2404 |
| 2405 @override |
| 2338 R visitMultiplyDefinedElement(MultiplyDefinedElement element) { | 2406 R visitMultiplyDefinedElement(MultiplyDefinedElement element) { |
| 2339 element.visitChildren(this); | 2407 element.visitChildren(this); |
| 2340 return null; | 2408 return null; |
| 2341 } | 2409 } |
| 2342 | 2410 |
| 2411 @override |
| 2343 R visitParameterElement(ParameterElement element) { | 2412 R visitParameterElement(ParameterElement element) { |
| 2344 element.visitChildren(this); | 2413 element.visitChildren(this); |
| 2345 return null; | 2414 return null; |
| 2346 } | 2415 } |
| 2347 | 2416 |
| 2417 @override |
| 2348 R visitPrefixElement(PrefixElement element) { | 2418 R visitPrefixElement(PrefixElement element) { |
| 2349 element.visitChildren(this); | 2419 element.visitChildren(this); |
| 2350 return null; | 2420 return null; |
| 2351 } | 2421 } |
| 2352 | 2422 |
| 2423 @override |
| 2353 R visitPropertyAccessorElement(PropertyAccessorElement element) { | 2424 R visitPropertyAccessorElement(PropertyAccessorElement element) { |
| 2354 element.visitChildren(this); | 2425 element.visitChildren(this); |
| 2355 return null; | 2426 return null; |
| 2356 } | 2427 } |
| 2357 | 2428 |
| 2429 @override |
| 2358 R visitTopLevelVariableElement(TopLevelVariableElement element) { | 2430 R visitTopLevelVariableElement(TopLevelVariableElement element) { |
| 2359 element.visitChildren(this); | 2431 element.visitChildren(this); |
| 2360 return null; | 2432 return null; |
| 2361 } | 2433 } |
| 2362 | 2434 |
| 2435 @override |
| 2363 R visitTypeParameterElement(TypeParameterElement element) { | 2436 R visitTypeParameterElement(TypeParameterElement element) { |
| 2364 element.visitChildren(this); | 2437 element.visitChildren(this); |
| 2365 return null; | 2438 return null; |
| 2366 } | 2439 } |
| 2367 } | 2440 } |
| 2368 | 2441 |
| 2369 /** | 2442 /** |
| 2370 * Instances of the class `SimpleElementVisitor` implement an element visitor th
at will do | 2443 * Instances of the class `SimpleElementVisitor` implement an element visitor th
at will do |
| 2371 * nothing when visiting an element. It is intended to be a superclass for class
es that use the | 2444 * nothing when visiting an element. It is intended to be a superclass for class
es that use the |
| 2372 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re
cursively visit a | 2445 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re
cursively visit a |
| 2373 * whole structure) and that only need to visit a small number of element types. | 2446 * whole structure) and that only need to visit a small number of element types. |
| 2374 */ | 2447 */ |
| 2375 class SimpleElementVisitor<R> implements ElementVisitor<R> { | 2448 class SimpleElementVisitor<R> implements ElementVisitor<R> { |
| 2449 @override |
| 2376 R visitAngularComponentElement(AngularComponentElement element) => null; | 2450 R visitAngularComponentElement(AngularComponentElement element) => null; |
| 2377 | 2451 |
| 2452 @override |
| 2378 R visitAngularControllerElement(AngularControllerElement element) => null; | 2453 R visitAngularControllerElement(AngularControllerElement element) => null; |
| 2379 | 2454 |
| 2455 @override |
| 2380 R visitAngularDirectiveElement(AngularDirectiveElement element) => null; | 2456 R visitAngularDirectiveElement(AngularDirectiveElement element) => null; |
| 2381 | 2457 |
| 2458 @override |
| 2382 R visitAngularFilterElement(AngularFilterElement element) => null; | 2459 R visitAngularFilterElement(AngularFilterElement element) => null; |
| 2383 | 2460 |
| 2461 @override |
| 2384 R visitAngularPropertyElement(AngularPropertyElement element) => null; | 2462 R visitAngularPropertyElement(AngularPropertyElement element) => null; |
| 2385 | 2463 |
| 2464 @override |
| 2386 R visitAngularScopePropertyElement(AngularScopePropertyElement element) => nul
l; | 2465 R visitAngularScopePropertyElement(AngularScopePropertyElement element) => nul
l; |
| 2387 | 2466 |
| 2467 @override |
| 2388 R visitAngularSelectorElement(AngularSelectorElement element) => null; | 2468 R visitAngularSelectorElement(AngularSelectorElement element) => null; |
| 2389 | 2469 |
| 2470 @override |
| 2390 R visitAngularViewElement(AngularViewElement element) => null; | 2471 R visitAngularViewElement(AngularViewElement element) => null; |
| 2391 | 2472 |
| 2473 @override |
| 2392 R visitClassElement(ClassElement element) => null; | 2474 R visitClassElement(ClassElement element) => null; |
| 2393 | 2475 |
| 2476 @override |
| 2394 R visitCompilationUnitElement(CompilationUnitElement element) => null; | 2477 R visitCompilationUnitElement(CompilationUnitElement element) => null; |
| 2395 | 2478 |
| 2479 @override |
| 2396 R visitConstructorElement(ConstructorElement element) => null; | 2480 R visitConstructorElement(ConstructorElement element) => null; |
| 2397 | 2481 |
| 2482 @override |
| 2398 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null; | 2483 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null; |
| 2399 | 2484 |
| 2485 @override |
| 2400 R visitExportElement(ExportElement element) => null; | 2486 R visitExportElement(ExportElement element) => null; |
| 2401 | 2487 |
| 2488 @override |
| 2402 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => null; | 2489 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => null; |
| 2403 | 2490 |
| 2491 @override |
| 2404 R visitFieldElement(FieldElement element) => null; | 2492 R visitFieldElement(FieldElement element) => null; |
| 2405 | 2493 |
| 2494 @override |
| 2406 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => nul
l; | 2495 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => nul
l; |
| 2407 | 2496 |
| 2497 @override |
| 2408 R visitFunctionElement(FunctionElement element) => null; | 2498 R visitFunctionElement(FunctionElement element) => null; |
| 2409 | 2499 |
| 2500 @override |
| 2410 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null; | 2501 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null; |
| 2411 | 2502 |
| 2503 @override |
| 2412 R visitHtmlElement(HtmlElement element) => null; | 2504 R visitHtmlElement(HtmlElement element) => null; |
| 2413 | 2505 |
| 2506 @override |
| 2414 R visitImportElement(ImportElement element) => null; | 2507 R visitImportElement(ImportElement element) => null; |
| 2415 | 2508 |
| 2509 @override |
| 2416 R visitLabelElement(LabelElement element) => null; | 2510 R visitLabelElement(LabelElement element) => null; |
| 2417 | 2511 |
| 2512 @override |
| 2418 R visitLibraryElement(LibraryElement element) => null; | 2513 R visitLibraryElement(LibraryElement element) => null; |
| 2419 | 2514 |
| 2515 @override |
| 2420 R visitLocalVariableElement(LocalVariableElement element) => null; | 2516 R visitLocalVariableElement(LocalVariableElement element) => null; |
| 2421 | 2517 |
| 2518 @override |
| 2422 R visitMethodElement(MethodElement element) => null; | 2519 R visitMethodElement(MethodElement element) => null; |
| 2423 | 2520 |
| 2521 @override |
| 2424 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; | 2522 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; |
| 2425 | 2523 |
| 2524 @override |
| 2426 R visitParameterElement(ParameterElement element) => null; | 2525 R visitParameterElement(ParameterElement element) => null; |
| 2427 | 2526 |
| 2527 @override |
| 2428 R visitPrefixElement(PrefixElement element) => null; | 2528 R visitPrefixElement(PrefixElement element) => null; |
| 2429 | 2529 |
| 2530 @override |
| 2430 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; | 2531 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; |
| 2431 | 2532 |
| 2533 @override |
| 2432 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; | 2534 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; |
| 2433 | 2535 |
| 2536 @override |
| 2434 R visitTypeParameterElement(TypeParameterElement element) => null; | 2537 R visitTypeParameterElement(TypeParameterElement element) => null; |
| 2435 } | 2538 } |
| 2436 | 2539 |
| 2437 /** | 2540 /** |
| 2438 * For AST nodes that could be in both the getter and setter contexts ([IndexExp
ression]s and | 2541 * For AST nodes that could be in both the getter and setter contexts ([IndexExp
ression]s and |
| 2439 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST
node, in an | 2542 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST
node, in an |
| 2440 * [AuxiliaryElements]. Since resolved elements are either statically resolved o
r resolved | 2543 * [AuxiliaryElements]. Since resolved elements are either statically resolved o
r resolved |
| 2441 * using propagated type information, this class is a wrapper for a pair of | 2544 * using propagated type information, this class is a wrapper for a pair of |
| 2442 * [ExecutableElement]s, not just a single [ExecutableElement]. | 2545 * [ExecutableElement]s, not just a single [ExecutableElement]. |
| 2443 */ | 2546 */ |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2523 */ | 2626 */ |
| 2524 static List<ClassElement> EMPTY_ARRAY = new List<ClassElement>(0); | 2627 static List<ClassElement> EMPTY_ARRAY = new List<ClassElement>(0); |
| 2525 | 2628 |
| 2526 /** | 2629 /** |
| 2527 * Initialize a newly created class element to have the given name. | 2630 * Initialize a newly created class element to have the given name. |
| 2528 * | 2631 * |
| 2529 * @param name the name of this element | 2632 * @param name the name of this element |
| 2530 */ | 2633 */ |
| 2531 ClassElementImpl(Identifier name) : super.forNode(name); | 2634 ClassElementImpl(Identifier name) : super.forNode(name); |
| 2532 | 2635 |
| 2636 @override |
| 2533 accept(ElementVisitor visitor) => visitor.visitClassElement(this); | 2637 accept(ElementVisitor visitor) => visitor.visitClassElement(this); |
| 2534 | 2638 |
| 2639 @override |
| 2535 List<PropertyAccessorElement> get accessors => _accessors; | 2640 List<PropertyAccessorElement> get accessors => _accessors; |
| 2536 | 2641 |
| 2642 @override |
| 2537 List<InterfaceType> get allSupertypes { | 2643 List<InterfaceType> get allSupertypes { |
| 2538 List<InterfaceType> list = new List<InterfaceType>(); | 2644 List<InterfaceType> list = new List<InterfaceType>(); |
| 2539 _collectAllSupertypes(list); | 2645 _collectAllSupertypes(list); |
| 2540 return new List.from(list); | 2646 return new List.from(list); |
| 2541 } | 2647 } |
| 2542 | 2648 |
| 2649 @override |
| 2543 ElementImpl getChild(String identifier) { | 2650 ElementImpl getChild(String identifier) { |
| 2544 // | 2651 // |
| 2545 // The casts in this method are safe because the set methods would have thro
wn a CCE if any of | 2652 // The casts in this method are safe because the set methods would have thro
wn a CCE if any of |
| 2546 // the elements in the arrays were not of the expected types. | 2653 // the elements in the arrays were not of the expected types. |
| 2547 // | 2654 // |
| 2548 for (PropertyAccessorElement accessor in _accessors) { | 2655 for (PropertyAccessorElement accessor in _accessors) { |
| 2549 if ((accessor as PropertyAccessorElementImpl).identifier == identifier) { | 2656 if ((accessor as PropertyAccessorElementImpl).identifier == identifier) { |
| 2550 return accessor as PropertyAccessorElementImpl; | 2657 return accessor as PropertyAccessorElementImpl; |
| 2551 } | 2658 } |
| 2552 } | 2659 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2566 } | 2673 } |
| 2567 } | 2674 } |
| 2568 for (TypeParameterElement typeParameter in _typeParameters) { | 2675 for (TypeParameterElement typeParameter in _typeParameters) { |
| 2569 if ((typeParameter as TypeParameterElementImpl).identifier == identifier)
{ | 2676 if ((typeParameter as TypeParameterElementImpl).identifier == identifier)
{ |
| 2570 return typeParameter as TypeParameterElementImpl; | 2677 return typeParameter as TypeParameterElementImpl; |
| 2571 } | 2678 } |
| 2572 } | 2679 } |
| 2573 return null; | 2680 return null; |
| 2574 } | 2681 } |
| 2575 | 2682 |
| 2683 @override |
| 2576 List<ConstructorElement> get constructors => _constructors; | 2684 List<ConstructorElement> get constructors => _constructors; |
| 2577 | 2685 |
| 2686 @override |
| 2578 FieldElement getField(String name) { | 2687 FieldElement getField(String name) { |
| 2579 for (FieldElement fieldElement in _fields) { | 2688 for (FieldElement fieldElement in _fields) { |
| 2580 if (name == fieldElement.name) { | 2689 if (name == fieldElement.name) { |
| 2581 return fieldElement; | 2690 return fieldElement; |
| 2582 } | 2691 } |
| 2583 } | 2692 } |
| 2584 return null; | 2693 return null; |
| 2585 } | 2694 } |
| 2586 | 2695 |
| 2696 @override |
| 2587 List<FieldElement> get fields => _fields; | 2697 List<FieldElement> get fields => _fields; |
| 2588 | 2698 |
| 2699 @override |
| 2589 PropertyAccessorElement getGetter(String getterName) { | 2700 PropertyAccessorElement getGetter(String getterName) { |
| 2590 for (PropertyAccessorElement accessor in _accessors) { | 2701 for (PropertyAccessorElement accessor in _accessors) { |
| 2591 if (accessor.isGetter && accessor.name == getterName) { | 2702 if (accessor.isGetter && accessor.name == getterName) { |
| 2592 return accessor; | 2703 return accessor; |
| 2593 } | 2704 } |
| 2594 } | 2705 } |
| 2595 return null; | 2706 return null; |
| 2596 } | 2707 } |
| 2597 | 2708 |
| 2709 @override |
| 2598 ElementKind get kind => ElementKind.CLASS; | 2710 ElementKind get kind => ElementKind.CLASS; |
| 2599 | 2711 |
| 2712 @override |
| 2600 MethodElement getMethod(String methodName) { | 2713 MethodElement getMethod(String methodName) { |
| 2601 for (MethodElement method in _methods) { | 2714 for (MethodElement method in _methods) { |
| 2602 if (method.name == methodName) { | 2715 if (method.name == methodName) { |
| 2603 return method; | 2716 return method; |
| 2604 } | 2717 } |
| 2605 } | 2718 } |
| 2606 return null; | 2719 return null; |
| 2607 } | 2720 } |
| 2608 | 2721 |
| 2722 @override |
| 2609 List<MethodElement> get methods => _methods; | 2723 List<MethodElement> get methods => _methods; |
| 2610 | 2724 |
| 2725 @override |
| 2611 ConstructorElement getNamedConstructor(String name) { | 2726 ConstructorElement getNamedConstructor(String name) { |
| 2612 for (ConstructorElement element in constructors) { | 2727 for (ConstructorElement element in constructors) { |
| 2613 String elementName = element.name; | 2728 String elementName = element.name; |
| 2614 if (elementName != null && elementName == name) { | 2729 if (elementName != null && elementName == name) { |
| 2615 return element; | 2730 return element; |
| 2616 } | 2731 } |
| 2617 } | 2732 } |
| 2618 return null; | 2733 return null; |
| 2619 } | 2734 } |
| 2620 | 2735 |
| 2736 @override |
| 2621 ClassDeclaration get node => getNodeMatching((node) => node is ClassDeclaratio
n); | 2737 ClassDeclaration get node => getNodeMatching((node) => node is ClassDeclaratio
n); |
| 2622 | 2738 |
| 2739 @override |
| 2623 PropertyAccessorElement getSetter(String setterName) { | 2740 PropertyAccessorElement getSetter(String setterName) { |
| 2624 // TODO (jwren) revisit- should we append '=' here or require clients to inc
lude it? | 2741 // TODO (jwren) revisit- should we append '=' here or require clients to inc
lude it? |
| 2625 // Do we need the check for isSetter below? | 2742 // Do we need the check for isSetter below? |
| 2626 if (!StringUtilities.endsWithChar(setterName, 0x3D)) { | 2743 if (!StringUtilities.endsWithChar(setterName, 0x3D)) { |
| 2627 setterName += '='; | 2744 setterName += '='; |
| 2628 } | 2745 } |
| 2629 for (PropertyAccessorElement accessor in _accessors) { | 2746 for (PropertyAccessorElement accessor in _accessors) { |
| 2630 if (accessor.isSetter && accessor.name == setterName) { | 2747 if (accessor.isSetter && accessor.name == setterName) { |
| 2631 return accessor; | 2748 return accessor; |
| 2632 } | 2749 } |
| 2633 } | 2750 } |
| 2634 return null; | 2751 return null; |
| 2635 } | 2752 } |
| 2636 | 2753 |
| 2754 @override |
| 2637 List<ToolkitObjectElement> get toolkitObjects => _toolkitObjects; | 2755 List<ToolkitObjectElement> get toolkitObjects => _toolkitObjects; |
| 2638 | 2756 |
| 2757 @override |
| 2639 List<TypeParameterElement> get typeParameters => _typeParameters; | 2758 List<TypeParameterElement> get typeParameters => _typeParameters; |
| 2640 | 2759 |
| 2760 @override |
| 2641 ConstructorElement get unnamedConstructor { | 2761 ConstructorElement get unnamedConstructor { |
| 2642 for (ConstructorElement element in constructors) { | 2762 for (ConstructorElement element in constructors) { |
| 2643 String name = element.displayName; | 2763 String name = element.displayName; |
| 2644 if (name == null || name.isEmpty) { | 2764 if (name == null || name.isEmpty) { |
| 2645 return element; | 2765 return element; |
| 2646 } | 2766 } |
| 2647 } | 2767 } |
| 2648 return null; | 2768 return null; |
| 2649 } | 2769 } |
| 2650 | 2770 |
| 2771 @override |
| 2651 bool get hasNonFinalField { | 2772 bool get hasNonFinalField { |
| 2652 List<ClassElement> classesToVisit = new List<ClassElement>(); | 2773 List<ClassElement> classesToVisit = new List<ClassElement>(); |
| 2653 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 2774 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 2654 classesToVisit.add(this); | 2775 classesToVisit.add(this); |
| 2655 while (!classesToVisit.isEmpty) { | 2776 while (!classesToVisit.isEmpty) { |
| 2656 ClassElement currentElement = classesToVisit.removeAt(0); | 2777 ClassElement currentElement = classesToVisit.removeAt(0); |
| 2657 if (visitedClasses.add(currentElement)) { | 2778 if (visitedClasses.add(currentElement)) { |
| 2658 // check fields | 2779 // check fields |
| 2659 for (FieldElement field in currentElement.fields) { | 2780 for (FieldElement field in currentElement.fields) { |
| 2660 if (!field.isFinal && !field.isConst && !field.isStatic && !field.isSy
nthetic) { | 2781 if (!field.isFinal && !field.isConst && !field.isStatic && !field.isSy
nthetic) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2673 if (superElement != null) { | 2794 if (superElement != null) { |
| 2674 classesToVisit.add(superElement); | 2795 classesToVisit.add(superElement); |
| 2675 } | 2796 } |
| 2676 } | 2797 } |
| 2677 } | 2798 } |
| 2678 } | 2799 } |
| 2679 // not found | 2800 // not found |
| 2680 return false; | 2801 return false; |
| 2681 } | 2802 } |
| 2682 | 2803 |
| 2804 @override |
| 2683 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER); | 2805 bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER); |
| 2684 | 2806 |
| 2807 @override |
| 2685 bool get isAbstract => hasModifier(Modifier.ABSTRACT); | 2808 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 2686 | 2809 |
| 2810 @override |
| 2687 bool get isOrInheritsProxy => _safeIsOrInheritsProxy(this, new Set<ClassElemen
t>()); | 2811 bool get isOrInheritsProxy => _safeIsOrInheritsProxy(this, new Set<ClassElemen
t>()); |
| 2688 | 2812 |
| 2813 @override |
| 2689 bool get isProxy { | 2814 bool get isProxy { |
| 2690 for (ElementAnnotation annotation in metadata) { | 2815 for (ElementAnnotation annotation in metadata) { |
| 2691 if (annotation.isProxy) { | 2816 if (annotation.isProxy) { |
| 2692 return true; | 2817 return true; |
| 2693 } | 2818 } |
| 2694 } | 2819 } |
| 2695 return false; | 2820 return false; |
| 2696 } | 2821 } |
| 2697 | 2822 |
| 2823 @override |
| 2698 bool get isTypedef => hasModifier(Modifier.TYPEDEF); | 2824 bool get isTypedef => hasModifier(Modifier.TYPEDEF); |
| 2699 | 2825 |
| 2826 @override |
| 2700 bool get isValidMixin => hasModifier(Modifier.MIXIN); | 2827 bool get isValidMixin => hasModifier(Modifier.MIXIN); |
| 2701 | 2828 |
| 2829 @override |
| 2702 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { | 2830 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { |
| 2703 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 2831 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 2704 ClassElement currentElement = this; | 2832 ClassElement currentElement = this; |
| 2705 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 2833 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
| 2706 visitedClasses.add(currentElement); | 2834 visitedClasses.add(currentElement); |
| 2707 PropertyAccessorElement element = currentElement.getGetter(getterName); | 2835 PropertyAccessorElement element = currentElement.getGetter(getterName); |
| 2708 if (element != null && element.isAccessibleIn(library)) { | 2836 if (element != null && element.isAccessibleIn(library)) { |
| 2709 return element; | 2837 return element; |
| 2710 } | 2838 } |
| 2711 for (InterfaceType mixin in currentElement.mixins) { | 2839 for (InterfaceType mixin in currentElement.mixins) { |
| 2712 ClassElement mixinElement = mixin.element; | 2840 ClassElement mixinElement = mixin.element; |
| 2713 if (mixinElement != null) { | 2841 if (mixinElement != null) { |
| 2714 element = mixinElement.getGetter(getterName); | 2842 element = mixinElement.getGetter(getterName); |
| 2715 if (element != null && element.isAccessibleIn(library)) { | 2843 if (element != null && element.isAccessibleIn(library)) { |
| 2716 return element; | 2844 return element; |
| 2717 } | 2845 } |
| 2718 } | 2846 } |
| 2719 } | 2847 } |
| 2720 InterfaceType supertype = currentElement.supertype; | 2848 InterfaceType supertype = currentElement.supertype; |
| 2721 if (supertype == null) { | 2849 if (supertype == null) { |
| 2722 return null; | 2850 return null; |
| 2723 } | 2851 } |
| 2724 currentElement = supertype.element; | 2852 currentElement = supertype.element; |
| 2725 } | 2853 } |
| 2726 return null; | 2854 return null; |
| 2727 } | 2855 } |
| 2728 | 2856 |
| 2857 @override |
| 2729 MethodElement lookUpMethod(String methodName, LibraryElement library) { | 2858 MethodElement lookUpMethod(String methodName, LibraryElement library) { |
| 2730 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 2859 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 2731 ClassElement currentElement = this; | 2860 ClassElement currentElement = this; |
| 2732 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 2861 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
| 2733 visitedClasses.add(currentElement); | 2862 visitedClasses.add(currentElement); |
| 2734 MethodElement element = currentElement.getMethod(methodName); | 2863 MethodElement element = currentElement.getMethod(methodName); |
| 2735 if (element != null && element.isAccessibleIn(library)) { | 2864 if (element != null && element.isAccessibleIn(library)) { |
| 2736 return element; | 2865 return element; |
| 2737 } | 2866 } |
| 2738 for (InterfaceType mixin in currentElement.mixins) { | 2867 for (InterfaceType mixin in currentElement.mixins) { |
| 2739 ClassElement mixinElement = mixin.element; | 2868 ClassElement mixinElement = mixin.element; |
| 2740 if (mixinElement != null) { | 2869 if (mixinElement != null) { |
| 2741 element = mixinElement.getMethod(methodName); | 2870 element = mixinElement.getMethod(methodName); |
| 2742 if (element != null && element.isAccessibleIn(library)) { | 2871 if (element != null && element.isAccessibleIn(library)) { |
| 2743 return element; | 2872 return element; |
| 2744 } | 2873 } |
| 2745 } | 2874 } |
| 2746 } | 2875 } |
| 2747 InterfaceType supertype = currentElement.supertype; | 2876 InterfaceType supertype = currentElement.supertype; |
| 2748 if (supertype == null) { | 2877 if (supertype == null) { |
| 2749 return null; | 2878 return null; |
| 2750 } | 2879 } |
| 2751 currentElement = supertype.element; | 2880 currentElement = supertype.element; |
| 2752 } | 2881 } |
| 2753 return null; | 2882 return null; |
| 2754 } | 2883 } |
| 2755 | 2884 |
| 2885 @override |
| 2756 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { | 2886 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { |
| 2757 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 2887 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 2758 ClassElement currentElement = this; | 2888 ClassElement currentElement = this; |
| 2759 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 2889 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
| 2760 visitedClasses.add(currentElement); | 2890 visitedClasses.add(currentElement); |
| 2761 PropertyAccessorElement element = currentElement.getSetter(setterName); | 2891 PropertyAccessorElement element = currentElement.getSetter(setterName); |
| 2762 if (element != null && element.isAccessibleIn(library)) { | 2892 if (element != null && element.isAccessibleIn(library)) { |
| 2763 return element; | 2893 return element; |
| 2764 } | 2894 } |
| 2765 for (InterfaceType mixin in currentElement.mixins) { | 2895 for (InterfaceType mixin in currentElement.mixins) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2881 | 3011 |
| 2882 /** | 3012 /** |
| 2883 * Set whether this class is a valid mixin to correspond to the given value. | 3013 * Set whether this class is a valid mixin to correspond to the given value. |
| 2884 * | 3014 * |
| 2885 * @param isValidMixin `true` if this class can be used as a mixin | 3015 * @param isValidMixin `true` if this class can be used as a mixin |
| 2886 */ | 3016 */ |
| 2887 void set validMixin(bool isValidMixin) { | 3017 void set validMixin(bool isValidMixin) { |
| 2888 setModifier(Modifier.MIXIN, isValidMixin); | 3018 setModifier(Modifier.MIXIN, isValidMixin); |
| 2889 } | 3019 } |
| 2890 | 3020 |
| 3021 @override |
| 2891 void visitChildren(ElementVisitor visitor) { | 3022 void visitChildren(ElementVisitor visitor) { |
| 2892 super.visitChildren(visitor); | 3023 super.visitChildren(visitor); |
| 2893 safelyVisitChildren(_accessors, visitor); | 3024 safelyVisitChildren(_accessors, visitor); |
| 2894 safelyVisitChildren(_constructors, visitor); | 3025 safelyVisitChildren(_constructors, visitor); |
| 2895 safelyVisitChildren(_fields, visitor); | 3026 safelyVisitChildren(_fields, visitor); |
| 2896 safelyVisitChildren(_methods, visitor); | 3027 safelyVisitChildren(_methods, visitor); |
| 2897 safelyVisitChildren(_toolkitObjects, visitor); | 3028 safelyVisitChildren(_toolkitObjects, visitor); |
| 2898 safelyVisitChildren(_typeParameters, visitor); | 3029 safelyVisitChildren(_typeParameters, visitor); |
| 2899 } | 3030 } |
| 2900 | 3031 |
| 3032 @override |
| 2901 void appendTo(JavaStringBuilder builder) { | 3033 void appendTo(JavaStringBuilder builder) { |
| 2902 String name = displayName; | 3034 String name = displayName; |
| 2903 if (name == null) { | 3035 if (name == null) { |
| 2904 builder.append("{unnamed class}"); | 3036 builder.append("{unnamed class}"); |
| 2905 } else { | 3037 } else { |
| 2906 builder.append(name); | 3038 builder.append(name); |
| 2907 } | 3039 } |
| 2908 int variableCount = _typeParameters.length; | 3040 int variableCount = _typeParameters.length; |
| 2909 if (variableCount > 0) { | 3041 if (variableCount > 0) { |
| 2910 builder.append("<"); | 3042 builder.append("<"); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3030 */ | 3162 */ |
| 3031 List<AngularViewElement> _angularViews = AngularViewElement.EMPTY_ARRAY; | 3163 List<AngularViewElement> _angularViews = AngularViewElement.EMPTY_ARRAY; |
| 3032 | 3164 |
| 3033 /** | 3165 /** |
| 3034 * Initialize a newly created compilation unit element to have the given name. | 3166 * Initialize a newly created compilation unit element to have the given name. |
| 3035 * | 3167 * |
| 3036 * @param name the name of this element | 3168 * @param name the name of this element |
| 3037 */ | 3169 */ |
| 3038 CompilationUnitElementImpl(String name) : super(name, -1); | 3170 CompilationUnitElementImpl(String name) : super(name, -1); |
| 3039 | 3171 |
| 3172 @override |
| 3040 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this); | 3173 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this); |
| 3041 | 3174 |
| 3175 @override |
| 3042 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && source == (object as CompilationUnitElementImpl).source; | 3176 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && source == (object as CompilationUnitElementImpl).source; |
| 3043 | 3177 |
| 3178 @override |
| 3044 List<PropertyAccessorElement> get accessors => _accessors; | 3179 List<PropertyAccessorElement> get accessors => _accessors; |
| 3045 | 3180 |
| 3181 @override |
| 3046 List<AngularViewElement> get angularViews => _angularViews; | 3182 List<AngularViewElement> get angularViews => _angularViews; |
| 3047 | 3183 |
| 3184 @override |
| 3048 ElementImpl getChild(String identifier) { | 3185 ElementImpl getChild(String identifier) { |
| 3049 // | 3186 // |
| 3050 // The casts in this method are safe because the set methods would have thro
wn a CCE if any of | 3187 // The casts in this method are safe because the set methods would have thro
wn a CCE if any of |
| 3051 // the elements in the arrays were not of the expected types. | 3188 // the elements in the arrays were not of the expected types. |
| 3052 // | 3189 // |
| 3053 for (PropertyAccessorElement accessor in _accessors) { | 3190 for (PropertyAccessorElement accessor in _accessors) { |
| 3054 if ((accessor as PropertyAccessorElementImpl).identifier == identifier) { | 3191 if ((accessor as PropertyAccessorElementImpl).identifier == identifier) { |
| 3055 return accessor as PropertyAccessorElementImpl; | 3192 return accessor as PropertyAccessorElementImpl; |
| 3056 } | 3193 } |
| 3057 } | 3194 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3071 } | 3208 } |
| 3072 } | 3209 } |
| 3073 for (ClassElement type in _types) { | 3210 for (ClassElement type in _types) { |
| 3074 if ((type as ClassElementImpl).identifier == identifier) { | 3211 if ((type as ClassElementImpl).identifier == identifier) { |
| 3075 return type as ClassElementImpl; | 3212 return type as ClassElementImpl; |
| 3076 } | 3213 } |
| 3077 } | 3214 } |
| 3078 return null; | 3215 return null; |
| 3079 } | 3216 } |
| 3080 | 3217 |
| 3218 @override |
| 3081 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen
t; | 3219 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen
t; |
| 3082 | 3220 |
| 3221 @override |
| 3083 List<FunctionElement> get functions => _functions; | 3222 List<FunctionElement> get functions => _functions; |
| 3084 | 3223 |
| 3224 @override |
| 3085 List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases; | 3225 List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases; |
| 3086 | 3226 |
| 3227 @override |
| 3087 ElementKind get kind => ElementKind.COMPILATION_UNIT; | 3228 ElementKind get kind => ElementKind.COMPILATION_UNIT; |
| 3088 | 3229 |
| 3230 @override |
| 3089 CompilationUnit get node => unit; | 3231 CompilationUnit get node => unit; |
| 3090 | 3232 |
| 3233 @override |
| 3091 List<TopLevelVariableElement> get topLevelVariables => _variables; | 3234 List<TopLevelVariableElement> get topLevelVariables => _variables; |
| 3092 | 3235 |
| 3236 @override |
| 3093 ClassElement getType(String className) { | 3237 ClassElement getType(String className) { |
| 3094 for (ClassElement type in _types) { | 3238 for (ClassElement type in _types) { |
| 3095 if (type.name == className) { | 3239 if (type.name == className) { |
| 3096 return type; | 3240 return type; |
| 3097 } | 3241 } |
| 3098 } | 3242 } |
| 3099 return null; | 3243 return null; |
| 3100 } | 3244 } |
| 3101 | 3245 |
| 3246 @override |
| 3102 List<ClassElement> get types => _types; | 3247 List<ClassElement> get types => _types; |
| 3103 | 3248 |
| 3249 @override |
| 3104 int get hashCode => source.hashCode; | 3250 int get hashCode => source.hashCode; |
| 3105 | 3251 |
| 3106 /** | 3252 /** |
| 3107 * Set the top-level accessors (getters and setters) contained in this compila
tion unit to the | 3253 * Set the top-level accessors (getters and setters) contained in this compila
tion unit to the |
| 3108 * given accessors. | 3254 * given accessors. |
| 3109 * | 3255 * |
| 3110 * @param the top-level accessors (getters and setters) contained in this comp
ilation unit | 3256 * @param the top-level accessors (getters and setters) contained in this comp
ilation unit |
| 3111 */ | 3257 */ |
| 3112 void set accessors(List<PropertyAccessorElement> accessors) { | 3258 void set accessors(List<PropertyAccessorElement> accessors) { |
| 3113 for (PropertyAccessorElement accessor in accessors) { | 3259 for (PropertyAccessorElement accessor in accessors) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3169 * | 3315 * |
| 3170 * @param types types contained in this compilation unit | 3316 * @param types types contained in this compilation unit |
| 3171 */ | 3317 */ |
| 3172 void set types(List<ClassElement> types) { | 3318 void set types(List<ClassElement> types) { |
| 3173 for (ClassElement type in types) { | 3319 for (ClassElement type in types) { |
| 3174 (type as ClassElementImpl).enclosingElement = this; | 3320 (type as ClassElementImpl).enclosingElement = this; |
| 3175 } | 3321 } |
| 3176 this._types = types; | 3322 this._types = types; |
| 3177 } | 3323 } |
| 3178 | 3324 |
| 3325 @override |
| 3179 void visitChildren(ElementVisitor visitor) { | 3326 void visitChildren(ElementVisitor visitor) { |
| 3180 super.visitChildren(visitor); | 3327 super.visitChildren(visitor); |
| 3181 safelyVisitChildren(_accessors, visitor); | 3328 safelyVisitChildren(_accessors, visitor); |
| 3182 safelyVisitChildren(_functions, visitor); | 3329 safelyVisitChildren(_functions, visitor); |
| 3183 safelyVisitChildren(_typeAliases, visitor); | 3330 safelyVisitChildren(_typeAliases, visitor); |
| 3184 safelyVisitChildren(_types, visitor); | 3331 safelyVisitChildren(_types, visitor); |
| 3185 safelyVisitChildren(_variables, visitor); | 3332 safelyVisitChildren(_variables, visitor); |
| 3186 safelyVisitChildren(_angularViews, visitor); | 3333 safelyVisitChildren(_angularViews, visitor); |
| 3187 } | 3334 } |
| 3188 | 3335 |
| 3336 @override |
| 3189 void appendTo(JavaStringBuilder builder) { | 3337 void appendTo(JavaStringBuilder builder) { |
| 3190 if (source == null) { | 3338 if (source == null) { |
| 3191 builder.append("{compilation unit}"); | 3339 builder.append("{compilation unit}"); |
| 3192 } else { | 3340 } else { |
| 3193 builder.append(source.fullName); | 3341 builder.append(source.fullName); |
| 3194 } | 3342 } |
| 3195 } | 3343 } |
| 3196 | 3344 |
| 3345 @override |
| 3197 String get identifier => source.encoding; | 3346 String get identifier => source.encoding; |
| 3198 | 3347 |
| 3199 /** | 3348 /** |
| 3200 * Returns the associated toolkit objects. | 3349 * Returns the associated toolkit objects. |
| 3201 * | 3350 * |
| 3202 * @param element the [Element] to get toolkit objects for | 3351 * @param element the [Element] to get toolkit objects for |
| 3203 * @return the associated toolkit objects, may be empty, but not `null` | 3352 * @return the associated toolkit objects, may be empty, but not `null` |
| 3204 */ | 3353 */ |
| 3205 List<ToolkitObjectElement> _getToolkitObjects(Element element) { | 3354 List<ToolkitObjectElement> _getToolkitObjects(Element element) { |
| 3206 List<ToolkitObjectElement> objects = _toolkitObjects[element]; | 3355 List<ToolkitObjectElement> objects = _toolkitObjects[element]; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 3231 */ | 3380 */ |
| 3232 EvaluationResultImpl _result; | 3381 EvaluationResultImpl _result; |
| 3233 | 3382 |
| 3234 /** | 3383 /** |
| 3235 * Initialize a newly created field element to have the given name. | 3384 * Initialize a newly created field element to have the given name. |
| 3236 * | 3385 * |
| 3237 * @param name the name of this element | 3386 * @param name the name of this element |
| 3238 */ | 3387 */ |
| 3239 ConstFieldElementImpl(Identifier name) : super.con1(name); | 3388 ConstFieldElementImpl(Identifier name) : super.con1(name); |
| 3240 | 3389 |
| 3390 @override |
| 3241 EvaluationResultImpl get evaluationResult => _result; | 3391 EvaluationResultImpl get evaluationResult => _result; |
| 3242 | 3392 |
| 3393 @override |
| 3243 void set evaluationResult(EvaluationResultImpl result) { | 3394 void set evaluationResult(EvaluationResultImpl result) { |
| 3244 this._result = result; | 3395 this._result = result; |
| 3245 } | 3396 } |
| 3246 } | 3397 } |
| 3247 | 3398 |
| 3248 /** | 3399 /** |
| 3249 * Instances of the class `ConstLocalVariableElementImpl` implement a | 3400 * Instances of the class `ConstLocalVariableElementImpl` implement a |
| 3250 * `LocalVariableElement` for a local 'const' variable that has an initializer. | 3401 * `LocalVariableElement` for a local 'const' variable that has an initializer. |
| 3251 */ | 3402 */ |
| 3252 class ConstLocalVariableElementImpl extends LocalVariableElementImpl { | 3403 class ConstLocalVariableElementImpl extends LocalVariableElementImpl { |
| 3253 /** | 3404 /** |
| 3254 * The result of evaluating this variable's initializer. | 3405 * The result of evaluating this variable's initializer. |
| 3255 */ | 3406 */ |
| 3256 EvaluationResultImpl _result; | 3407 EvaluationResultImpl _result; |
| 3257 | 3408 |
| 3258 /** | 3409 /** |
| 3259 * Initialize a newly created local variable element to have the given name. | 3410 * Initialize a newly created local variable element to have the given name. |
| 3260 * | 3411 * |
| 3261 * @param name the name of this element | 3412 * @param name the name of this element |
| 3262 */ | 3413 */ |
| 3263 ConstLocalVariableElementImpl(Identifier name) : super(name); | 3414 ConstLocalVariableElementImpl(Identifier name) : super(name); |
| 3264 | 3415 |
| 3416 @override |
| 3265 EvaluationResultImpl get evaluationResult => _result; | 3417 EvaluationResultImpl get evaluationResult => _result; |
| 3266 | 3418 |
| 3419 @override |
| 3267 void set evaluationResult(EvaluationResultImpl result) { | 3420 void set evaluationResult(EvaluationResultImpl result) { |
| 3268 this._result = result; | 3421 this._result = result; |
| 3269 } | 3422 } |
| 3270 } | 3423 } |
| 3271 | 3424 |
| 3272 /** | 3425 /** |
| 3273 * Instances of the class `ConstTopLevelVariableElementImpl` implement a | 3426 * Instances of the class `ConstTopLevelVariableElementImpl` implement a |
| 3274 * `TopLevelVariableElement` for a top-level 'const' variable that has an initia
lizer. | 3427 * `TopLevelVariableElement` for a top-level 'const' variable that has an initia
lizer. |
| 3275 */ | 3428 */ |
| 3276 class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl { | 3429 class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl { |
| 3277 /** | 3430 /** |
| 3278 * The result of evaluating this variable's initializer. | 3431 * The result of evaluating this variable's initializer. |
| 3279 */ | 3432 */ |
| 3280 EvaluationResultImpl _result; | 3433 EvaluationResultImpl _result; |
| 3281 | 3434 |
| 3282 /** | 3435 /** |
| 3283 * Initialize a newly created top-level variable element to have the given nam
e. | 3436 * Initialize a newly created top-level variable element to have the given nam
e. |
| 3284 * | 3437 * |
| 3285 * @param name the name of this element | 3438 * @param name the name of this element |
| 3286 */ | 3439 */ |
| 3287 ConstTopLevelVariableElementImpl(Identifier name) : super.con1(name); | 3440 ConstTopLevelVariableElementImpl(Identifier name) : super.con1(name); |
| 3288 | 3441 |
| 3442 @override |
| 3289 EvaluationResultImpl get evaluationResult => _result; | 3443 EvaluationResultImpl get evaluationResult => _result; |
| 3290 | 3444 |
| 3445 @override |
| 3291 void set evaluationResult(EvaluationResultImpl result) { | 3446 void set evaluationResult(EvaluationResultImpl result) { |
| 3292 this._result = result; | 3447 this._result = result; |
| 3293 } | 3448 } |
| 3294 } | 3449 } |
| 3295 | 3450 |
| 3296 /** | 3451 /** |
| 3297 * Instances of the class `ConstructorElementImpl` implement a `ConstructorEleme
nt`. | 3452 * Instances of the class `ConstructorElementImpl` implement a `ConstructorEleme
nt`. |
| 3298 */ | 3453 */ |
| 3299 class ConstructorElementImpl extends ExecutableElementImpl implements Constructo
rElement { | 3454 class ConstructorElementImpl extends ExecutableElementImpl implements Constructo
rElement { |
| 3300 /** | 3455 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3316 | 3471 |
| 3317 /** | 3472 /** |
| 3318 * Initialize a newly created constructor element to have the given name. | 3473 * Initialize a newly created constructor element to have the given name. |
| 3319 * | 3474 * |
| 3320 * @param name the name of this element | 3475 * @param name the name of this element |
| 3321 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3476 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 3322 * declaration of this element | 3477 * declaration of this element |
| 3323 */ | 3478 */ |
| 3324 ConstructorElementImpl.con2(String name, int nameOffset) : super.con2(name, na
meOffset); | 3479 ConstructorElementImpl.con2(String name, int nameOffset) : super.con2(name, na
meOffset); |
| 3325 | 3480 |
| 3481 @override |
| 3326 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 3482 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 3327 | 3483 |
| 3484 @override |
| 3328 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3485 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 3329 | 3486 |
| 3487 @override |
| 3330 ElementKind get kind => ElementKind.CONSTRUCTOR; | 3488 ElementKind get kind => ElementKind.CONSTRUCTOR; |
| 3331 | 3489 |
| 3490 @override |
| 3332 ConstructorDeclaration get node => getNodeMatching((node) => node is Construct
orDeclaration); | 3491 ConstructorDeclaration get node => getNodeMatching((node) => node is Construct
orDeclaration); |
| 3333 | 3492 |
| 3493 @override |
| 3334 bool get isConst => hasModifier(Modifier.CONST); | 3494 bool get isConst => hasModifier(Modifier.CONST); |
| 3335 | 3495 |
| 3496 @override |
| 3336 bool get isDefaultConstructor { | 3497 bool get isDefaultConstructor { |
| 3337 // unnamed | 3498 // unnamed |
| 3338 String name = this.name; | 3499 String name = this.name; |
| 3339 if (name != null && name.length != 0) { | 3500 if (name != null && name.length != 0) { |
| 3340 return false; | 3501 return false; |
| 3341 } | 3502 } |
| 3342 // no required parameters | 3503 // no required parameters |
| 3343 for (ParameterElement parameter in parameters) { | 3504 for (ParameterElement parameter in parameters) { |
| 3344 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { | 3505 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { |
| 3345 return false; | 3506 return false; |
| 3346 } | 3507 } |
| 3347 } | 3508 } |
| 3348 // OK, can be used as default constructor | 3509 // OK, can be used as default constructor |
| 3349 return true; | 3510 return true; |
| 3350 } | 3511 } |
| 3351 | 3512 |
| 3513 @override |
| 3352 bool get isFactory => hasModifier(Modifier.FACTORY); | 3514 bool get isFactory => hasModifier(Modifier.FACTORY); |
| 3353 | 3515 |
| 3516 @override |
| 3354 bool get isStatic => false; | 3517 bool get isStatic => false; |
| 3355 | 3518 |
| 3356 /** | 3519 /** |
| 3357 * Set whether this constructor represents a 'const' constructor to the given
value. | 3520 * Set whether this constructor represents a 'const' constructor to the given
value. |
| 3358 * | 3521 * |
| 3359 * @param isConst `true` if this constructor represents a 'const' constructor | 3522 * @param isConst `true` if this constructor represents a 'const' constructor |
| 3360 */ | 3523 */ |
| 3361 void set const2(bool isConst) { | 3524 void set const2(bool isConst) { |
| 3362 setModifier(Modifier.CONST, isConst); | 3525 setModifier(Modifier.CONST, isConst); |
| 3363 } | 3526 } |
| 3364 | 3527 |
| 3365 /** | 3528 /** |
| 3366 * Set whether this constructor represents a factory method to the given value
. | 3529 * Set whether this constructor represents a factory method to the given value
. |
| 3367 * | 3530 * |
| 3368 * @param isFactory `true` if this constructor represents a factory method | 3531 * @param isFactory `true` if this constructor represents a factory method |
| 3369 */ | 3532 */ |
| 3370 void set factory(bool isFactory) { | 3533 void set factory(bool isFactory) { |
| 3371 setModifier(Modifier.FACTORY, isFactory); | 3534 setModifier(Modifier.FACTORY, isFactory); |
| 3372 } | 3535 } |
| 3373 | 3536 |
| 3537 @override |
| 3374 void appendTo(JavaStringBuilder builder) { | 3538 void appendTo(JavaStringBuilder builder) { |
| 3375 builder.append(enclosingElement.displayName); | 3539 builder.append(enclosingElement.displayName); |
| 3376 String name = displayName; | 3540 String name = displayName; |
| 3377 if (name != null && !name.isEmpty) { | 3541 if (name != null && !name.isEmpty) { |
| 3378 builder.append("."); | 3542 builder.append("."); |
| 3379 builder.append(name); | 3543 builder.append(name); |
| 3380 } | 3544 } |
| 3381 super.appendTo(builder); | 3545 super.appendTo(builder); |
| 3382 } | 3546 } |
| 3383 } | 3547 } |
| 3384 | 3548 |
| 3385 /** | 3549 /** |
| 3386 * Instances of the class `DefaultFieldFormalParameterElementImpl` implement a | 3550 * Instances of the class `DefaultFieldFormalParameterElementImpl` implement a |
| 3387 * `FieldFormalParameterElementImpl` for parameters that have an initializer. | 3551 * `FieldFormalParameterElementImpl` for parameters that have an initializer. |
| 3388 */ | 3552 */ |
| 3389 class DefaultFieldFormalParameterElementImpl extends FieldFormalParameterElement
Impl { | 3553 class DefaultFieldFormalParameterElementImpl extends FieldFormalParameterElement
Impl { |
| 3390 /** | 3554 /** |
| 3391 * The result of evaluating this variable's initializer. | 3555 * The result of evaluating this variable's initializer. |
| 3392 */ | 3556 */ |
| 3393 EvaluationResultImpl _result; | 3557 EvaluationResultImpl _result; |
| 3394 | 3558 |
| 3395 /** | 3559 /** |
| 3396 * Initialize a newly created parameter element to have the given name. | 3560 * Initialize a newly created parameter element to have the given name. |
| 3397 * | 3561 * |
| 3398 * @param name the name of this element | 3562 * @param name the name of this element |
| 3399 */ | 3563 */ |
| 3400 DefaultFieldFormalParameterElementImpl(Identifier name) : super(name); | 3564 DefaultFieldFormalParameterElementImpl(Identifier name) : super(name); |
| 3401 | 3565 |
| 3566 @override |
| 3402 EvaluationResultImpl get evaluationResult => _result; | 3567 EvaluationResultImpl get evaluationResult => _result; |
| 3403 | 3568 |
| 3569 @override |
| 3404 void set evaluationResult(EvaluationResultImpl result) { | 3570 void set evaluationResult(EvaluationResultImpl result) { |
| 3405 this._result = result; | 3571 this._result = result; |
| 3406 } | 3572 } |
| 3407 } | 3573 } |
| 3408 | 3574 |
| 3409 /** | 3575 /** |
| 3410 * Instances of the class `DefaultParameterElementImpl` implement a `ParameterEl
ement` | 3576 * Instances of the class `DefaultParameterElementImpl` implement a `ParameterEl
ement` |
| 3411 * for parameters that have an initializer. | 3577 * for parameters that have an initializer. |
| 3412 */ | 3578 */ |
| 3413 class DefaultParameterElementImpl extends ParameterElementImpl { | 3579 class DefaultParameterElementImpl extends ParameterElementImpl { |
| 3414 /** | 3580 /** |
| 3415 * The result of evaluating this variable's initializer. | 3581 * The result of evaluating this variable's initializer. |
| 3416 */ | 3582 */ |
| 3417 EvaluationResultImpl _result; | 3583 EvaluationResultImpl _result; |
| 3418 | 3584 |
| 3419 /** | 3585 /** |
| 3420 * Initialize a newly created parameter element to have the given name. | 3586 * Initialize a newly created parameter element to have the given name. |
| 3421 * | 3587 * |
| 3422 * @param name the name of this element | 3588 * @param name the name of this element |
| 3423 */ | 3589 */ |
| 3424 DefaultParameterElementImpl(Identifier name) : super.con1(name); | 3590 DefaultParameterElementImpl(Identifier name) : super.con1(name); |
| 3425 | 3591 |
| 3592 @override |
| 3426 EvaluationResultImpl get evaluationResult => _result; | 3593 EvaluationResultImpl get evaluationResult => _result; |
| 3427 | 3594 |
| 3595 @override |
| 3428 void set evaluationResult(EvaluationResultImpl result) { | 3596 void set evaluationResult(EvaluationResultImpl result) { |
| 3429 this._result = result; | 3597 this._result = result; |
| 3430 } | 3598 } |
| 3431 } | 3599 } |
| 3432 | 3600 |
| 3433 /** | 3601 /** |
| 3434 * Instances of the class `DynamicElementImpl` represent the synthetic element r
epresenting | 3602 * Instances of the class `DynamicElementImpl` represent the synthetic element r
epresenting |
| 3435 * the declaration of the type `dynamic`. | 3603 * the declaration of the type `dynamic`. |
| 3436 */ | 3604 */ |
| 3437 class DynamicElementImpl extends ElementImpl { | 3605 class DynamicElementImpl extends ElementImpl { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3449 | 3617 |
| 3450 /** | 3618 /** |
| 3451 * Initialize a newly created instance of this class. Instances of this class
should <b>not</b> be | 3619 * Initialize a newly created instance of this class. Instances of this class
should <b>not</b> be |
| 3452 * created except as part of creating the type associated with this element. T
he single instance | 3620 * created except as part of creating the type associated with this element. T
he single instance |
| 3453 * of this class should be accessed through the method [getInstance]. | 3621 * of this class should be accessed through the method [getInstance]. |
| 3454 */ | 3622 */ |
| 3455 DynamicElementImpl() : super(Keyword.DYNAMIC.syntax, -1) { | 3623 DynamicElementImpl() : super(Keyword.DYNAMIC.syntax, -1) { |
| 3456 setModifier(Modifier.SYNTHETIC, true); | 3624 setModifier(Modifier.SYNTHETIC, true); |
| 3457 } | 3625 } |
| 3458 | 3626 |
| 3627 @override |
| 3459 accept(ElementVisitor visitor) => null; | 3628 accept(ElementVisitor visitor) => null; |
| 3460 | 3629 |
| 3630 @override |
| 3461 ElementKind get kind => ElementKind.DYNAMIC; | 3631 ElementKind get kind => ElementKind.DYNAMIC; |
| 3462 } | 3632 } |
| 3463 | 3633 |
| 3464 /** | 3634 /** |
| 3465 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio
n]. | 3635 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio
n]. |
| 3466 */ | 3636 */ |
| 3467 class ElementAnnotationImpl implements ElementAnnotation { | 3637 class ElementAnnotationImpl implements ElementAnnotation { |
| 3468 /** | 3638 /** |
| 3469 * The element representing the field, variable, or constructor being used as
an annotation. | 3639 * The element representing the field, variable, or constructor being used as
an annotation. |
| 3470 */ | 3640 */ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3497 static String _PROXY_VARIABLE_NAME = "proxy"; | 3667 static String _PROXY_VARIABLE_NAME = "proxy"; |
| 3498 | 3668 |
| 3499 /** | 3669 /** |
| 3500 * Initialize a newly created annotation. | 3670 * Initialize a newly created annotation. |
| 3501 * | 3671 * |
| 3502 * @param element the element representing the field, variable, or constructor
being used as an | 3672 * @param element the element representing the field, variable, or constructor
being used as an |
| 3503 * annotation | 3673 * annotation |
| 3504 */ | 3674 */ |
| 3505 ElementAnnotationImpl(this.element); | 3675 ElementAnnotationImpl(this.element); |
| 3506 | 3676 |
| 3677 @override |
| 3507 bool get isDeprecated { | 3678 bool get isDeprecated { |
| 3508 if (element != null) { | 3679 if (element != null) { |
| 3509 LibraryElement library = element.library; | 3680 LibraryElement library = element.library; |
| 3510 if (library != null && library.isDartCore) { | 3681 if (library != null && library.isDartCore) { |
| 3511 if (element is ConstructorElement) { | 3682 if (element is ConstructorElement) { |
| 3512 ConstructorElement constructorElement = element as ConstructorElement; | 3683 ConstructorElement constructorElement = element as ConstructorElement; |
| 3513 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME
) { | 3684 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME
) { |
| 3514 return true; | 3685 return true; |
| 3515 } | 3686 } |
| 3516 } else if (element is PropertyAccessorElement && element.name == _DEPREC
ATED_VARIABLE_NAME) { | 3687 } else if (element is PropertyAccessorElement && element.name == _DEPREC
ATED_VARIABLE_NAME) { |
| 3517 return true; | 3688 return true; |
| 3518 } | 3689 } |
| 3519 } | 3690 } |
| 3520 } | 3691 } |
| 3521 return false; | 3692 return false; |
| 3522 } | 3693 } |
| 3523 | 3694 |
| 3695 @override |
| 3524 bool get isOverride { | 3696 bool get isOverride { |
| 3525 if (element != null) { | 3697 if (element != null) { |
| 3526 LibraryElement library = element.library; | 3698 LibraryElement library = element.library; |
| 3527 if (library != null && library.isDartCore) { | 3699 if (library != null && library.isDartCore) { |
| 3528 if (element is PropertyAccessorElement && element.name == _OVERRIDE_VARI
ABLE_NAME) { | 3700 if (element is PropertyAccessorElement && element.name == _OVERRIDE_VARI
ABLE_NAME) { |
| 3529 return true; | 3701 return true; |
| 3530 } | 3702 } |
| 3531 } | 3703 } |
| 3532 } | 3704 } |
| 3533 return false; | 3705 return false; |
| 3534 } | 3706 } |
| 3535 | 3707 |
| 3708 @override |
| 3536 bool get isProxy { | 3709 bool get isProxy { |
| 3537 if (element != null) { | 3710 if (element != null) { |
| 3538 LibraryElement library = element.library; | 3711 LibraryElement library = element.library; |
| 3539 if (library != null && library.isDartCore) { | 3712 if (library != null && library.isDartCore) { |
| 3540 if (element is PropertyAccessorElement && element.name == _PROXY_VARIABL
E_NAME) { | 3713 if (element is PropertyAccessorElement && element.name == _PROXY_VARIABL
E_NAME) { |
| 3541 return true; | 3714 return true; |
| 3542 } | 3715 } |
| 3543 } | 3716 } |
| 3544 } | 3717 } |
| 3545 return false; | 3718 return false; |
| 3546 } | 3719 } |
| 3547 | 3720 |
| 3721 @override |
| 3548 String toString() => "@${element.toString()}"; | 3722 String toString() => "@${element.toString()}"; |
| 3549 } | 3723 } |
| 3550 | 3724 |
| 3551 /** | 3725 /** |
| 3552 * The abstract class `ElementImpl` implements the behavior common to objects th
at implement | 3726 * The abstract class `ElementImpl` implements the behavior common to objects th
at implement |
| 3553 * an [Element]. | 3727 * an [Element]. |
| 3554 */ | 3728 */ |
| 3555 abstract class ElementImpl implements Element { | 3729 abstract class ElementImpl implements Element { |
| 3556 /** | 3730 /** |
| 3557 * The enclosing element of this element, or `null` if this element is at the
root of the | 3731 * The enclosing element of this element, or `null` if this element is at the
root of the |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3596 * Initialize a newly created element to have the given name. | 3770 * Initialize a newly created element to have the given name. |
| 3597 * | 3771 * |
| 3598 * @param name the name of this element | 3772 * @param name the name of this element |
| 3599 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3773 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 3600 * declaration of this element | 3774 * declaration of this element |
| 3601 */ | 3775 */ |
| 3602 ElementImpl(String name, this.nameOffset) { | 3776 ElementImpl(String name, this.nameOffset) { |
| 3603 this._name = StringUtilities.intern(name); | 3777 this._name = StringUtilities.intern(name); |
| 3604 } | 3778 } |
| 3605 | 3779 |
| 3780 @override |
| 3606 String computeDocumentationComment() { | 3781 String computeDocumentationComment() { |
| 3607 AnalysisContext context = this.context; | 3782 AnalysisContext context = this.context; |
| 3608 if (context == null) { | 3783 if (context == null) { |
| 3609 return null; | 3784 return null; |
| 3610 } | 3785 } |
| 3611 return context.computeDocumentationComment(this); | 3786 return context.computeDocumentationComment(this); |
| 3612 } | 3787 } |
| 3613 | 3788 |
| 3789 @override |
| 3614 bool operator ==(Object object) { | 3790 bool operator ==(Object object) { |
| 3615 if (identical(this, object)) { | 3791 if (identical(this, object)) { |
| 3616 return true; | 3792 return true; |
| 3617 } | 3793 } |
| 3618 if (object == null || hashCode != object.hashCode) { | 3794 if (object == null || hashCode != object.hashCode) { |
| 3619 return false; | 3795 return false; |
| 3620 } | 3796 } |
| 3621 return object.runtimeType == runtimeType && (object as Element).location ==
location; | 3797 return object.runtimeType == runtimeType && (object as Element).location ==
location; |
| 3622 } | 3798 } |
| 3623 | 3799 |
| 3800 @override |
| 3624 Element getAncestor(Predicate<Element> predicate) { | 3801 Element getAncestor(Predicate<Element> predicate) { |
| 3625 Element ancestor = _enclosingElement; | 3802 Element ancestor = _enclosingElement; |
| 3626 while (ancestor != null && !predicate(ancestor)) { | 3803 while (ancestor != null && !predicate(ancestor)) { |
| 3627 ancestor = ancestor.enclosingElement; | 3804 ancestor = ancestor.enclosingElement; |
| 3628 } | 3805 } |
| 3629 return ancestor; | 3806 return ancestor; |
| 3630 } | 3807 } |
| 3631 | 3808 |
| 3632 /** | 3809 /** |
| 3633 * Return the child of this element that is uniquely identified by the given i
dentifier, or | 3810 * Return the child of this element that is uniquely identified by the given i
dentifier, or |
| 3634 * `null` if there is no such child. | 3811 * `null` if there is no such child. |
| 3635 * | 3812 * |
| 3636 * @param identifier the identifier used to select a child | 3813 * @param identifier the identifier used to select a child |
| 3637 * @return the child of this element with the given identifier | 3814 * @return the child of this element with the given identifier |
| 3638 */ | 3815 */ |
| 3639 ElementImpl getChild(String identifier) => null; | 3816 ElementImpl getChild(String identifier) => null; |
| 3640 | 3817 |
| 3818 @override |
| 3641 AnalysisContext get context { | 3819 AnalysisContext get context { |
| 3642 if (_enclosingElement == null) { | 3820 if (_enclosingElement == null) { |
| 3643 return null; | 3821 return null; |
| 3644 } | 3822 } |
| 3645 return _enclosingElement.context; | 3823 return _enclosingElement.context; |
| 3646 } | 3824 } |
| 3647 | 3825 |
| 3826 @override |
| 3648 String get displayName => _name; | 3827 String get displayName => _name; |
| 3649 | 3828 |
| 3829 @override |
| 3650 Element get enclosingElement => _enclosingElement; | 3830 Element get enclosingElement => _enclosingElement; |
| 3651 | 3831 |
| 3832 @override |
| 3652 LibraryElement get library => getAncestor((element) => element is LibraryEleme
nt); | 3833 LibraryElement get library => getAncestor((element) => element is LibraryEleme
nt); |
| 3653 | 3834 |
| 3835 @override |
| 3654 ElementLocation get location => new ElementLocationImpl.con1(this); | 3836 ElementLocation get location => new ElementLocationImpl.con1(this); |
| 3655 | 3837 |
| 3838 @override |
| 3656 String get name => _name; | 3839 String get name => _name; |
| 3657 | 3840 |
| 3841 @override |
| 3658 AstNode get node => getNodeMatching((node) => node is AstNode); | 3842 AstNode get node => getNodeMatching((node) => node is AstNode); |
| 3659 | 3843 |
| 3844 @override |
| 3660 Source get source { | 3845 Source get source { |
| 3661 if (_enclosingElement == null) { | 3846 if (_enclosingElement == null) { |
| 3662 return null; | 3847 return null; |
| 3663 } | 3848 } |
| 3664 return _enclosingElement.source; | 3849 return _enclosingElement.source; |
| 3665 } | 3850 } |
| 3666 | 3851 |
| 3852 @override |
| 3667 CompilationUnit get unit => context.resolveCompilationUnit(source, library); | 3853 CompilationUnit get unit => context.resolveCompilationUnit(source, library); |
| 3668 | 3854 |
| 3855 @override |
| 3669 int get hashCode { | 3856 int get hashCode { |
| 3670 // TODO: We might want to re-visit this optimization in the future. | 3857 // TODO: We might want to re-visit this optimization in the future. |
| 3671 // We cache the hash code value as this is a very frequently called method. | 3858 // We cache the hash code value as this is a very frequently called method. |
| 3672 if (_cachedHashCode == 0) { | 3859 if (_cachedHashCode == 0) { |
| 3673 _cachedHashCode = location.hashCode; | 3860 _cachedHashCode = location.hashCode; |
| 3674 } | 3861 } |
| 3675 return _cachedHashCode; | 3862 return _cachedHashCode; |
| 3676 } | 3863 } |
| 3677 | 3864 |
| 3865 @override |
| 3678 bool isAccessibleIn(LibraryElement library) { | 3866 bool isAccessibleIn(LibraryElement library) { |
| 3679 if (Identifier.isPrivateName(_name)) { | 3867 if (Identifier.isPrivateName(_name)) { |
| 3680 return library == this.library; | 3868 return library == this.library; |
| 3681 } | 3869 } |
| 3682 return true; | 3870 return true; |
| 3683 } | 3871 } |
| 3684 | 3872 |
| 3873 @override |
| 3685 bool get isDeprecated { | 3874 bool get isDeprecated { |
| 3686 for (ElementAnnotation annotation in metadata) { | 3875 for (ElementAnnotation annotation in metadata) { |
| 3687 if (annotation.isDeprecated) { | 3876 if (annotation.isDeprecated) { |
| 3688 return true; | 3877 return true; |
| 3689 } | 3878 } |
| 3690 } | 3879 } |
| 3691 return false; | 3880 return false; |
| 3692 } | 3881 } |
| 3693 | 3882 |
| 3883 @override |
| 3694 bool get isOverride { | 3884 bool get isOverride { |
| 3695 for (ElementAnnotation annotation in metadata) { | 3885 for (ElementAnnotation annotation in metadata) { |
| 3696 if (annotation.isOverride) { | 3886 if (annotation.isOverride) { |
| 3697 return true; | 3887 return true; |
| 3698 } | 3888 } |
| 3699 } | 3889 } |
| 3700 return false; | 3890 return false; |
| 3701 } | 3891 } |
| 3702 | 3892 |
| 3893 @override |
| 3703 bool get isPrivate { | 3894 bool get isPrivate { |
| 3704 String name = displayName; | 3895 String name = displayName; |
| 3705 if (name == null) { | 3896 if (name == null) { |
| 3706 return true; | 3897 return true; |
| 3707 } | 3898 } |
| 3708 return Identifier.isPrivateName(name); | 3899 return Identifier.isPrivateName(name); |
| 3709 } | 3900 } |
| 3710 | 3901 |
| 3902 @override |
| 3711 bool get isPublic => !isPrivate; | 3903 bool get isPublic => !isPrivate; |
| 3712 | 3904 |
| 3905 @override |
| 3713 bool get isSynthetic => hasModifier(Modifier.SYNTHETIC); | 3906 bool get isSynthetic => hasModifier(Modifier.SYNTHETIC); |
| 3714 | 3907 |
| 3715 /** | 3908 /** |
| 3716 * Set whether this element is synthetic to correspond to the given value. | 3909 * Set whether this element is synthetic to correspond to the given value. |
| 3717 * | 3910 * |
| 3718 * @param isSynthetic `true` if the element is synthetic | 3911 * @param isSynthetic `true` if the element is synthetic |
| 3719 */ | 3912 */ |
| 3720 void set synthetic(bool isSynthetic) { | 3913 void set synthetic(bool isSynthetic) { |
| 3721 setModifier(Modifier.SYNTHETIC, isSynthetic); | 3914 setModifier(Modifier.SYNTHETIC, isSynthetic); |
| 3722 } | 3915 } |
| 3723 | 3916 |
| 3917 @override |
| 3724 String toString() { | 3918 String toString() { |
| 3725 JavaStringBuilder builder = new JavaStringBuilder(); | 3919 JavaStringBuilder builder = new JavaStringBuilder(); |
| 3726 appendTo(builder); | 3920 appendTo(builder); |
| 3727 return builder.toString(); | 3921 return builder.toString(); |
| 3728 } | 3922 } |
| 3729 | 3923 |
| 3924 @override |
| 3730 void visitChildren(ElementVisitor visitor) { | 3925 void visitChildren(ElementVisitor visitor) { |
| 3731 } | 3926 } |
| 3732 | 3927 |
| 3733 /** | 3928 /** |
| 3734 * Append a textual representation of this type to the given builder. | 3929 * Append a textual representation of this type to the given builder. |
| 3735 * | 3930 * |
| 3736 * @param builder the builder to which the text is to be appended | 3931 * @param builder the builder to which the text is to be appended |
| 3737 */ | 3932 */ |
| 3738 void appendTo(JavaStringBuilder builder) { | 3933 void appendTo(JavaStringBuilder builder) { |
| 3739 if (_name == null) { | 3934 if (_name == null) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3864 | 4059 |
| 3865 /** | 4060 /** |
| 3866 * Initialize a newly created location from the given encoded form. | 4061 * Initialize a newly created location from the given encoded form. |
| 3867 * | 4062 * |
| 3868 * @param encoding the encoded form of a location | 4063 * @param encoding the encoded form of a location |
| 3869 */ | 4064 */ |
| 3870 ElementLocationImpl.con2(String encoding) { | 4065 ElementLocationImpl.con2(String encoding) { |
| 3871 this._components = _decode(encoding); | 4066 this._components = _decode(encoding); |
| 3872 } | 4067 } |
| 3873 | 4068 |
| 4069 @override |
| 3874 bool operator ==(Object object) { | 4070 bool operator ==(Object object) { |
| 3875 if (identical(this, object)) { | 4071 if (identical(this, object)) { |
| 3876 return true; | 4072 return true; |
| 3877 } | 4073 } |
| 3878 if (object is! ElementLocationImpl) { | 4074 if (object is! ElementLocationImpl) { |
| 3879 return false; | 4075 return false; |
| 3880 } | 4076 } |
| 3881 ElementLocationImpl location = object as ElementLocationImpl; | 4077 ElementLocationImpl location = object as ElementLocationImpl; |
| 3882 List<String> otherComponents = location._components; | 4078 List<String> otherComponents = location._components; |
| 3883 int length = _components.length; | 4079 int length = _components.length; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3898 return true; | 4094 return true; |
| 3899 } | 4095 } |
| 3900 | 4096 |
| 3901 /** | 4097 /** |
| 3902 * Return the path to the element whose location is represented by this object
. | 4098 * Return the path to the element whose location is represented by this object
. |
| 3903 * | 4099 * |
| 3904 * @return the path to the element whose location is represented by this objec
t | 4100 * @return the path to the element whose location is represented by this objec
t |
| 3905 */ | 4101 */ |
| 3906 List<String> get components => _components; | 4102 List<String> get components => _components; |
| 3907 | 4103 |
| 4104 @override |
| 3908 String get encoding { | 4105 String get encoding { |
| 3909 JavaStringBuilder builder = new JavaStringBuilder(); | 4106 JavaStringBuilder builder = new JavaStringBuilder(); |
| 3910 int length = _components.length; | 4107 int length = _components.length; |
| 3911 for (int i = 0; i < length; i++) { | 4108 for (int i = 0; i < length; i++) { |
| 3912 if (i > 0) { | 4109 if (i > 0) { |
| 3913 builder.appendChar(_SEPARATOR_CHAR); | 4110 builder.appendChar(_SEPARATOR_CHAR); |
| 3914 } | 4111 } |
| 3915 _encode(builder, _components[i]); | 4112 _encode(builder, _components[i]); |
| 3916 } | 4113 } |
| 3917 return builder.toString(); | 4114 return builder.toString(); |
| 3918 } | 4115 } |
| 3919 | 4116 |
| 4117 @override |
| 3920 int get hashCode { | 4118 int get hashCode { |
| 3921 int result = 1; | 4119 int result = 1; |
| 3922 for (int i = 0; i < _components.length; i++) { | 4120 for (int i = 0; i < _components.length; i++) { |
| 3923 String component = _components[i]; | 4121 String component = _components[i]; |
| 3924 int componentHash; | 4122 int componentHash; |
| 3925 if (i <= 1) { | 4123 if (i <= 1) { |
| 3926 componentHash = _hashSourceComponent(component); | 4124 componentHash = _hashSourceComponent(component); |
| 3927 } else { | 4125 } else { |
| 3928 componentHash = component.hashCode; | 4126 componentHash = component.hashCode; |
| 3929 } | 4127 } |
| 3930 result = 31 * result + componentHash; | 4128 result = 31 * result + componentHash; |
| 3931 } | 4129 } |
| 3932 return result; | 4130 return result; |
| 3933 } | 4131 } |
| 3934 | 4132 |
| 4133 @override |
| 3935 String toString() => encoding; | 4134 String toString() => encoding; |
| 3936 | 4135 |
| 3937 /** | 4136 /** |
| 3938 * Decode the encoded form of a location into an array of components. | 4137 * Decode the encoded form of a location into an array of components. |
| 3939 * | 4138 * |
| 3940 * @param encoding the encoded form of a location | 4139 * @param encoding the encoded form of a location |
| 3941 * @return the components that were encoded | 4140 * @return the components that were encoded |
| 3942 */ | 4141 */ |
| 3943 List<String> _decode(String encoding) { | 4142 List<String> _decode(String encoding) { |
| 3944 List<String> components = new List<String>(); | 4143 List<String> components = new List<String>(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4043 * The sole constructor for this class, taking two [Element]s. | 4242 * The sole constructor for this class, taking two [Element]s. |
| 4044 * | 4243 * |
| 4045 * @param first the first element | 4244 * @param first the first element |
| 4046 * @param second the second element | 4245 * @param second the second element |
| 4047 */ | 4246 */ |
| 4048 ElementPair(Element first, Element second) { | 4247 ElementPair(Element first, Element second) { |
| 4049 this._first = first; | 4248 this._first = first; |
| 4050 this._second = second; | 4249 this._second = second; |
| 4051 } | 4250 } |
| 4052 | 4251 |
| 4252 @override |
| 4053 bool operator ==(Object object) { | 4253 bool operator ==(Object object) { |
| 4054 if (identical(object, this)) { | 4254 if (identical(object, this)) { |
| 4055 return true; | 4255 return true; |
| 4056 } | 4256 } |
| 4057 if (object is ElementPair) { | 4257 if (object is ElementPair) { |
| 4058 ElementPair elementPair = object; | 4258 ElementPair elementPair = object; |
| 4059 return (_first == elementPair._first) && (_second == elementPair._second); | 4259 return (_first == elementPair._first) && (_second == elementPair._second); |
| 4060 } | 4260 } |
| 4061 return false; | 4261 return false; |
| 4062 } | 4262 } |
| 4063 | 4263 |
| 4064 /** | 4264 /** |
| 4065 * Return the first element. | 4265 * Return the first element. |
| 4066 * | 4266 * |
| 4067 * @return the first element | 4267 * @return the first element |
| 4068 */ | 4268 */ |
| 4069 Element get firstElt => _first; | 4269 Element get firstElt => _first; |
| 4070 | 4270 |
| 4071 /** | 4271 /** |
| 4072 * Return the second element | 4272 * Return the second element |
| 4073 * | 4273 * |
| 4074 * @return the second element | 4274 * @return the second element |
| 4075 */ | 4275 */ |
| 4076 Element get secondElt => _second; | 4276 Element get secondElt => _second; |
| 4077 | 4277 |
| 4278 @override |
| 4078 int get hashCode => ObjectUtilities.combineHashCodes(_first.hashCode, _second.
hashCode); | 4279 int get hashCode => ObjectUtilities.combineHashCodes(_first.hashCode, _second.
hashCode); |
| 4079 } | 4280 } |
| 4080 | 4281 |
| 4081 /** | 4282 /** |
| 4082 * Instances of the class `EmbeddedHtmlScriptElementImpl` implement an | 4283 * Instances of the class `EmbeddedHtmlScriptElementImpl` implement an |
| 4083 * [EmbeddedHtmlScriptElement]. | 4284 * [EmbeddedHtmlScriptElement]. |
| 4084 */ | 4285 */ |
| 4085 class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements Emb
eddedHtmlScriptElement { | 4286 class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements Emb
eddedHtmlScriptElement { |
| 4086 /** | 4287 /** |
| 4087 * The library defined by the script tag's content. | 4288 * The library defined by the script tag's content. |
| 4088 */ | 4289 */ |
| 4089 LibraryElement _scriptLibrary; | 4290 LibraryElement _scriptLibrary; |
| 4090 | 4291 |
| 4091 /** | 4292 /** |
| 4092 * Initialize a newly created script element to have the specified tag name an
d offset. | 4293 * Initialize a newly created script element to have the specified tag name an
d offset. |
| 4093 * | 4294 * |
| 4094 * @param node the XML node from which this element is derived (not `null`) | 4295 * @param node the XML node from which this element is derived (not `null`) |
| 4095 */ | 4296 */ |
| 4096 EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node); | 4297 EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node); |
| 4097 | 4298 |
| 4299 @override |
| 4098 accept(ElementVisitor visitor) => visitor.visitEmbeddedHtmlScriptElement(this)
; | 4300 accept(ElementVisitor visitor) => visitor.visitEmbeddedHtmlScriptElement(this)
; |
| 4099 | 4301 |
| 4302 @override |
| 4100 ElementKind get kind => ElementKind.EMBEDDED_HTML_SCRIPT; | 4303 ElementKind get kind => ElementKind.EMBEDDED_HTML_SCRIPT; |
| 4101 | 4304 |
| 4305 @override |
| 4102 LibraryElement get scriptLibrary => _scriptLibrary; | 4306 LibraryElement get scriptLibrary => _scriptLibrary; |
| 4103 | 4307 |
| 4104 /** | 4308 /** |
| 4105 * Set the script library defined by the script tag's content. | 4309 * Set the script library defined by the script tag's content. |
| 4106 * | 4310 * |
| 4107 * @param scriptLibrary the library or `null` if none | 4311 * @param scriptLibrary the library or `null` if none |
| 4108 */ | 4312 */ |
| 4109 void set scriptLibrary(LibraryElementImpl scriptLibrary) { | 4313 void set scriptLibrary(LibraryElementImpl scriptLibrary) { |
| 4110 scriptLibrary.enclosingElement = this; | 4314 scriptLibrary.enclosingElement = this; |
| 4111 this._scriptLibrary = scriptLibrary; | 4315 this._scriptLibrary = scriptLibrary; |
| 4112 } | 4316 } |
| 4113 | 4317 |
| 4318 @override |
| 4114 void visitChildren(ElementVisitor visitor) { | 4319 void visitChildren(ElementVisitor visitor) { |
| 4115 safelyVisitChild(_scriptLibrary, visitor); | 4320 safelyVisitChild(_scriptLibrary, visitor); |
| 4116 } | 4321 } |
| 4117 } | 4322 } |
| 4118 | 4323 |
| 4119 /** | 4324 /** |
| 4120 * The abstract class `ExecutableElementImpl` implements the behavior common to | 4325 * The abstract class `ExecutableElementImpl` implements the behavior common to |
| 4121 * `ExecutableElement`s. | 4326 * `ExecutableElement`s. |
| 4122 */ | 4327 */ |
| 4123 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl
ement { | 4328 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl
ement { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4165 | 4370 |
| 4166 /** | 4371 /** |
| 4167 * Initialize a newly created executable element to have the given name. | 4372 * Initialize a newly created executable element to have the given name. |
| 4168 * | 4373 * |
| 4169 * @param name the name of this element | 4374 * @param name the name of this element |
| 4170 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 4375 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 4171 * declaration of this element | 4376 * declaration of this element |
| 4172 */ | 4377 */ |
| 4173 ExecutableElementImpl.con2(String name, int nameOffset) : super(name, nameOffs
et); | 4378 ExecutableElementImpl.con2(String name, int nameOffset) : super(name, nameOffs
et); |
| 4174 | 4379 |
| 4380 @override |
| 4175 ElementImpl getChild(String identifier) { | 4381 ElementImpl getChild(String identifier) { |
| 4176 for (ExecutableElement function in _functions) { | 4382 for (ExecutableElement function in _functions) { |
| 4177 if ((function as ExecutableElementImpl).identifier == identifier) { | 4383 if ((function as ExecutableElementImpl).identifier == identifier) { |
| 4178 return function as ExecutableElementImpl; | 4384 return function as ExecutableElementImpl; |
| 4179 } | 4385 } |
| 4180 } | 4386 } |
| 4181 for (LabelElement label in _labels) { | 4387 for (LabelElement label in _labels) { |
| 4182 if ((label as LabelElementImpl).identifier == identifier) { | 4388 if ((label as LabelElementImpl).identifier == identifier) { |
| 4183 return label as LabelElementImpl; | 4389 return label as LabelElementImpl; |
| 4184 } | 4390 } |
| 4185 } | 4391 } |
| 4186 for (VariableElement variable in _localVariables) { | 4392 for (VariableElement variable in _localVariables) { |
| 4187 if ((variable as VariableElementImpl).identifier == identifier) { | 4393 if ((variable as VariableElementImpl).identifier == identifier) { |
| 4188 return variable as VariableElementImpl; | 4394 return variable as VariableElementImpl; |
| 4189 } | 4395 } |
| 4190 } | 4396 } |
| 4191 for (ParameterElement parameter in _parameters) { | 4397 for (ParameterElement parameter in _parameters) { |
| 4192 if ((parameter as ParameterElementImpl).identifier == identifier) { | 4398 if ((parameter as ParameterElementImpl).identifier == identifier) { |
| 4193 return parameter as ParameterElementImpl; | 4399 return parameter as ParameterElementImpl; |
| 4194 } | 4400 } |
| 4195 } | 4401 } |
| 4196 return null; | 4402 return null; |
| 4197 } | 4403 } |
| 4198 | 4404 |
| 4405 @override |
| 4199 List<FunctionElement> get functions => _functions; | 4406 List<FunctionElement> get functions => _functions; |
| 4200 | 4407 |
| 4408 @override |
| 4201 List<LabelElement> get labels => _labels; | 4409 List<LabelElement> get labels => _labels; |
| 4202 | 4410 |
| 4411 @override |
| 4203 List<LocalVariableElement> get localVariables => _localVariables; | 4412 List<LocalVariableElement> get localVariables => _localVariables; |
| 4204 | 4413 |
| 4414 @override |
| 4205 List<ParameterElement> get parameters => _parameters; | 4415 List<ParameterElement> get parameters => _parameters; |
| 4206 | 4416 |
| 4417 @override |
| 4207 bool get isOperator => false; | 4418 bool get isOperator => false; |
| 4208 | 4419 |
| 4209 /** | 4420 /** |
| 4210 * Set the functions defined within this executable element to the given funct
ions. | 4421 * Set the functions defined within this executable element to the given funct
ions. |
| 4211 * | 4422 * |
| 4212 * @param functions the functions defined within this executable element | 4423 * @param functions the functions defined within this executable element |
| 4213 */ | 4424 */ |
| 4214 void set functions(List<FunctionElement> functions) { | 4425 void set functions(List<FunctionElement> functions) { |
| 4215 for (FunctionElement function in functions) { | 4426 for (FunctionElement function in functions) { |
| 4216 (function as FunctionElementImpl).enclosingElement = this; | 4427 (function as FunctionElementImpl).enclosingElement = this; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 4247 * | 4458 * |
| 4248 * @param parameters the parameters defined by this executable element | 4459 * @param parameters the parameters defined by this executable element |
| 4249 */ | 4460 */ |
| 4250 void set parameters(List<ParameterElement> parameters) { | 4461 void set parameters(List<ParameterElement> parameters) { |
| 4251 for (ParameterElement parameter in parameters) { | 4462 for (ParameterElement parameter in parameters) { |
| 4252 (parameter as ParameterElementImpl).enclosingElement = this; | 4463 (parameter as ParameterElementImpl).enclosingElement = this; |
| 4253 } | 4464 } |
| 4254 this._parameters = parameters; | 4465 this._parameters = parameters; |
| 4255 } | 4466 } |
| 4256 | 4467 |
| 4468 @override |
| 4257 void visitChildren(ElementVisitor visitor) { | 4469 void visitChildren(ElementVisitor visitor) { |
| 4258 super.visitChildren(visitor); | 4470 super.visitChildren(visitor); |
| 4259 safelyVisitChildren(_functions, visitor); | 4471 safelyVisitChildren(_functions, visitor); |
| 4260 safelyVisitChildren(_labels, visitor); | 4472 safelyVisitChildren(_labels, visitor); |
| 4261 safelyVisitChildren(_localVariables, visitor); | 4473 safelyVisitChildren(_localVariables, visitor); |
| 4262 safelyVisitChildren(_parameters, visitor); | 4474 safelyVisitChildren(_parameters, visitor); |
| 4263 } | 4475 } |
| 4264 | 4476 |
| 4477 @override |
| 4265 void appendTo(JavaStringBuilder builder) { | 4478 void appendTo(JavaStringBuilder builder) { |
| 4266 if (this.kind != ElementKind.GETTER) { | 4479 if (this.kind != ElementKind.GETTER) { |
| 4267 builder.append("("); | 4480 builder.append("("); |
| 4268 String closing = null; | 4481 String closing = null; |
| 4269 ParameterKind kind = ParameterKind.REQUIRED; | 4482 ParameterKind kind = ParameterKind.REQUIRED; |
| 4270 int parameterCount = _parameters.length; | 4483 int parameterCount = _parameters.length; |
| 4271 for (int i = 0; i < parameterCount; i++) { | 4484 for (int i = 0; i < parameterCount; i++) { |
| 4272 if (i > 0) { | 4485 if (i > 0) { |
| 4273 builder.append(", "); | 4486 builder.append(", "); |
| 4274 } | 4487 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4321 * The combinators that were specified as part of the export directive in the
order in which they | 4534 * The combinators that were specified as part of the export directive in the
order in which they |
| 4322 * were specified. | 4535 * were specified. |
| 4323 */ | 4536 */ |
| 4324 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY; | 4537 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY; |
| 4325 | 4538 |
| 4326 /** | 4539 /** |
| 4327 * Initialize a newly created export element. | 4540 * Initialize a newly created export element. |
| 4328 */ | 4541 */ |
| 4329 ExportElementImpl() : super.forNode(null); | 4542 ExportElementImpl() : super.forNode(null); |
| 4330 | 4543 |
| 4544 @override |
| 4331 accept(ElementVisitor visitor) => visitor.visitExportElement(this); | 4545 accept(ElementVisitor visitor) => visitor.visitExportElement(this); |
| 4332 | 4546 |
| 4547 @override |
| 4333 ElementKind get kind => ElementKind.EXPORT; | 4548 ElementKind get kind => ElementKind.EXPORT; |
| 4334 | 4549 |
| 4550 @override |
| 4335 void appendTo(JavaStringBuilder builder) { | 4551 void appendTo(JavaStringBuilder builder) { |
| 4336 builder.append("export "); | 4552 builder.append("export "); |
| 4337 (exportedLibrary as LibraryElementImpl).appendTo(builder); | 4553 (exportedLibrary as LibraryElementImpl).appendTo(builder); |
| 4338 } | 4554 } |
| 4339 | 4555 |
| 4556 @override |
| 4340 String get identifier => exportedLibrary.name; | 4557 String get identifier => exportedLibrary.name; |
| 4341 } | 4558 } |
| 4342 | 4559 |
| 4343 /** | 4560 /** |
| 4344 * Instances of the class `ExternalHtmlScriptElementImpl` implement an | 4561 * Instances of the class `ExternalHtmlScriptElementImpl` implement an |
| 4345 * [ExternalHtmlScriptElement]. | 4562 * [ExternalHtmlScriptElement]. |
| 4346 */ | 4563 */ |
| 4347 class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements Ext
ernalHtmlScriptElement { | 4564 class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements Ext
ernalHtmlScriptElement { |
| 4348 /** | 4565 /** |
| 4349 * The source specified in the `source` attribute or `null` if unspecified. | 4566 * The source specified in the `source` attribute or `null` if unspecified. |
| 4350 */ | 4567 */ |
| 4351 Source scriptSource; | 4568 Source scriptSource; |
| 4352 | 4569 |
| 4353 /** | 4570 /** |
| 4354 * Initialize a newly created script element to have the specified tag name an
d offset. | 4571 * Initialize a newly created script element to have the specified tag name an
d offset. |
| 4355 * | 4572 * |
| 4356 * @param node the XML node from which this element is derived (not `null`) | 4573 * @param node the XML node from which this element is derived (not `null`) |
| 4357 */ | 4574 */ |
| 4358 ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node); | 4575 ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node); |
| 4359 | 4576 |
| 4577 @override |
| 4360 accept(ElementVisitor visitor) => visitor.visitExternalHtmlScriptElement(this)
; | 4578 accept(ElementVisitor visitor) => visitor.visitExternalHtmlScriptElement(this)
; |
| 4361 | 4579 |
| 4580 @override |
| 4362 ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT; | 4581 ElementKind get kind => ElementKind.EXTERNAL_HTML_SCRIPT; |
| 4363 } | 4582 } |
| 4364 | 4583 |
| 4365 /** | 4584 /** |
| 4366 * Instances of the class `FieldElementImpl` implement a `FieldElement`. | 4585 * Instances of the class `FieldElementImpl` implement a `FieldElement`. |
| 4367 */ | 4586 */ |
| 4368 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme
nt { | 4587 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme
nt { |
| 4369 /** | 4588 /** |
| 4370 * An empty array of field elements. | 4589 * An empty array of field elements. |
| 4371 */ | 4590 */ |
| 4372 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0); | 4591 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0); |
| 4373 | 4592 |
| 4374 /** | 4593 /** |
| 4375 * Initialize a newly created field element to have the given name. | 4594 * Initialize a newly created field element to have the given name. |
| 4376 * | 4595 * |
| 4377 * @param name the name of this element | 4596 * @param name the name of this element |
| 4378 */ | 4597 */ |
| 4379 FieldElementImpl.con1(Identifier name) : super.con1(name); | 4598 FieldElementImpl.con1(Identifier name) : super.con1(name); |
| 4380 | 4599 |
| 4381 /** | 4600 /** |
| 4382 * Initialize a newly created synthetic field element to have the given name. | 4601 * Initialize a newly created synthetic field element to have the given name. |
| 4383 * | 4602 * |
| 4384 * @param name the name of this element | 4603 * @param name the name of this element |
| 4385 */ | 4604 */ |
| 4386 FieldElementImpl.con2(String name) : super.con2(name); | 4605 FieldElementImpl.con2(String name) : super.con2(name); |
| 4387 | 4606 |
| 4607 @override |
| 4388 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 4608 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 4389 | 4609 |
| 4610 @override |
| 4390 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 4611 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 4391 | 4612 |
| 4613 @override |
| 4392 ElementKind get kind => ElementKind.FIELD; | 4614 ElementKind get kind => ElementKind.FIELD; |
| 4393 | 4615 |
| 4616 @override |
| 4394 bool get isStatic => hasModifier(Modifier.STATIC); | 4617 bool get isStatic => hasModifier(Modifier.STATIC); |
| 4395 | 4618 |
| 4396 /** | 4619 /** |
| 4397 * Set whether this field is static to correspond to the given value. | 4620 * Set whether this field is static to correspond to the given value. |
| 4398 * | 4621 * |
| 4399 * @param isStatic `true` if the field is static | 4622 * @param isStatic `true` if the field is static |
| 4400 */ | 4623 */ |
| 4401 void set static(bool isStatic) { | 4624 void set static(bool isStatic) { |
| 4402 setModifier(Modifier.STATIC, isStatic); | 4625 setModifier(Modifier.STATIC, isStatic); |
| 4403 } | 4626 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4414 */ | 4637 */ |
| 4415 FieldElement field; | 4638 FieldElement field; |
| 4416 | 4639 |
| 4417 /** | 4640 /** |
| 4418 * Initialize a newly created parameter element to have the given name. | 4641 * Initialize a newly created parameter element to have the given name. |
| 4419 * | 4642 * |
| 4420 * @param name the name of this element | 4643 * @param name the name of this element |
| 4421 */ | 4644 */ |
| 4422 FieldFormalParameterElementImpl(Identifier name) : super.con1(name); | 4645 FieldFormalParameterElementImpl(Identifier name) : super.con1(name); |
| 4423 | 4646 |
| 4647 @override |
| 4424 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); | 4648 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); |
| 4425 | 4649 |
| 4650 @override |
| 4426 bool get isInitializingFormal => true; | 4651 bool get isInitializingFormal => true; |
| 4427 } | 4652 } |
| 4428 | 4653 |
| 4429 /** | 4654 /** |
| 4430 * Instances of the class `FunctionElementImpl` implement a `FunctionElement`. | 4655 * Instances of the class `FunctionElementImpl` implement a `FunctionElement`. |
| 4431 */ | 4656 */ |
| 4432 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme
nt { | 4657 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme
nt { |
| 4433 /** | 4658 /** |
| 4434 * The offset to the beginning of the visible range for this element. | 4659 * The offset to the beginning of the visible range for this element. |
| 4435 */ | 4660 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4455 | 4680 |
| 4456 /** | 4681 /** |
| 4457 * Initialize a newly created function element to have no name and the given o
ffset. This is used | 4682 * Initialize a newly created function element to have no name and the given o
ffset. This is used |
| 4458 * for function expressions, which have no name. | 4683 * for function expressions, which have no name. |
| 4459 * | 4684 * |
| 4460 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 4685 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 4461 * declaration of this element | 4686 * declaration of this element |
| 4462 */ | 4687 */ |
| 4463 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset); | 4688 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset); |
| 4464 | 4689 |
| 4690 @override |
| 4465 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); | 4691 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); |
| 4466 | 4692 |
| 4693 @override |
| 4467 ElementKind get kind => ElementKind.FUNCTION; | 4694 ElementKind get kind => ElementKind.FUNCTION; |
| 4468 | 4695 |
| 4696 @override |
| 4469 FunctionDeclaration get node => getNodeMatching((node) => node is FunctionDecl
aration); | 4697 FunctionDeclaration get node => getNodeMatching((node) => node is FunctionDecl
aration); |
| 4470 | 4698 |
| 4699 @override |
| 4471 SourceRange get visibleRange { | 4700 SourceRange get visibleRange { |
| 4472 if (_visibleRangeLength < 0) { | 4701 if (_visibleRangeLength < 0) { |
| 4473 return null; | 4702 return null; |
| 4474 } | 4703 } |
| 4475 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 4704 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 4476 } | 4705 } |
| 4477 | 4706 |
| 4707 @override |
| 4478 bool get isStatic => enclosingElement is CompilationUnitElement; | 4708 bool get isStatic => enclosingElement is CompilationUnitElement; |
| 4479 | 4709 |
| 4480 /** | 4710 /** |
| 4481 * Set the visible range for this element to the range starting at the given o
ffset with the given | 4711 * Set the visible range for this element to the range starting at the given o
ffset with the given |
| 4482 * length. | 4712 * length. |
| 4483 * | 4713 * |
| 4484 * @param offset the offset to the beginning of the visible range for this ele
ment | 4714 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 4485 * @param length the length of the visible range for this element, or `-1` if
this element | 4715 * @param length the length of the visible range for this element, or `-1` if
this element |
| 4486 * does not have a visible range | 4716 * does not have a visible range |
| 4487 */ | 4717 */ |
| 4488 void setVisibleRange(int offset, int length) { | 4718 void setVisibleRange(int offset, int length) { |
| 4489 _visibleRangeOffset = offset; | 4719 _visibleRangeOffset = offset; |
| 4490 _visibleRangeLength = length; | 4720 _visibleRangeLength = length; |
| 4491 } | 4721 } |
| 4492 | 4722 |
| 4723 @override |
| 4493 void appendTo(JavaStringBuilder builder) { | 4724 void appendTo(JavaStringBuilder builder) { |
| 4494 String name = displayName; | 4725 String name = displayName; |
| 4495 if (name != null) { | 4726 if (name != null) { |
| 4496 builder.append(name); | 4727 builder.append(name); |
| 4497 } | 4728 } |
| 4498 super.appendTo(builder); | 4729 super.appendTo(builder); |
| 4499 } | 4730 } |
| 4500 | 4731 |
| 4732 @override |
| 4501 String get identifier => "${name}@${nameOffset}"; | 4733 String get identifier => "${name}@${nameOffset}"; |
| 4502 } | 4734 } |
| 4503 | 4735 |
| 4504 /** | 4736 /** |
| 4505 * Instances of the class `FunctionTypeAliasElementImpl` implement a | 4737 * Instances of the class `FunctionTypeAliasElementImpl` implement a |
| 4506 * `FunctionTypeAliasElement`. | 4738 * `FunctionTypeAliasElement`. |
| 4507 */ | 4739 */ |
| 4508 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl
iasElement { | 4740 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl
iasElement { |
| 4509 /** | 4741 /** |
| 4510 * An array containing all of the parameters defined by this type alias. | 4742 * An array containing all of the parameters defined by this type alias. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 4531 */ | 4763 */ |
| 4532 static List<FunctionTypeAliasElement> EMPTY_ARRAY = new List<FunctionTypeAlias
Element>(0); | 4764 static List<FunctionTypeAliasElement> EMPTY_ARRAY = new List<FunctionTypeAlias
Element>(0); |
| 4533 | 4765 |
| 4534 /** | 4766 /** |
| 4535 * Initialize a newly created type alias element to have the given name. | 4767 * Initialize a newly created type alias element to have the given name. |
| 4536 * | 4768 * |
| 4537 * @param name the name of this element | 4769 * @param name the name of this element |
| 4538 */ | 4770 */ |
| 4539 FunctionTypeAliasElementImpl(Identifier name) : super.forNode(name); | 4771 FunctionTypeAliasElementImpl(Identifier name) : super.forNode(name); |
| 4540 | 4772 |
| 4773 @override |
| 4541 accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this); | 4774 accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this); |
| 4542 | 4775 |
| 4776 @override |
| 4543 ElementImpl getChild(String identifier) { | 4777 ElementImpl getChild(String identifier) { |
| 4544 for (VariableElement parameter in _parameters) { | 4778 for (VariableElement parameter in _parameters) { |
| 4545 if ((parameter as VariableElementImpl).identifier == identifier) { | 4779 if ((parameter as VariableElementImpl).identifier == identifier) { |
| 4546 return parameter as VariableElementImpl; | 4780 return parameter as VariableElementImpl; |
| 4547 } | 4781 } |
| 4548 } | 4782 } |
| 4549 for (TypeParameterElement typeParameter in _typeParameters) { | 4783 for (TypeParameterElement typeParameter in _typeParameters) { |
| 4550 if ((typeParameter as TypeParameterElementImpl).identifier == identifier)
{ | 4784 if ((typeParameter as TypeParameterElementImpl).identifier == identifier)
{ |
| 4551 return typeParameter as TypeParameterElementImpl; | 4785 return typeParameter as TypeParameterElementImpl; |
| 4552 } | 4786 } |
| 4553 } | 4787 } |
| 4554 return null; | 4788 return null; |
| 4555 } | 4789 } |
| 4556 | 4790 |
| 4791 @override |
| 4557 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi
lationUnitElement; | 4792 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi
lationUnitElement; |
| 4558 | 4793 |
| 4794 @override |
| 4559 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS; | 4795 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS; |
| 4560 | 4796 |
| 4797 @override |
| 4561 FunctionTypeAlias get node => getNodeMatching((node) => node is FunctionTypeAl
ias); | 4798 FunctionTypeAlias get node => getNodeMatching((node) => node is FunctionTypeAl
ias); |
| 4562 | 4799 |
| 4800 @override |
| 4563 List<ParameterElement> get parameters => _parameters; | 4801 List<ParameterElement> get parameters => _parameters; |
| 4564 | 4802 |
| 4803 @override |
| 4565 List<TypeParameterElement> get typeParameters => _typeParameters; | 4804 List<TypeParameterElement> get typeParameters => _typeParameters; |
| 4566 | 4805 |
| 4567 /** | 4806 /** |
| 4568 * Set the parameters defined by this type alias to the given parameters. | 4807 * Set the parameters defined by this type alias to the given parameters. |
| 4569 * | 4808 * |
| 4570 * @param parameters the parameters defined by this type alias | 4809 * @param parameters the parameters defined by this type alias |
| 4571 */ | 4810 */ |
| 4572 void set parameters(List<ParameterElement> parameters) { | 4811 void set parameters(List<ParameterElement> parameters) { |
| 4573 if (parameters != null) { | 4812 if (parameters != null) { |
| 4574 for (ParameterElement parameter in parameters) { | 4813 for (ParameterElement parameter in parameters) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 4605 * Set the type parameters defined for this type to the given parameters witho
ut becoming the | 4844 * Set the type parameters defined for this type to the given parameters witho
ut becoming the |
| 4606 * parent of the parameters. This should only be used by the [TypeResolverVisi
tor] when | 4845 * parent of the parameters. This should only be used by the [TypeResolverVisi
tor] when |
| 4607 * creating a synthetic type alias. | 4846 * creating a synthetic type alias. |
| 4608 * | 4847 * |
| 4609 * @param typeParameters the type parameters defined for this type | 4848 * @param typeParameters the type parameters defined for this type |
| 4610 */ | 4849 */ |
| 4611 void shareTypeParameters(List<TypeParameterElement> typeParameters) { | 4850 void shareTypeParameters(List<TypeParameterElement> typeParameters) { |
| 4612 this._typeParameters = typeParameters; | 4851 this._typeParameters = typeParameters; |
| 4613 } | 4852 } |
| 4614 | 4853 |
| 4854 @override |
| 4615 void visitChildren(ElementVisitor visitor) { | 4855 void visitChildren(ElementVisitor visitor) { |
| 4616 super.visitChildren(visitor); | 4856 super.visitChildren(visitor); |
| 4617 safelyVisitChildren(_parameters, visitor); | 4857 safelyVisitChildren(_parameters, visitor); |
| 4618 safelyVisitChildren(_typeParameters, visitor); | 4858 safelyVisitChildren(_typeParameters, visitor); |
| 4619 } | 4859 } |
| 4620 | 4860 |
| 4861 @override |
| 4621 void appendTo(JavaStringBuilder builder) { | 4862 void appendTo(JavaStringBuilder builder) { |
| 4622 builder.append("typedef "); | 4863 builder.append("typedef "); |
| 4623 builder.append(displayName); | 4864 builder.append(displayName); |
| 4624 int typeParameterCount = _typeParameters.length; | 4865 int typeParameterCount = _typeParameters.length; |
| 4625 if (typeParameterCount > 0) { | 4866 if (typeParameterCount > 0) { |
| 4626 builder.append("<"); | 4867 builder.append("<"); |
| 4627 for (int i = 0; i < typeParameterCount; i++) { | 4868 for (int i = 0; i < typeParameterCount; i++) { |
| 4628 if (i > 0) { | 4869 if (i > 0) { |
| 4629 builder.append(", "); | 4870 builder.append(", "); |
| 4630 } | 4871 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 4652 * Instances of the class `HideElementCombinatorImpl` implement a | 4893 * Instances of the class `HideElementCombinatorImpl` implement a |
| 4653 * [HideElementCombinator]. | 4894 * [HideElementCombinator]. |
| 4654 */ | 4895 */ |
| 4655 class HideElementCombinatorImpl implements HideElementCombinator { | 4896 class HideElementCombinatorImpl implements HideElementCombinator { |
| 4656 /** | 4897 /** |
| 4657 * The names that are not to be made visible in the importing library even if
they are defined in | 4898 * The names that are not to be made visible in the importing library even if
they are defined in |
| 4658 * the imported library. | 4899 * the imported library. |
| 4659 */ | 4900 */ |
| 4660 List<String> hiddenNames = StringUtilities.EMPTY_ARRAY; | 4901 List<String> hiddenNames = StringUtilities.EMPTY_ARRAY; |
| 4661 | 4902 |
| 4903 @override |
| 4662 String toString() { | 4904 String toString() { |
| 4663 JavaStringBuilder builder = new JavaStringBuilder(); | 4905 JavaStringBuilder builder = new JavaStringBuilder(); |
| 4664 builder.append("show "); | 4906 builder.append("show "); |
| 4665 int count = hiddenNames.length; | 4907 int count = hiddenNames.length; |
| 4666 for (int i = 0; i < count; i++) { | 4908 for (int i = 0; i < count; i++) { |
| 4667 if (i > 0) { | 4909 if (i > 0) { |
| 4668 builder.append(", "); | 4910 builder.append(", "); |
| 4669 } | 4911 } |
| 4670 builder.append(hiddenNames[i]); | 4912 builder.append(hiddenNames[i]); |
| 4671 } | 4913 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4704 CompilationUnitElement angularCompilationUnit; | 4946 CompilationUnitElement angularCompilationUnit; |
| 4705 | 4947 |
| 4706 /** | 4948 /** |
| 4707 * Initialize a newly created HTML element to have the given name. | 4949 * Initialize a newly created HTML element to have the given name. |
| 4708 * | 4950 * |
| 4709 * @param context the analysis context in which the HTML file is defined | 4951 * @param context the analysis context in which the HTML file is defined |
| 4710 * @param name the name of this element | 4952 * @param name the name of this element |
| 4711 */ | 4953 */ |
| 4712 HtmlElementImpl(this.context, String name) : super(name, -1); | 4954 HtmlElementImpl(this.context, String name) : super(name, -1); |
| 4713 | 4955 |
| 4956 @override |
| 4714 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this); | 4957 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this); |
| 4715 | 4958 |
| 4959 @override |
| 4716 bool operator ==(Object object) { | 4960 bool operator ==(Object object) { |
| 4717 if (identical(object, this)) { | 4961 if (identical(object, this)) { |
| 4718 return true; | 4962 return true; |
| 4719 } | 4963 } |
| 4720 if (object == null) { | 4964 if (object == null) { |
| 4721 return false; | 4965 return false; |
| 4722 } | 4966 } |
| 4723 return runtimeType == object.runtimeType && source == (object as HtmlElement
Impl).source; | 4967 return runtimeType == object.runtimeType && source == (object as HtmlElement
Impl).source; |
| 4724 } | 4968 } |
| 4725 | 4969 |
| 4970 @override |
| 4726 ElementKind get kind => ElementKind.HTML; | 4971 ElementKind get kind => ElementKind.HTML; |
| 4727 | 4972 |
| 4973 @override |
| 4728 List<HtmlScriptElement> get scripts => _scripts; | 4974 List<HtmlScriptElement> get scripts => _scripts; |
| 4729 | 4975 |
| 4976 @override |
| 4730 int get hashCode => source.hashCode; | 4977 int get hashCode => source.hashCode; |
| 4731 | 4978 |
| 4732 /** | 4979 /** |
| 4733 * Set the scripts contained in the HTML file to the given scripts. | 4980 * Set the scripts contained in the HTML file to the given scripts. |
| 4734 * | 4981 * |
| 4735 * @param scripts the scripts | 4982 * @param scripts the scripts |
| 4736 */ | 4983 */ |
| 4737 void set scripts(List<HtmlScriptElement> scripts) { | 4984 void set scripts(List<HtmlScriptElement> scripts) { |
| 4738 if (scripts.length == 0) { | 4985 if (scripts.length == 0) { |
| 4739 scripts = HtmlScriptElementImpl.EMPTY_ARRAY; | 4986 scripts = HtmlScriptElementImpl.EMPTY_ARRAY; |
| 4740 } | 4987 } |
| 4741 for (HtmlScriptElement script in scripts) { | 4988 for (HtmlScriptElement script in scripts) { |
| 4742 (script as HtmlScriptElementImpl).enclosingElement = this; | 4989 (script as HtmlScriptElementImpl).enclosingElement = this; |
| 4743 } | 4990 } |
| 4744 this._scripts = scripts; | 4991 this._scripts = scripts; |
| 4745 } | 4992 } |
| 4746 | 4993 |
| 4994 @override |
| 4747 void visitChildren(ElementVisitor visitor) { | 4995 void visitChildren(ElementVisitor visitor) { |
| 4748 super.visitChildren(visitor); | 4996 super.visitChildren(visitor); |
| 4749 safelyVisitChildren(_scripts, visitor); | 4997 safelyVisitChildren(_scripts, visitor); |
| 4750 } | 4998 } |
| 4751 | 4999 |
| 5000 @override |
| 4752 void appendTo(JavaStringBuilder builder) { | 5001 void appendTo(JavaStringBuilder builder) { |
| 4753 if (source == null) { | 5002 if (source == null) { |
| 4754 builder.append("{HTML file}"); | 5003 builder.append("{HTML file}"); |
| 4755 } else { | 5004 } else { |
| 4756 builder.append(source.fullName); | 5005 builder.append(source.fullName); |
| 4757 } | 5006 } |
| 4758 } | 5007 } |
| 4759 } | 5008 } |
| 4760 | 5009 |
| 4761 /** | 5010 /** |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4813 */ | 5062 */ |
| 4814 PrefixElement prefix; | 5063 PrefixElement prefix; |
| 4815 | 5064 |
| 4816 /** | 5065 /** |
| 4817 * Initialize a newly created import element. | 5066 * Initialize a newly created import element. |
| 4818 * | 5067 * |
| 4819 * @param offset the directive offset, may be `-1` if synthetic. | 5068 * @param offset the directive offset, may be `-1` if synthetic. |
| 4820 */ | 5069 */ |
| 4821 ImportElementImpl(int offset) : super(null, offset); | 5070 ImportElementImpl(int offset) : super(null, offset); |
| 4822 | 5071 |
| 5072 @override |
| 4823 accept(ElementVisitor visitor) => visitor.visitImportElement(this); | 5073 accept(ElementVisitor visitor) => visitor.visitImportElement(this); |
| 4824 | 5074 |
| 5075 @override |
| 4825 ElementKind get kind => ElementKind.IMPORT; | 5076 ElementKind get kind => ElementKind.IMPORT; |
| 4826 | 5077 |
| 5078 @override |
| 4827 void visitChildren(ElementVisitor visitor) { | 5079 void visitChildren(ElementVisitor visitor) { |
| 4828 super.visitChildren(visitor); | 5080 super.visitChildren(visitor); |
| 4829 safelyVisitChild(prefix, visitor); | 5081 safelyVisitChild(prefix, visitor); |
| 4830 } | 5082 } |
| 4831 | 5083 |
| 5084 @override |
| 4832 void appendTo(JavaStringBuilder builder) { | 5085 void appendTo(JavaStringBuilder builder) { |
| 4833 builder.append("import "); | 5086 builder.append("import "); |
| 4834 (importedLibrary as LibraryElementImpl).appendTo(builder); | 5087 (importedLibrary as LibraryElementImpl).appendTo(builder); |
| 4835 } | 5088 } |
| 4836 | 5089 |
| 5090 @override |
| 4837 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier
}@${nameOffset}"; | 5091 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier
}@${nameOffset}"; |
| 4838 } | 5092 } |
| 4839 | 5093 |
| 4840 /** | 5094 /** |
| 4841 * Instances of the class `LabelElementImpl` implement a `LabelElement`. | 5095 * Instances of the class `LabelElementImpl` implement a `LabelElement`. |
| 4842 */ | 5096 */ |
| 4843 class LabelElementImpl extends ElementImpl implements LabelElement { | 5097 class LabelElementImpl extends ElementImpl implements LabelElement { |
| 4844 /** | 5098 /** |
| 4845 * A flag indicating whether this label is associated with a `switch` statemen
t. | 5099 * A flag indicating whether this label is associated with a `switch` statemen
t. |
| 4846 */ | 5100 */ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4863 * @param name the name of this element | 5117 * @param name the name of this element |
| 4864 * @param onSwitchStatement `true` if this label is associated with a `switch` | 5118 * @param onSwitchStatement `true` if this label is associated with a `switch` |
| 4865 * statement | 5119 * statement |
| 4866 * @param onSwitchMember `true` if this label is associated with a `switch` me
mber | 5120 * @param onSwitchMember `true` if this label is associated with a `switch` me
mber |
| 4867 */ | 5121 */ |
| 4868 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember)
: super.forNode(name) { | 5122 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember)
: super.forNode(name) { |
| 4869 this._onSwitchStatement = onSwitchStatement; | 5123 this._onSwitchStatement = onSwitchStatement; |
| 4870 this._onSwitchMember = onSwitchMember; | 5124 this._onSwitchMember = onSwitchMember; |
| 4871 } | 5125 } |
| 4872 | 5126 |
| 5127 @override |
| 4873 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); | 5128 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); |
| 4874 | 5129 |
| 5130 @override |
| 4875 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; | 5131 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; |
| 4876 | 5132 |
| 5133 @override |
| 4877 ElementKind get kind => ElementKind.LABEL; | 5134 ElementKind get kind => ElementKind.LABEL; |
| 4878 | 5135 |
| 4879 /** | 5136 /** |
| 4880 * Return `true` if this label is associated with a `switch` member (`case` or | 5137 * Return `true` if this label is associated with a `switch` member (`case` or |
| 4881 * `default`). | 5138 * `default`). |
| 4882 * | 5139 * |
| 4883 * @return `true` if this label is associated with a `switch` member | 5140 * @return `true` if this label is associated with a `switch` member |
| 4884 */ | 5141 */ |
| 4885 bool get isOnSwitchMember => _onSwitchMember; | 5142 bool get isOnSwitchMember => _onSwitchMember; |
| 4886 | 5143 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4975 bool _isAngularHtml = false; | 5232 bool _isAngularHtml = false; |
| 4976 | 5233 |
| 4977 /** | 5234 /** |
| 4978 * Initialize a newly created library element to have the given name. | 5235 * Initialize a newly created library element to have the given name. |
| 4979 * | 5236 * |
| 4980 * @param context the analysis context in which the library is defined | 5237 * @param context the analysis context in which the library is defined |
| 4981 * @param name the name of this element | 5238 * @param name the name of this element |
| 4982 */ | 5239 */ |
| 4983 LibraryElementImpl(this.context, LibraryIdentifier name) : super.forNode(name)
; | 5240 LibraryElementImpl(this.context, LibraryIdentifier name) : super.forNode(name)
; |
| 4984 | 5241 |
| 5242 @override |
| 4985 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); | 5243 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); |
| 4986 | 5244 |
| 5245 @override |
| 4987 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC
ompilationUnit; | 5246 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC
ompilationUnit; |
| 4988 | 5247 |
| 5248 @override |
| 4989 ElementImpl getChild(String identifier) { | 5249 ElementImpl getChild(String identifier) { |
| 4990 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i
dentifier) { | 5250 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i
dentifier) { |
| 4991 return _definingCompilationUnit as CompilationUnitElementImpl; | 5251 return _definingCompilationUnit as CompilationUnitElementImpl; |
| 4992 } | 5252 } |
| 4993 for (CompilationUnitElement part in _parts) { | 5253 for (CompilationUnitElement part in _parts) { |
| 4994 if ((part as CompilationUnitElementImpl).identifier == identifier) { | 5254 if ((part as CompilationUnitElementImpl).identifier == identifier) { |
| 4995 return part as CompilationUnitElementImpl; | 5255 return part as CompilationUnitElementImpl; |
| 4996 } | 5256 } |
| 4997 } | 5257 } |
| 4998 for (ImportElement importElement in _imports) { | 5258 for (ImportElement importElement in _imports) { |
| 4999 if ((importElement as ImportElementImpl).identifier == identifier) { | 5259 if ((importElement as ImportElementImpl).identifier == identifier) { |
| 5000 return importElement as ImportElementImpl; | 5260 return importElement as ImportElementImpl; |
| 5001 } | 5261 } |
| 5002 } | 5262 } |
| 5003 for (ExportElement exportElement in _exports) { | 5263 for (ExportElement exportElement in _exports) { |
| 5004 if ((exportElement as ExportElementImpl).identifier == identifier) { | 5264 if ((exportElement as ExportElementImpl).identifier == identifier) { |
| 5005 return exportElement as ExportElementImpl; | 5265 return exportElement as ExportElementImpl; |
| 5006 } | 5266 } |
| 5007 } | 5267 } |
| 5008 return null; | 5268 return null; |
| 5009 } | 5269 } |
| 5010 | 5270 |
| 5271 @override |
| 5011 CompilationUnitElement get definingCompilationUnit => _definingCompilationUnit
; | 5272 CompilationUnitElement get definingCompilationUnit => _definingCompilationUnit
; |
| 5012 | 5273 |
| 5274 @override |
| 5013 List<LibraryElement> get exportedLibraries { | 5275 List<LibraryElement> get exportedLibraries { |
| 5014 Set<LibraryElement> libraries = new Set<LibraryElement>(); | 5276 Set<LibraryElement> libraries = new Set<LibraryElement>(); |
| 5015 for (ExportElement element in _exports) { | 5277 for (ExportElement element in _exports) { |
| 5016 LibraryElement library = element.exportedLibrary; | 5278 LibraryElement library = element.exportedLibrary; |
| 5017 if (library != null) { | 5279 if (library != null) { |
| 5018 libraries.add(library); | 5280 libraries.add(library); |
| 5019 } | 5281 } |
| 5020 } | 5282 } |
| 5021 return new List.from(libraries); | 5283 return new List.from(libraries); |
| 5022 } | 5284 } |
| 5023 | 5285 |
| 5286 @override |
| 5024 List<ExportElement> get exports => _exports; | 5287 List<ExportElement> get exports => _exports; |
| 5025 | 5288 |
| 5289 @override |
| 5026 List<LibraryElement> get importedLibraries { | 5290 List<LibraryElement> get importedLibraries { |
| 5027 Set<LibraryElement> libraries = new Set<LibraryElement>(); | 5291 Set<LibraryElement> libraries = new Set<LibraryElement>(); |
| 5028 for (ImportElement element in _imports) { | 5292 for (ImportElement element in _imports) { |
| 5029 LibraryElement library = element.importedLibrary; | 5293 LibraryElement library = element.importedLibrary; |
| 5030 if (library != null) { | 5294 if (library != null) { |
| 5031 libraries.add(library); | 5295 libraries.add(library); |
| 5032 } | 5296 } |
| 5033 } | 5297 } |
| 5034 return new List.from(libraries); | 5298 return new List.from(libraries); |
| 5035 } | 5299 } |
| 5036 | 5300 |
| 5301 @override |
| 5037 List<ImportElement> get imports => _imports; | 5302 List<ImportElement> get imports => _imports; |
| 5038 | 5303 |
| 5304 @override |
| 5039 ElementKind get kind => ElementKind.LIBRARY; | 5305 ElementKind get kind => ElementKind.LIBRARY; |
| 5040 | 5306 |
| 5307 @override |
| 5041 LibraryElement get library => this; | 5308 LibraryElement get library => this; |
| 5042 | 5309 |
| 5310 @override |
| 5043 List<CompilationUnitElement> get parts => _parts; | 5311 List<CompilationUnitElement> get parts => _parts; |
| 5044 | 5312 |
| 5313 @override |
| 5045 List<PrefixElement> get prefixes { | 5314 List<PrefixElement> get prefixes { |
| 5046 Set<PrefixElement> prefixes = new Set<PrefixElement>(); | 5315 Set<PrefixElement> prefixes = new Set<PrefixElement>(); |
| 5047 for (ImportElement element in _imports) { | 5316 for (ImportElement element in _imports) { |
| 5048 PrefixElement prefix = element.prefix; | 5317 PrefixElement prefix = element.prefix; |
| 5049 if (prefix != null) { | 5318 if (prefix != null) { |
| 5050 prefixes.add(prefix); | 5319 prefixes.add(prefix); |
| 5051 } | 5320 } |
| 5052 } | 5321 } |
| 5053 return new List.from(prefixes); | 5322 return new List.from(prefixes); |
| 5054 } | 5323 } |
| 5055 | 5324 |
| 5325 @override |
| 5056 Source get source { | 5326 Source get source { |
| 5057 if (_definingCompilationUnit == null) { | 5327 if (_definingCompilationUnit == null) { |
| 5058 return null; | 5328 return null; |
| 5059 } | 5329 } |
| 5060 return _definingCompilationUnit.source; | 5330 return _definingCompilationUnit.source; |
| 5061 } | 5331 } |
| 5062 | 5332 |
| 5333 @override |
| 5063 ClassElement getType(String className) { | 5334 ClassElement getType(String className) { |
| 5064 ClassElement type = _definingCompilationUnit.getType(className); | 5335 ClassElement type = _definingCompilationUnit.getType(className); |
| 5065 if (type != null) { | 5336 if (type != null) { |
| 5066 return type; | 5337 return type; |
| 5067 } | 5338 } |
| 5068 for (CompilationUnitElement part in _parts) { | 5339 for (CompilationUnitElement part in _parts) { |
| 5069 type = part.getType(className); | 5340 type = part.getType(className); |
| 5070 if (type != null) { | 5341 if (type != null) { |
| 5071 return type; | 5342 return type; |
| 5072 } | 5343 } |
| 5073 } | 5344 } |
| 5074 return null; | 5345 return null; |
| 5075 } | 5346 } |
| 5076 | 5347 |
| 5348 @override |
| 5077 List<CompilationUnitElement> get units { | 5349 List<CompilationUnitElement> get units { |
| 5078 List<CompilationUnitElement> units = new List<CompilationUnitElement>(1 + _p
arts.length); | 5350 List<CompilationUnitElement> units = new List<CompilationUnitElement>(1 + _p
arts.length); |
| 5079 units[0] = _definingCompilationUnit; | 5351 units[0] = _definingCompilationUnit; |
| 5080 JavaSystem.arraycopy(_parts, 0, units, 1, _parts.length); | 5352 JavaSystem.arraycopy(_parts, 0, units, 1, _parts.length); |
| 5081 return units; | 5353 return units; |
| 5082 } | 5354 } |
| 5083 | 5355 |
| 5356 @override |
| 5084 List<LibraryElement> get visibleLibraries { | 5357 List<LibraryElement> get visibleLibraries { |
| 5085 Set<LibraryElement> visibleLibraries = new Set(); | 5358 Set<LibraryElement> visibleLibraries = new Set(); |
| 5086 _addVisibleLibraries(visibleLibraries, false); | 5359 _addVisibleLibraries(visibleLibraries, false); |
| 5087 return new List.from(visibleLibraries); | 5360 return new List.from(visibleLibraries); |
| 5088 } | 5361 } |
| 5089 | 5362 |
| 5363 @override |
| 5090 bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI); | 5364 bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI); |
| 5091 | 5365 |
| 5366 @override |
| 5092 int get hashCode => _definingCompilationUnit.hashCode; | 5367 int get hashCode => _definingCompilationUnit.hashCode; |
| 5093 | 5368 |
| 5369 @override |
| 5094 bool get isAngularHtml => _isAngularHtml; | 5370 bool get isAngularHtml => _isAngularHtml; |
| 5095 | 5371 |
| 5372 @override |
| 5096 bool get isBrowserApplication => entryPoint != null && isOrImportsBrowserLibra
ry; | 5373 bool get isBrowserApplication => entryPoint != null && isOrImportsBrowserLibra
ry; |
| 5097 | 5374 |
| 5375 @override |
| 5098 bool get isDartCore => name == "dart.core"; | 5376 bool get isDartCore => name == "dart.core"; |
| 5099 | 5377 |
| 5378 @override |
| 5100 bool get isInSdk => StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x7
4, 0x2E); | 5379 bool get isInSdk => StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x7
4, 0x2E); |
| 5101 | 5380 |
| 5381 @override |
| 5102 bool isUpToDate(int timeStamp) { | 5382 bool isUpToDate(int timeStamp) { |
| 5103 Set<LibraryElement> visitedLibraries = new Set(); | 5383 Set<LibraryElement> visitedLibraries = new Set(); |
| 5104 return _safeIsUpToDate(this, timeStamp, visitedLibraries); | 5384 return _safeIsUpToDate(this, timeStamp, visitedLibraries); |
| 5105 } | 5385 } |
| 5106 | 5386 |
| 5107 /** | 5387 /** |
| 5108 * Specifies if this library is created for Angular analysis. | 5388 * Specifies if this library is created for Angular analysis. |
| 5109 */ | 5389 */ |
| 5110 void set angularHtml(bool isAngularHtml) { | 5390 void set angularHtml(bool isAngularHtml) { |
| 5111 this._isAngularHtml = isAngularHtml; | 5391 this._isAngularHtml = isAngularHtml; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5164 * @param parts the compilation units that are included in this library using
a `part` | 5444 * @param parts the compilation units that are included in this library using
a `part` |
| 5165 * directive | 5445 * directive |
| 5166 */ | 5446 */ |
| 5167 void set parts(List<CompilationUnitElement> parts) { | 5447 void set parts(List<CompilationUnitElement> parts) { |
| 5168 for (CompilationUnitElement compilationUnit in parts) { | 5448 for (CompilationUnitElement compilationUnit in parts) { |
| 5169 (compilationUnit as CompilationUnitElementImpl).enclosingElement = this; | 5449 (compilationUnit as CompilationUnitElementImpl).enclosingElement = this; |
| 5170 } | 5450 } |
| 5171 this._parts = parts; | 5451 this._parts = parts; |
| 5172 } | 5452 } |
| 5173 | 5453 |
| 5454 @override |
| 5174 void visitChildren(ElementVisitor visitor) { | 5455 void visitChildren(ElementVisitor visitor) { |
| 5175 super.visitChildren(visitor); | 5456 super.visitChildren(visitor); |
| 5176 safelyVisitChild(_definingCompilationUnit, visitor); | 5457 safelyVisitChild(_definingCompilationUnit, visitor); |
| 5177 safelyVisitChildren(_exports, visitor); | 5458 safelyVisitChildren(_exports, visitor); |
| 5178 safelyVisitChildren(_imports, visitor); | 5459 safelyVisitChildren(_imports, visitor); |
| 5179 safelyVisitChildren(_parts, visitor); | 5460 safelyVisitChildren(_parts, visitor); |
| 5180 } | 5461 } |
| 5181 | 5462 |
| 5463 @override |
| 5182 String get identifier => _definingCompilationUnit.source.encoding; | 5464 String get identifier => _definingCompilationUnit.source.encoding; |
| 5183 | 5465 |
| 5184 /** | 5466 /** |
| 5185 * Recursively fills set of visible libraries for [getVisibleElementsLibraries
]. | 5467 * Recursively fills set of visible libraries for [getVisibleElementsLibraries
]. |
| 5186 */ | 5468 */ |
| 5187 void _addVisibleLibraries(Set<LibraryElement> visibleLibraries, bool includeEx
ports) { | 5469 void _addVisibleLibraries(Set<LibraryElement> visibleLibraries, bool includeEx
ports) { |
| 5188 // maybe already processed | 5470 // maybe already processed |
| 5189 if (!visibleLibraries.add(this)) { | 5471 if (!visibleLibraries.add(this)) { |
| 5190 return; | 5472 return; |
| 5191 } | 5473 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5267 */ | 5549 */ |
| 5268 static List<LocalVariableElement> EMPTY_ARRAY = new List<LocalVariableElement>
(0); | 5550 static List<LocalVariableElement> EMPTY_ARRAY = new List<LocalVariableElement>
(0); |
| 5269 | 5551 |
| 5270 /** | 5552 /** |
| 5271 * Initialize a newly created local variable element to have the given name. | 5553 * Initialize a newly created local variable element to have the given name. |
| 5272 * | 5554 * |
| 5273 * @param name the name of this element | 5555 * @param name the name of this element |
| 5274 */ | 5556 */ |
| 5275 LocalVariableElementImpl(Identifier name) : super.con1(name); | 5557 LocalVariableElementImpl(Identifier name) : super.con1(name); |
| 5276 | 5558 |
| 5559 @override |
| 5277 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this); | 5560 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this); |
| 5278 | 5561 |
| 5562 @override |
| 5279 ElementKind get kind => ElementKind.LOCAL_VARIABLE; | 5563 ElementKind get kind => ElementKind.LOCAL_VARIABLE; |
| 5280 | 5564 |
| 5565 @override |
| 5281 List<ToolkitObjectElement> get toolkitObjects { | 5566 List<ToolkitObjectElement> get toolkitObjects { |
| 5282 CompilationUnitElementImpl unit = getAncestor((element) => element is Compil
ationUnitElementImpl); | 5567 CompilationUnitElementImpl unit = getAncestor((element) => element is Compil
ationUnitElementImpl); |
| 5283 if (unit == null) { | 5568 if (unit == null) { |
| 5284 return ToolkitObjectElement.EMPTY_ARRAY; | 5569 return ToolkitObjectElement.EMPTY_ARRAY; |
| 5285 } | 5570 } |
| 5286 return unit._getToolkitObjects(this); | 5571 return unit._getToolkitObjects(this); |
| 5287 } | 5572 } |
| 5288 | 5573 |
| 5574 @override |
| 5289 SourceRange get visibleRange { | 5575 SourceRange get visibleRange { |
| 5290 if (_visibleRangeLength < 0) { | 5576 if (_visibleRangeLength < 0) { |
| 5291 return null; | 5577 return null; |
| 5292 } | 5578 } |
| 5293 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 5579 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 5294 } | 5580 } |
| 5295 | 5581 |
| 5582 @override |
| 5296 bool get isPotentiallyMutatedInClosure => _potentiallyMutatedInClosure; | 5583 bool get isPotentiallyMutatedInClosure => _potentiallyMutatedInClosure; |
| 5297 | 5584 |
| 5585 @override |
| 5298 bool get isPotentiallyMutatedInScope => _potentiallyMutatedInScope; | 5586 bool get isPotentiallyMutatedInScope => _potentiallyMutatedInScope; |
| 5299 | 5587 |
| 5300 /** | 5588 /** |
| 5301 * Specifies that this variable is potentially mutated somewhere in closure. | 5589 * Specifies that this variable is potentially mutated somewhere in closure. |
| 5302 */ | 5590 */ |
| 5303 void markPotentiallyMutatedInClosure() { | 5591 void markPotentiallyMutatedInClosure() { |
| 5304 _potentiallyMutatedInClosure = true; | 5592 _potentiallyMutatedInClosure = true; |
| 5305 } | 5593 } |
| 5306 | 5594 |
| 5307 /** | 5595 /** |
| (...skipping 22 matching lines...) Expand all Loading... |
| 5330 * | 5618 * |
| 5331 * @param offset the offset to the beginning of the visible range for this ele
ment | 5619 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 5332 * @param length the length of the visible range for this element, or `-1` if
this element | 5620 * @param length the length of the visible range for this element, or `-1` if
this element |
| 5333 * does not have a visible range | 5621 * does not have a visible range |
| 5334 */ | 5622 */ |
| 5335 void setVisibleRange(int offset, int length) { | 5623 void setVisibleRange(int offset, int length) { |
| 5336 _visibleRangeOffset = offset; | 5624 _visibleRangeOffset = offset; |
| 5337 _visibleRangeLength = length; | 5625 _visibleRangeLength = length; |
| 5338 } | 5626 } |
| 5339 | 5627 |
| 5628 @override |
| 5340 void appendTo(JavaStringBuilder builder) { | 5629 void appendTo(JavaStringBuilder builder) { |
| 5341 builder.append(type); | 5630 builder.append(type); |
| 5342 builder.append(" "); | 5631 builder.append(" "); |
| 5343 builder.append(displayName); | 5632 builder.append(displayName); |
| 5344 } | 5633 } |
| 5345 | 5634 |
| 5635 @override |
| 5346 String get identifier => "${super.identifier}@${nameOffset}"; | 5636 String get identifier => "${super.identifier}@${nameOffset}"; |
| 5347 } | 5637 } |
| 5348 | 5638 |
| 5349 /** | 5639 /** |
| 5350 * Instances of the class `MethodElementImpl` implement a `MethodElement`. | 5640 * Instances of the class `MethodElementImpl` implement a `MethodElement`. |
| 5351 */ | 5641 */ |
| 5352 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { | 5642 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { |
| 5353 /** | 5643 /** |
| 5354 * An empty array of method elements. | 5644 * An empty array of method elements. |
| 5355 */ | 5645 */ |
| 5356 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0); | 5646 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0); |
| 5357 | 5647 |
| 5358 /** | 5648 /** |
| 5359 * Initialize a newly created method element to have the given name. | 5649 * Initialize a newly created method element to have the given name. |
| 5360 * | 5650 * |
| 5361 * @param name the name of this element | 5651 * @param name the name of this element |
| 5362 */ | 5652 */ |
| 5363 MethodElementImpl.con1(Identifier name) : super.con1(name); | 5653 MethodElementImpl.con1(Identifier name) : super.con1(name); |
| 5364 | 5654 |
| 5365 /** | 5655 /** |
| 5366 * Initialize a newly created method element to have the given name. | 5656 * Initialize a newly created method element to have the given name. |
| 5367 * | 5657 * |
| 5368 * @param name the name of this element | 5658 * @param name the name of this element |
| 5369 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 5659 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 5370 * declaration of this element | 5660 * declaration of this element |
| 5371 */ | 5661 */ |
| 5372 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set); | 5662 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set); |
| 5373 | 5663 |
| 5664 @override |
| 5374 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 5665 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
| 5375 | 5666 |
| 5667 @override |
| 5376 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 5668 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
| 5377 | 5669 |
| 5670 @override |
| 5378 ElementKind get kind => ElementKind.METHOD; | 5671 ElementKind get kind => ElementKind.METHOD; |
| 5379 | 5672 |
| 5673 @override |
| 5380 String get name { | 5674 String get name { |
| 5381 String name = super.name; | 5675 String name = super.name; |
| 5382 if (isOperator && name == "-") { | 5676 if (isOperator && name == "-") { |
| 5383 if (parameters.length == 0) { | 5677 if (parameters.length == 0) { |
| 5384 return "unary-"; | 5678 return "unary-"; |
| 5385 } | 5679 } |
| 5386 } | 5680 } |
| 5387 return super.name; | 5681 return super.name; |
| 5388 } | 5682 } |
| 5389 | 5683 |
| 5684 @override |
| 5390 MethodDeclaration get node => getNodeMatching((node) => node is MethodDeclarat
ion); | 5685 MethodDeclaration get node => getNodeMatching((node) => node is MethodDeclarat
ion); |
| 5391 | 5686 |
| 5687 @override |
| 5392 bool get isAbstract => hasModifier(Modifier.ABSTRACT); | 5688 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 5393 | 5689 |
| 5690 @override |
| 5394 bool get isOperator { | 5691 bool get isOperator { |
| 5395 String name = displayName; | 5692 String name = displayName; |
| 5396 if (name.isEmpty) { | 5693 if (name.isEmpty) { |
| 5397 return false; | 5694 return false; |
| 5398 } | 5695 } |
| 5399 int first = name.codeUnitAt(0); | 5696 int first = name.codeUnitAt(0); |
| 5400 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A
) || first == 0x5F || first == 0x24); | 5697 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A
) || first == 0x5F || first == 0x24); |
| 5401 } | 5698 } |
| 5402 | 5699 |
| 5700 @override |
| 5403 bool get isStatic => hasModifier(Modifier.STATIC); | 5701 bool get isStatic => hasModifier(Modifier.STATIC); |
| 5404 | 5702 |
| 5405 /** | 5703 /** |
| 5406 * Set whether this method is abstract to correspond to the given value. | 5704 * Set whether this method is abstract to correspond to the given value. |
| 5407 * | 5705 * |
| 5408 * @param isAbstract `true` if the method is abstract | 5706 * @param isAbstract `true` if the method is abstract |
| 5409 */ | 5707 */ |
| 5410 void set abstract(bool isAbstract) { | 5708 void set abstract(bool isAbstract) { |
| 5411 setModifier(Modifier.ABSTRACT, isAbstract); | 5709 setModifier(Modifier.ABSTRACT, isAbstract); |
| 5412 } | 5710 } |
| 5413 | 5711 |
| 5414 /** | 5712 /** |
| 5415 * Set whether this method is static to correspond to the given value. | 5713 * Set whether this method is static to correspond to the given value. |
| 5416 * | 5714 * |
| 5417 * @param isStatic `true` if the method is static | 5715 * @param isStatic `true` if the method is static |
| 5418 */ | 5716 */ |
| 5419 void set static(bool isStatic) { | 5717 void set static(bool isStatic) { |
| 5420 setModifier(Modifier.STATIC, isStatic); | 5718 setModifier(Modifier.STATIC, isStatic); |
| 5421 } | 5719 } |
| 5422 | 5720 |
| 5721 @override |
| 5423 void appendTo(JavaStringBuilder builder) { | 5722 void appendTo(JavaStringBuilder builder) { |
| 5424 builder.append(enclosingElement.displayName); | 5723 builder.append(enclosingElement.displayName); |
| 5425 builder.append("."); | 5724 builder.append("."); |
| 5426 builder.append(displayName); | 5725 builder.append(displayName); |
| 5427 super.appendTo(builder); | 5726 super.appendTo(builder); |
| 5428 } | 5727 } |
| 5429 } | 5728 } |
| 5430 | 5729 |
| 5431 /** | 5730 /** |
| 5432 * The enumeration `Modifier` defines constants for all of the modifiers defined
by the Dart | 5731 * The enumeration `Modifier` defines constants for all of the modifiers defined
by the Dart |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5578 /** | 5877 /** |
| 5579 * Initialize a newly created element to represent a list of conflicting eleme
nts. | 5878 * Initialize a newly created element to represent a list of conflicting eleme
nts. |
| 5580 * | 5879 * |
| 5581 * @param context the analysis context in which the multiply defined elements
are defined | 5880 * @param context the analysis context in which the multiply defined elements
are defined |
| 5582 * @param conflictingElements the elements that conflict | 5881 * @param conflictingElements the elements that conflict |
| 5583 */ | 5882 */ |
| 5584 MultiplyDefinedElementImpl(this.context, this.conflictingElements) { | 5883 MultiplyDefinedElementImpl(this.context, this.conflictingElements) { |
| 5585 _name = conflictingElements[0].name; | 5884 _name = conflictingElements[0].name; |
| 5586 } | 5885 } |
| 5587 | 5886 |
| 5887 @override |
| 5588 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); | 5888 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); |
| 5589 | 5889 |
| 5890 @override |
| 5590 String computeDocumentationComment() => null; | 5891 String computeDocumentationComment() => null; |
| 5591 | 5892 |
| 5893 @override |
| 5592 Element getAncestor(Predicate<Element> predicate) => null; | 5894 Element getAncestor(Predicate<Element> predicate) => null; |
| 5593 | 5895 |
| 5896 @override |
| 5594 String get displayName => _name; | 5897 String get displayName => _name; |
| 5595 | 5898 |
| 5899 @override |
| 5596 Element get enclosingElement => null; | 5900 Element get enclosingElement => null; |
| 5597 | 5901 |
| 5902 @override |
| 5598 ElementKind get kind => ElementKind.ERROR; | 5903 ElementKind get kind => ElementKind.ERROR; |
| 5599 | 5904 |
| 5905 @override |
| 5600 LibraryElement get library => null; | 5906 LibraryElement get library => null; |
| 5601 | 5907 |
| 5908 @override |
| 5602 ElementLocation get location => null; | 5909 ElementLocation get location => null; |
| 5603 | 5910 |
| 5911 @override |
| 5604 List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY; | 5912 List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY; |
| 5605 | 5913 |
| 5914 @override |
| 5606 String get name => _name; | 5915 String get name => _name; |
| 5607 | 5916 |
| 5917 @override |
| 5608 int get nameOffset => -1; | 5918 int get nameOffset => -1; |
| 5609 | 5919 |
| 5920 @override |
| 5610 AstNode get node => null; | 5921 AstNode get node => null; |
| 5611 | 5922 |
| 5923 @override |
| 5612 Source get source => null; | 5924 Source get source => null; |
| 5613 | 5925 |
| 5926 @override |
| 5614 DartType get type => DynamicTypeImpl.instance; | 5927 DartType get type => DynamicTypeImpl.instance; |
| 5615 | 5928 |
| 5929 @override |
| 5616 CompilationUnit get unit => null; | 5930 CompilationUnit get unit => null; |
| 5617 | 5931 |
| 5932 @override |
| 5618 bool isAccessibleIn(LibraryElement library) { | 5933 bool isAccessibleIn(LibraryElement library) { |
| 5619 for (Element element in conflictingElements) { | 5934 for (Element element in conflictingElements) { |
| 5620 if (element.isAccessibleIn(library)) { | 5935 if (element.isAccessibleIn(library)) { |
| 5621 return true; | 5936 return true; |
| 5622 } | 5937 } |
| 5623 } | 5938 } |
| 5624 return false; | 5939 return false; |
| 5625 } | 5940 } |
| 5626 | 5941 |
| 5942 @override |
| 5627 bool get isDeprecated => false; | 5943 bool get isDeprecated => false; |
| 5628 | 5944 |
| 5945 @override |
| 5629 bool get isOverride => false; | 5946 bool get isOverride => false; |
| 5630 | 5947 |
| 5948 @override |
| 5631 bool get isPrivate { | 5949 bool get isPrivate { |
| 5632 String name = displayName; | 5950 String name = displayName; |
| 5633 if (name == null) { | 5951 if (name == null) { |
| 5634 return false; | 5952 return false; |
| 5635 } | 5953 } |
| 5636 return Identifier.isPrivateName(name); | 5954 return Identifier.isPrivateName(name); |
| 5637 } | 5955 } |
| 5638 | 5956 |
| 5957 @override |
| 5639 bool get isPublic => !isPrivate; | 5958 bool get isPublic => !isPrivate; |
| 5640 | 5959 |
| 5960 @override |
| 5641 bool get isSynthetic => true; | 5961 bool get isSynthetic => true; |
| 5642 | 5962 |
| 5963 @override |
| 5643 String toString() { | 5964 String toString() { |
| 5644 JavaStringBuilder builder = new JavaStringBuilder(); | 5965 JavaStringBuilder builder = new JavaStringBuilder(); |
| 5645 builder.append("["); | 5966 builder.append("["); |
| 5646 int count = conflictingElements.length; | 5967 int count = conflictingElements.length; |
| 5647 for (int i = 0; i < count; i++) { | 5968 for (int i = 0; i < count; i++) { |
| 5648 if (i > 0) { | 5969 if (i > 0) { |
| 5649 builder.append(", "); | 5970 builder.append(", "); |
| 5650 } | 5971 } |
| 5651 (conflictingElements[i] as ElementImpl).appendTo(builder); | 5972 (conflictingElements[i] as ElementImpl).appendTo(builder); |
| 5652 } | 5973 } |
| 5653 builder.append("]"); | 5974 builder.append("]"); |
| 5654 return builder.toString(); | 5975 return builder.toString(); |
| 5655 } | 5976 } |
| 5656 | 5977 |
| 5978 @override |
| 5657 void visitChildren(ElementVisitor visitor) { | 5979 void visitChildren(ElementVisitor visitor) { |
| 5658 } | 5980 } |
| 5659 } | 5981 } |
| 5660 | 5982 |
| 5661 /** | 5983 /** |
| 5662 * The interface [MultiplyInheritedMethodElementImpl] defines all of the behavio
r of an | 5984 * The interface [MultiplyInheritedMethodElementImpl] defines all of the behavio
r of an |
| 5663 * [MethodElementImpl], with the additional information of an array of | 5985 * [MethodElementImpl], with the additional information of an array of |
| 5664 * [ExecutableElement]s from which this element was composed. | 5986 * [ExecutableElement]s from which this element was composed. |
| 5665 */ | 5987 */ |
| 5666 class MultiplyInheritedMethodElementImpl extends MethodElementImpl implements Mu
ltiplyInheritedExecutableElement { | 5988 class MultiplyInheritedMethodElementImpl extends MethodElementImpl implements Mu
ltiplyInheritedExecutableElement { |
| 5667 /** | 5989 /** |
| 5668 * An array the array of executable elements that were used to compose this el
ement. | 5990 * An array the array of executable elements that were used to compose this el
ement. |
| 5669 */ | 5991 */ |
| 5670 List<ExecutableElement> _elements = MethodElementImpl.EMPTY_ARRAY; | 5992 List<ExecutableElement> _elements = MethodElementImpl.EMPTY_ARRAY; |
| 5671 | 5993 |
| 5672 MultiplyInheritedMethodElementImpl(Identifier name) : super.con1(name) { | 5994 MultiplyInheritedMethodElementImpl(Identifier name) : super.con1(name) { |
| 5673 synthetic = true; | 5995 synthetic = true; |
| 5674 } | 5996 } |
| 5675 | 5997 |
| 5998 @override |
| 5676 List<ExecutableElement> get inheritedElements => _elements; | 5999 List<ExecutableElement> get inheritedElements => _elements; |
| 5677 | 6000 |
| 5678 void set inheritedElements(List<ExecutableElement> elements) { | 6001 void set inheritedElements(List<ExecutableElement> elements) { |
| 5679 this._elements = elements; | 6002 this._elements = elements; |
| 5680 } | 6003 } |
| 5681 } | 6004 } |
| 5682 | 6005 |
| 5683 /** | 6006 /** |
| 5684 * The interface [MultiplyInheritedPropertyAccessorElementImpl] defines all of t
he behavior of | 6007 * The interface [MultiplyInheritedPropertyAccessorElementImpl] defines all of t
he behavior of |
| 5685 * an [PropertyAccessorElementImpl], with the additional information of an array
of | 6008 * an [PropertyAccessorElementImpl], with the additional information of an array
of |
| 5686 * [ExecutableElement]s from which this element was composed. | 6009 * [ExecutableElement]s from which this element was composed. |
| 5687 */ | 6010 */ |
| 5688 class MultiplyInheritedPropertyAccessorElementImpl extends PropertyAccessorEleme
ntImpl implements MultiplyInheritedExecutableElement { | 6011 class MultiplyInheritedPropertyAccessorElementImpl extends PropertyAccessorEleme
ntImpl implements MultiplyInheritedExecutableElement { |
| 5689 /** | 6012 /** |
| 5690 * An array the array of executable elements that were used to compose this el
ement. | 6013 * An array the array of executable elements that were used to compose this el
ement. |
| 5691 */ | 6014 */ |
| 5692 List<ExecutableElement> _elements = PropertyAccessorElementImpl.EMPTY_ARRAY; | 6015 List<ExecutableElement> _elements = PropertyAccessorElementImpl.EMPTY_ARRAY; |
| 5693 | 6016 |
| 5694 MultiplyInheritedPropertyAccessorElementImpl(Identifier name) : super.con1(nam
e) { | 6017 MultiplyInheritedPropertyAccessorElementImpl(Identifier name) : super.con1(nam
e) { |
| 5695 synthetic = true; | 6018 synthetic = true; |
| 5696 } | 6019 } |
| 5697 | 6020 |
| 6021 @override |
| 5698 List<ExecutableElement> get inheritedElements => _elements; | 6022 List<ExecutableElement> get inheritedElements => _elements; |
| 5699 | 6023 |
| 5700 void set inheritedElements(List<ExecutableElement> elements) { | 6024 void set inheritedElements(List<ExecutableElement> elements) { |
| 5701 this._elements = elements; | 6025 this._elements = elements; |
| 5702 } | 6026 } |
| 5703 } | 6027 } |
| 5704 | 6028 |
| 5705 /** | 6029 /** |
| 5706 * Instances of the class `ParameterElementImpl` implement a `ParameterElement`. | 6030 * Instances of the class `ParameterElementImpl` implement a `ParameterElement`. |
| 5707 */ | 6031 */ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5763 | 6087 |
| 5764 /** | 6088 /** |
| 5765 * Initialize a newly created parameter element to have the given name. | 6089 * Initialize a newly created parameter element to have the given name. |
| 5766 * | 6090 * |
| 5767 * @param name the name of this element | 6091 * @param name the name of this element |
| 5768 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6092 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 5769 * declaration of this element | 6093 * declaration of this element |
| 5770 */ | 6094 */ |
| 5771 ParameterElementImpl.con2(String name, int nameOffset) : super.con2(name, name
Offset); | 6095 ParameterElementImpl.con2(String name, int nameOffset) : super.con2(name, name
Offset); |
| 5772 | 6096 |
| 6097 @override |
| 5773 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); | 6098 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); |
| 5774 | 6099 |
| 6100 @override |
| 5775 SourceRange get defaultValueRange { | 6101 SourceRange get defaultValueRange { |
| 5776 if (_defaultValueRangeLength < 0) { | 6102 if (_defaultValueRangeLength < 0) { |
| 5777 return null; | 6103 return null; |
| 5778 } | 6104 } |
| 5779 return new SourceRange(_defaultValueRangeOffset, _defaultValueRangeLength); | 6105 return new SourceRange(_defaultValueRangeOffset, _defaultValueRangeLength); |
| 5780 } | 6106 } |
| 5781 | 6107 |
| 6108 @override |
| 5782 ElementKind get kind => ElementKind.PARAMETER; | 6109 ElementKind get kind => ElementKind.PARAMETER; |
| 5783 | 6110 |
| 6111 @override |
| 5784 List<ParameterElement> get parameters => _parameters; | 6112 List<ParameterElement> get parameters => _parameters; |
| 5785 | 6113 |
| 6114 @override |
| 5786 SourceRange get visibleRange { | 6115 SourceRange get visibleRange { |
| 5787 if (_visibleRangeLength < 0) { | 6116 if (_visibleRangeLength < 0) { |
| 5788 return null; | 6117 return null; |
| 5789 } | 6118 } |
| 5790 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 6119 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 5791 } | 6120 } |
| 5792 | 6121 |
| 6122 @override |
| 5793 bool get isInitializingFormal => false; | 6123 bool get isInitializingFormal => false; |
| 5794 | 6124 |
| 6125 @override |
| 5795 bool get isPotentiallyMutatedInClosure => _potentiallyMutatedInClosure; | 6126 bool get isPotentiallyMutatedInClosure => _potentiallyMutatedInClosure; |
| 5796 | 6127 |
| 6128 @override |
| 5797 bool get isPotentiallyMutatedInScope => _potentiallyMutatedInScope; | 6129 bool get isPotentiallyMutatedInScope => _potentiallyMutatedInScope; |
| 5798 | 6130 |
| 5799 /** | 6131 /** |
| 5800 * Specifies that this variable is potentially mutated somewhere in closure. | 6132 * Specifies that this variable is potentially mutated somewhere in closure. |
| 5801 */ | 6133 */ |
| 5802 void markPotentiallyMutatedInClosure() { | 6134 void markPotentiallyMutatedInClosure() { |
| 5803 _potentiallyMutatedInClosure = true; | 6135 _potentiallyMutatedInClosure = true; |
| 5804 } | 6136 } |
| 5805 | 6137 |
| 5806 /** | 6138 /** |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5841 * | 6173 * |
| 5842 * @param offset the offset to the beginning of the visible range for this ele
ment | 6174 * @param offset the offset to the beginning of the visible range for this ele
ment |
| 5843 * @param length the length of the visible range for this element, or `-1` if
this element | 6175 * @param length the length of the visible range for this element, or `-1` if
this element |
| 5844 * does not have a visible range | 6176 * does not have a visible range |
| 5845 */ | 6177 */ |
| 5846 void setVisibleRange(int offset, int length) { | 6178 void setVisibleRange(int offset, int length) { |
| 5847 _visibleRangeOffset = offset; | 6179 _visibleRangeOffset = offset; |
| 5848 _visibleRangeLength = length; | 6180 _visibleRangeLength = length; |
| 5849 } | 6181 } |
| 5850 | 6182 |
| 6183 @override |
| 5851 void visitChildren(ElementVisitor visitor) { | 6184 void visitChildren(ElementVisitor visitor) { |
| 5852 super.visitChildren(visitor); | 6185 super.visitChildren(visitor); |
| 5853 safelyVisitChildren(_parameters, visitor); | 6186 safelyVisitChildren(_parameters, visitor); |
| 5854 } | 6187 } |
| 5855 | 6188 |
| 6189 @override |
| 5856 void appendTo(JavaStringBuilder builder) { | 6190 void appendTo(JavaStringBuilder builder) { |
| 5857 String left = ""; | 6191 String left = ""; |
| 5858 String right = ""; | 6192 String right = ""; |
| 5859 while (true) { | 6193 while (true) { |
| 5860 if (parameterKind == ParameterKind.NAMED) { | 6194 if (parameterKind == ParameterKind.NAMED) { |
| 5861 left = "{"; | 6195 left = "{"; |
| 5862 right = "}"; | 6196 right = "}"; |
| 5863 } else if (parameterKind == ParameterKind.POSITIONAL) { | 6197 } else if (parameterKind == ParameterKind.POSITIONAL) { |
| 5864 left = "["; | 6198 left = "["; |
| 5865 right = "]"; | 6199 right = "]"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5898 */ | 6232 */ |
| 5899 static List<PrefixElement> EMPTY_ARRAY = new List<PrefixElement>(0); | 6233 static List<PrefixElement> EMPTY_ARRAY = new List<PrefixElement>(0); |
| 5900 | 6234 |
| 5901 /** | 6235 /** |
| 5902 * Initialize a newly created prefix element to have the given name. | 6236 * Initialize a newly created prefix element to have the given name. |
| 5903 * | 6237 * |
| 5904 * @param name the name of this element | 6238 * @param name the name of this element |
| 5905 */ | 6239 */ |
| 5906 PrefixElementImpl(Identifier name) : super.forNode(name); | 6240 PrefixElementImpl(Identifier name) : super.forNode(name); |
| 5907 | 6241 |
| 6242 @override |
| 5908 accept(ElementVisitor visitor) => visitor.visitPrefixElement(this); | 6243 accept(ElementVisitor visitor) => visitor.visitPrefixElement(this); |
| 5909 | 6244 |
| 6245 @override |
| 5910 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen
t; | 6246 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen
t; |
| 5911 | 6247 |
| 6248 @override |
| 5912 List<LibraryElement> get importedLibraries => _importedLibraries; | 6249 List<LibraryElement> get importedLibraries => _importedLibraries; |
| 5913 | 6250 |
| 6251 @override |
| 5914 ElementKind get kind => ElementKind.PREFIX; | 6252 ElementKind get kind => ElementKind.PREFIX; |
| 5915 | 6253 |
| 5916 /** | 6254 /** |
| 5917 * Set the libraries that are imported using this prefix to the given librarie
s. | 6255 * Set the libraries that are imported using this prefix to the given librarie
s. |
| 5918 * | 6256 * |
| 5919 * @param importedLibraries the libraries that are imported using this prefix | 6257 * @param importedLibraries the libraries that are imported using this prefix |
| 5920 */ | 6258 */ |
| 5921 void set importedLibraries(List<LibraryElement> importedLibraries) { | 6259 void set importedLibraries(List<LibraryElement> importedLibraries) { |
| 5922 for (LibraryElement library in importedLibraries) { | 6260 for (LibraryElement library in importedLibraries) { |
| 5923 (library as LibraryElementImpl).enclosingElement = this; | 6261 (library as LibraryElementImpl).enclosingElement = this; |
| 5924 } | 6262 } |
| 5925 this._importedLibraries = importedLibraries; | 6263 this._importedLibraries = importedLibraries; |
| 5926 } | 6264 } |
| 5927 | 6265 |
| 6266 @override |
| 5928 void appendTo(JavaStringBuilder builder) { | 6267 void appendTo(JavaStringBuilder builder) { |
| 5929 builder.append("as "); | 6268 builder.append("as "); |
| 5930 super.appendTo(builder); | 6269 super.appendTo(builder); |
| 5931 } | 6270 } |
| 5932 | 6271 |
| 6272 @override |
| 5933 String get identifier => "_${super.identifier}"; | 6273 String get identifier => "_${super.identifier}"; |
| 5934 } | 6274 } |
| 5935 | 6275 |
| 5936 /** | 6276 /** |
| 5937 * Instances of the class `PropertyAccessorElementImpl` implement a | 6277 * Instances of the class `PropertyAccessorElementImpl` implement a |
| 5938 * `PropertyAccessorElement`. | 6278 * `PropertyAccessorElement`. |
| 5939 */ | 6279 */ |
| 5940 class PropertyAccessorElementImpl extends ExecutableElementImpl implements Prope
rtyAccessorElement { | 6280 class PropertyAccessorElementImpl extends ExecutableElementImpl implements Prope
rtyAccessorElement { |
| 5941 /** | 6281 /** |
| 5942 * The variable associated with this accessor. | 6282 * The variable associated with this accessor. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5959 * Initialize a newly created synthetic property accessor element to be associ
ated with the given | 6299 * Initialize a newly created synthetic property accessor element to be associ
ated with the given |
| 5960 * variable. | 6300 * variable. |
| 5961 * | 6301 * |
| 5962 * @param variable the variable with which this access is associated | 6302 * @param variable the variable with which this access is associated |
| 5963 */ | 6303 */ |
| 5964 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable) : super
.con2(variable.name, variable.nameOffset) { | 6304 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable) : super
.con2(variable.name, variable.nameOffset) { |
| 5965 this.variable = variable; | 6305 this.variable = variable; |
| 5966 synthetic = true; | 6306 synthetic = true; |
| 5967 } | 6307 } |
| 5968 | 6308 |
| 6309 @override |
| 5969 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 6310 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 5970 | 6311 |
| 6312 @override |
| 5971 bool operator ==(Object object) => super == object && identical(isGetter, (obj
ect as PropertyAccessorElement).isGetter); | 6313 bool operator ==(Object object) => super == object && identical(isGetter, (obj
ect as PropertyAccessorElement).isGetter); |
| 5972 | 6314 |
| 6315 @override |
| 5973 PropertyAccessorElement get correspondingGetter { | 6316 PropertyAccessorElement get correspondingGetter { |
| 5974 if (isGetter || variable == null) { | 6317 if (isGetter || variable == null) { |
| 5975 return null; | 6318 return null; |
| 5976 } | 6319 } |
| 5977 return variable.getter; | 6320 return variable.getter; |
| 5978 } | 6321 } |
| 5979 | 6322 |
| 6323 @override |
| 5980 PropertyAccessorElement get correspondingSetter { | 6324 PropertyAccessorElement get correspondingSetter { |
| 5981 if (isSetter || variable == null) { | 6325 if (isSetter || variable == null) { |
| 5982 return null; | 6326 return null; |
| 5983 } | 6327 } |
| 5984 return variable.setter; | 6328 return variable.setter; |
| 5985 } | 6329 } |
| 5986 | 6330 |
| 6331 @override |
| 5987 ElementKind get kind { | 6332 ElementKind get kind { |
| 5988 if (isGetter) { | 6333 if (isGetter) { |
| 5989 return ElementKind.GETTER; | 6334 return ElementKind.GETTER; |
| 5990 } | 6335 } |
| 5991 return ElementKind.SETTER; | 6336 return ElementKind.SETTER; |
| 5992 } | 6337 } |
| 5993 | 6338 |
| 6339 @override |
| 5994 String get name { | 6340 String get name { |
| 5995 if (isSetter) { | 6341 if (isSetter) { |
| 5996 return "${super.name}="; | 6342 return "${super.name}="; |
| 5997 } | 6343 } |
| 5998 return super.name; | 6344 return super.name; |
| 5999 } | 6345 } |
| 6000 | 6346 |
| 6347 @override |
| 6001 AstNode get node { | 6348 AstNode get node { |
| 6002 if (isSynthetic) { | 6349 if (isSynthetic) { |
| 6003 return null; | 6350 return null; |
| 6004 } | 6351 } |
| 6005 if (enclosingElement is ClassElement) { | 6352 if (enclosingElement is ClassElement) { |
| 6006 return getNodeMatching((node) => node is MethodDeclaration); | 6353 return getNodeMatching((node) => node is MethodDeclaration); |
| 6007 } | 6354 } |
| 6008 if (enclosingElement is CompilationUnitElement) { | 6355 if (enclosingElement is CompilationUnitElement) { |
| 6009 return getNodeMatching((node) => node is FunctionDeclaration); | 6356 return getNodeMatching((node) => node is FunctionDeclaration); |
| 6010 } | 6357 } |
| 6011 return null; | 6358 return null; |
| 6012 } | 6359 } |
| 6013 | 6360 |
| 6361 @override |
| 6014 int get hashCode => ObjectUtilities.combineHashCodes(super.hashCode, isGetter
? 1 : 2); | 6362 int get hashCode => ObjectUtilities.combineHashCodes(super.hashCode, isGetter
? 1 : 2); |
| 6015 | 6363 |
| 6364 @override |
| 6016 bool get isAbstract => hasModifier(Modifier.ABSTRACT); | 6365 bool get isAbstract => hasModifier(Modifier.ABSTRACT); |
| 6017 | 6366 |
| 6367 @override |
| 6018 bool get isGetter => hasModifier(Modifier.GETTER); | 6368 bool get isGetter => hasModifier(Modifier.GETTER); |
| 6019 | 6369 |
| 6370 @override |
| 6020 bool get isSetter => hasModifier(Modifier.SETTER); | 6371 bool get isSetter => hasModifier(Modifier.SETTER); |
| 6021 | 6372 |
| 6373 @override |
| 6022 bool get isStatic => hasModifier(Modifier.STATIC); | 6374 bool get isStatic => hasModifier(Modifier.STATIC); |
| 6023 | 6375 |
| 6024 /** | 6376 /** |
| 6025 * Set whether this accessor is abstract to correspond to the given value. | 6377 * Set whether this accessor is abstract to correspond to the given value. |
| 6026 * | 6378 * |
| 6027 * @param isAbstract `true` if the accessor is abstract | 6379 * @param isAbstract `true` if the accessor is abstract |
| 6028 */ | 6380 */ |
| 6029 void set abstract(bool isAbstract) { | 6381 void set abstract(bool isAbstract) { |
| 6030 setModifier(Modifier.ABSTRACT, isAbstract); | 6382 setModifier(Modifier.ABSTRACT, isAbstract); |
| 6031 } | 6383 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 6050 | 6402 |
| 6051 /** | 6403 /** |
| 6052 * Set whether this accessor is static to correspond to the given value. | 6404 * Set whether this accessor is static to correspond to the given value. |
| 6053 * | 6405 * |
| 6054 * @param isStatic `true` if the accessor is static | 6406 * @param isStatic `true` if the accessor is static |
| 6055 */ | 6407 */ |
| 6056 void set static(bool isStatic) { | 6408 void set static(bool isStatic) { |
| 6057 setModifier(Modifier.STATIC, isStatic); | 6409 setModifier(Modifier.STATIC, isStatic); |
| 6058 } | 6410 } |
| 6059 | 6411 |
| 6412 @override |
| 6060 void appendTo(JavaStringBuilder builder) { | 6413 void appendTo(JavaStringBuilder builder) { |
| 6061 builder.append(isGetter ? "get " : "set "); | 6414 builder.append(isGetter ? "get " : "set "); |
| 6062 builder.append(variable.displayName); | 6415 builder.append(variable.displayName); |
| 6063 super.appendTo(builder); | 6416 super.appendTo(builder); |
| 6064 } | 6417 } |
| 6065 } | 6418 } |
| 6066 | 6419 |
| 6067 /** | 6420 /** |
| 6068 * Instances of the class `PropertyInducingElementImpl` implement a | 6421 * Instances of the class `PropertyInducingElementImpl` implement a |
| 6069 * `PropertyInducingElement`. | 6422 * `PropertyInducingElement`. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6116 /** | 6469 /** |
| 6117 * The offset of the character immediately following the last character of thi
s node. | 6470 * The offset of the character immediately following the last character of thi
s node. |
| 6118 */ | 6471 */ |
| 6119 int end = -1; | 6472 int end = -1; |
| 6120 | 6473 |
| 6121 /** | 6474 /** |
| 6122 * The offset of the 'show' keyword of this element. | 6475 * The offset of the 'show' keyword of this element. |
| 6123 */ | 6476 */ |
| 6124 int offset = 0; | 6477 int offset = 0; |
| 6125 | 6478 |
| 6479 @override |
| 6126 String toString() { | 6480 String toString() { |
| 6127 JavaStringBuilder builder = new JavaStringBuilder(); | 6481 JavaStringBuilder builder = new JavaStringBuilder(); |
| 6128 builder.append("show "); | 6482 builder.append("show "); |
| 6129 int count = shownNames.length; | 6483 int count = shownNames.length; |
| 6130 for (int i = 0; i < count; i++) { | 6484 for (int i = 0; i < count; i++) { |
| 6131 if (i > 0) { | 6485 if (i > 0) { |
| 6132 builder.append(", "); | 6486 builder.append(", "); |
| 6133 } | 6487 } |
| 6134 builder.append(shownNames[i]); | 6488 builder.append(shownNames[i]); |
| 6135 } | 6489 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6168 */ | 6522 */ |
| 6169 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name); | 6523 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name); |
| 6170 | 6524 |
| 6171 /** | 6525 /** |
| 6172 * Initialize a newly created synthetic top-level variable element to have the
given name. | 6526 * Initialize a newly created synthetic top-level variable element to have the
given name. |
| 6173 * | 6527 * |
| 6174 * @param name the name of this element | 6528 * @param name the name of this element |
| 6175 */ | 6529 */ |
| 6176 TopLevelVariableElementImpl.con2(String name) : super.con2(name); | 6530 TopLevelVariableElementImpl.con2(String name) : super.con2(name); |
| 6177 | 6531 |
| 6532 @override |
| 6178 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); | 6533 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); |
| 6179 | 6534 |
| 6535 @override |
| 6180 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; | 6536 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; |
| 6181 | 6537 |
| 6538 @override |
| 6182 bool get isStatic => true; | 6539 bool get isStatic => true; |
| 6183 } | 6540 } |
| 6184 | 6541 |
| 6185 /** | 6542 /** |
| 6186 * Instances of the class `TypeParameterElementImpl` implement a [TypeParameterE
lement]. | 6543 * Instances of the class `TypeParameterElementImpl` implement a [TypeParameterE
lement]. |
| 6187 */ | 6544 */ |
| 6188 class TypeParameterElementImpl extends ElementImpl implements TypeParameterEleme
nt { | 6545 class TypeParameterElementImpl extends ElementImpl implements TypeParameterEleme
nt { |
| 6189 /** | 6546 /** |
| 6190 * The type defined by this type parameter. | 6547 * The type defined by this type parameter. |
| 6191 */ | 6548 */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 6202 */ | 6559 */ |
| 6203 static List<TypeParameterElement> EMPTY_ARRAY = new List<TypeParameterElement>
(0); | 6560 static List<TypeParameterElement> EMPTY_ARRAY = new List<TypeParameterElement>
(0); |
| 6204 | 6561 |
| 6205 /** | 6562 /** |
| 6206 * Initialize a newly created type parameter element to have the given name. | 6563 * Initialize a newly created type parameter element to have the given name. |
| 6207 * | 6564 * |
| 6208 * @param name the name of this element | 6565 * @param name the name of this element |
| 6209 */ | 6566 */ |
| 6210 TypeParameterElementImpl(Identifier name) : super.forNode(name); | 6567 TypeParameterElementImpl(Identifier name) : super.forNode(name); |
| 6211 | 6568 |
| 6569 @override |
| 6212 accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this); | 6570 accept(ElementVisitor visitor) => visitor.visitTypeParameterElement(this); |
| 6213 | 6571 |
| 6572 @override |
| 6214 ElementKind get kind => ElementKind.TYPE_PARAMETER; | 6573 ElementKind get kind => ElementKind.TYPE_PARAMETER; |
| 6215 | 6574 |
| 6575 @override |
| 6216 void appendTo(JavaStringBuilder builder) { | 6576 void appendTo(JavaStringBuilder builder) { |
| 6217 builder.append(displayName); | 6577 builder.append(displayName); |
| 6218 if (bound != null) { | 6578 if (bound != null) { |
| 6219 builder.append(" extends "); | 6579 builder.append(" extends "); |
| 6220 builder.append(bound); | 6580 builder.append(bound); |
| 6221 } | 6581 } |
| 6222 } | 6582 } |
| 6223 } | 6583 } |
| 6224 | 6584 |
| 6225 /** | 6585 /** |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6260 | 6620 |
| 6261 /** | 6621 /** |
| 6262 * Return the result of evaluating this variable's initializer as a compile-ti
me constant | 6622 * Return the result of evaluating this variable's initializer as a compile-ti
me constant |
| 6263 * expression, or `null` if this variable is not a 'const' variable, if it doe
s not have an | 6623 * expression, or `null` if this variable is not a 'const' variable, if it doe
s not have an |
| 6264 * initializer, or if the compilation unit containing the variable has not bee
n resolved. | 6624 * initializer, or if the compilation unit containing the variable has not bee
n resolved. |
| 6265 * | 6625 * |
| 6266 * @return the result of evaluating this variable's initializer | 6626 * @return the result of evaluating this variable's initializer |
| 6267 */ | 6627 */ |
| 6268 EvaluationResultImpl get evaluationResult => null; | 6628 EvaluationResultImpl get evaluationResult => null; |
| 6269 | 6629 |
| 6630 @override |
| 6270 FunctionElement get initializer => _initializer; | 6631 FunctionElement get initializer => _initializer; |
| 6271 | 6632 |
| 6633 @override |
| 6272 VariableDeclaration get node => getNodeMatching((node) => node is VariableDecl
aration); | 6634 VariableDeclaration get node => getNodeMatching((node) => node is VariableDecl
aration); |
| 6273 | 6635 |
| 6636 @override |
| 6274 bool get isConst => hasModifier(Modifier.CONST); | 6637 bool get isConst => hasModifier(Modifier.CONST); |
| 6275 | 6638 |
| 6639 @override |
| 6276 bool get isFinal => hasModifier(Modifier.FINAL); | 6640 bool get isFinal => hasModifier(Modifier.FINAL); |
| 6277 | 6641 |
| 6278 /** | 6642 /** |
| 6279 * Return `true` if this variable is potentially mutated somewhere in a closur
e. This | 6643 * Return `true` if this variable is potentially mutated somewhere in a closur
e. This |
| 6280 * information is only available for local variables (including parameters) an
d only after the | 6644 * information is only available for local variables (including parameters) an
d only after the |
| 6281 * compilation unit containing the variable has been resolved. | 6645 * compilation unit containing the variable has been resolved. |
| 6282 * | 6646 * |
| 6283 * @return `true` if this variable is potentially mutated somewhere in closure | 6647 * @return `true` if this variable is potentially mutated somewhere in closure |
| 6284 */ | 6648 */ |
| 6285 bool get isPotentiallyMutatedInClosure => false; | 6649 bool get isPotentiallyMutatedInClosure => false; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6326 * | 6690 * |
| 6327 * @param initializer the function representing this variable's initializer | 6691 * @param initializer the function representing this variable's initializer |
| 6328 */ | 6692 */ |
| 6329 void set initializer(FunctionElement initializer) { | 6693 void set initializer(FunctionElement initializer) { |
| 6330 if (initializer != null) { | 6694 if (initializer != null) { |
| 6331 (initializer as FunctionElementImpl).enclosingElement = this; | 6695 (initializer as FunctionElementImpl).enclosingElement = this; |
| 6332 } | 6696 } |
| 6333 this._initializer = initializer; | 6697 this._initializer = initializer; |
| 6334 } | 6698 } |
| 6335 | 6699 |
| 6700 @override |
| 6336 void visitChildren(ElementVisitor visitor) { | 6701 void visitChildren(ElementVisitor visitor) { |
| 6337 super.visitChildren(visitor); | 6702 super.visitChildren(visitor); |
| 6338 safelyVisitChild(_initializer, visitor); | 6703 safelyVisitChild(_initializer, visitor); |
| 6339 } | 6704 } |
| 6340 | 6705 |
| 6706 @override |
| 6341 void appendTo(JavaStringBuilder builder) { | 6707 void appendTo(JavaStringBuilder builder) { |
| 6342 builder.append(type); | 6708 builder.append(type); |
| 6343 builder.append(" "); | 6709 builder.append(" "); |
| 6344 builder.append(displayName); | 6710 builder.append(displayName); |
| 6345 } | 6711 } |
| 6346 } | 6712 } |
| 6347 | 6713 |
| 6348 /** | 6714 /** |
| 6349 * Information about Angular application. | 6715 * Information about Angular application. |
| 6350 */ | 6716 */ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6415 * Initialize a newly created Angular component to have the given name. | 6781 * Initialize a newly created Angular component to have the given name. |
| 6416 * | 6782 * |
| 6417 * @param name the name of this element | 6783 * @param name the name of this element |
| 6418 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6784 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6419 * declaration of this element | 6785 * declaration of this element |
| 6420 */ | 6786 */ |
| 6421 AngularComponentElementImpl(String name, int nameOffset, int annotationOffset)
: super(name, nameOffset) { | 6787 AngularComponentElementImpl(String name, int nameOffset, int annotationOffset)
: super(name, nameOffset) { |
| 6422 this._annotationOffset = annotationOffset; | 6788 this._annotationOffset = annotationOffset; |
| 6423 } | 6789 } |
| 6424 | 6790 |
| 6791 @override |
| 6425 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this); | 6792 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this); |
| 6426 | 6793 |
| 6794 @override |
| 6427 ElementKind get kind => ElementKind.ANGULAR_COMPONENT; | 6795 ElementKind get kind => ElementKind.ANGULAR_COMPONENT; |
| 6428 | 6796 |
| 6797 @override |
| 6429 List<AngularPropertyElement> get properties => _properties; | 6798 List<AngularPropertyElement> get properties => _properties; |
| 6430 | 6799 |
| 6800 @override |
| 6431 List<AngularScopePropertyElement> get scopeProperties => _scopeProperties; | 6801 List<AngularScopePropertyElement> get scopeProperties => _scopeProperties; |
| 6432 | 6802 |
| 6433 /** | 6803 /** |
| 6434 * Set an array containing all of the properties declared by this component. | 6804 * Set an array containing all of the properties declared by this component. |
| 6435 * | 6805 * |
| 6436 * @param properties the properties to set | 6806 * @param properties the properties to set |
| 6437 */ | 6807 */ |
| 6438 void set properties(List<AngularPropertyElement> properties) { | 6808 void set properties(List<AngularPropertyElement> properties) { |
| 6439 for (AngularPropertyElement property in properties) { | 6809 for (AngularPropertyElement property in properties) { |
| 6440 encloseElement(property as AngularPropertyElementImpl); | 6810 encloseElement(property as AngularPropertyElementImpl); |
| 6441 } | 6811 } |
| 6442 this._properties = properties; | 6812 this._properties = properties; |
| 6443 } | 6813 } |
| 6444 | 6814 |
| 6445 /** | 6815 /** |
| 6446 * Set an array containing all of the scope properties declared by this compon
ent. | 6816 * Set an array containing all of the scope properties declared by this compon
ent. |
| 6447 * | 6817 * |
| 6448 * @param properties the properties to set | 6818 * @param properties the properties to set |
| 6449 */ | 6819 */ |
| 6450 void set scopeProperties(List<AngularScopePropertyElement> properties) { | 6820 void set scopeProperties(List<AngularScopePropertyElement> properties) { |
| 6451 for (AngularScopePropertyElement property in properties) { | 6821 for (AngularScopePropertyElement property in properties) { |
| 6452 encloseElement(property as AngularScopePropertyElementImpl); | 6822 encloseElement(property as AngularScopePropertyElementImpl); |
| 6453 } | 6823 } |
| 6454 this._scopeProperties = properties; | 6824 this._scopeProperties = properties; |
| 6455 } | 6825 } |
| 6456 | 6826 |
| 6827 @override |
| 6457 void visitChildren(ElementVisitor visitor) { | 6828 void visitChildren(ElementVisitor visitor) { |
| 6458 safelyVisitChildren(_properties, visitor); | 6829 safelyVisitChildren(_properties, visitor); |
| 6459 safelyVisitChildren(_scopeProperties, visitor); | 6830 safelyVisitChildren(_scopeProperties, visitor); |
| 6460 super.visitChildren(visitor); | 6831 super.visitChildren(visitor); |
| 6461 } | 6832 } |
| 6462 | 6833 |
| 6834 @override |
| 6463 String get identifier => "AngularComponent@${_annotationOffset}"; | 6835 String get identifier => "AngularComponent@${_annotationOffset}"; |
| 6464 } | 6836 } |
| 6465 | 6837 |
| 6466 /** | 6838 /** |
| 6467 * Implementation of `AngularControllerElement`. | 6839 * Implementation of `AngularControllerElement`. |
| 6468 */ | 6840 */ |
| 6469 class AngularControllerElementImpl extends AngularHasSelectorElementImpl impleme
nts AngularControllerElement { | 6841 class AngularControllerElementImpl extends AngularHasSelectorElementImpl impleme
nts AngularControllerElement { |
| 6470 /** | 6842 /** |
| 6471 * Initialize a newly created Angular controller to have the given name. | 6843 * Initialize a newly created Angular controller to have the given name. |
| 6472 * | 6844 * |
| 6473 * @param name the name of this element | 6845 * @param name the name of this element |
| 6474 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6846 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6475 * declaration of this element | 6847 * declaration of this element |
| 6476 */ | 6848 */ |
| 6477 AngularControllerElementImpl(String name, int nameOffset) : super(name, nameOf
fset); | 6849 AngularControllerElementImpl(String name, int nameOffset) : super(name, nameOf
fset); |
| 6478 | 6850 |
| 6851 @override |
| 6479 accept(ElementVisitor visitor) => visitor.visitAngularControllerElement(this); | 6852 accept(ElementVisitor visitor) => visitor.visitAngularControllerElement(this); |
| 6480 | 6853 |
| 6854 @override |
| 6481 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER; | 6855 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER; |
| 6482 } | 6856 } |
| 6483 | 6857 |
| 6484 /** | 6858 /** |
| 6485 * Implementation of `AngularDirectiveElement`. | 6859 * Implementation of `AngularDirectiveElement`. |
| 6486 */ | 6860 */ |
| 6487 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularDirectiveElement { | 6861 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularDirectiveElement { |
| 6488 /** | 6862 /** |
| 6489 * The offset of the annotation that defines this directive. | 6863 * The offset of the annotation that defines this directive. |
| 6490 */ | 6864 */ |
| 6491 int _offset = 0; | 6865 int _offset = 0; |
| 6492 | 6866 |
| 6493 /** | 6867 /** |
| 6494 * The array containing all of the properties declared by this directive. | 6868 * The array containing all of the properties declared by this directive. |
| 6495 */ | 6869 */ |
| 6496 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; | 6870 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; |
| 6497 | 6871 |
| 6498 /** | 6872 /** |
| 6499 * Initialize a newly created Angular directive to have the given name. | 6873 * Initialize a newly created Angular directive to have the given name. |
| 6500 * | 6874 * |
| 6501 * @param offset the offset of the annotation that defines this directive | 6875 * @param offset the offset of the annotation that defines this directive |
| 6502 */ | 6876 */ |
| 6503 AngularDirectiveElementImpl(int offset) : super(null, -1) { | 6877 AngularDirectiveElementImpl(int offset) : super(null, -1) { |
| 6504 this._offset = offset; | 6878 this._offset = offset; |
| 6505 } | 6879 } |
| 6506 | 6880 |
| 6881 @override |
| 6507 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this); | 6882 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this); |
| 6508 | 6883 |
| 6884 @override |
| 6509 String get displayName => selector.displayName; | 6885 String get displayName => selector.displayName; |
| 6510 | 6886 |
| 6887 @override |
| 6511 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE; | 6888 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE; |
| 6512 | 6889 |
| 6890 @override |
| 6513 List<AngularPropertyElement> get properties => _properties; | 6891 List<AngularPropertyElement> get properties => _properties; |
| 6514 | 6892 |
| 6893 @override |
| 6515 bool isClass(String name) { | 6894 bool isClass(String name) { |
| 6516 Element enclosing = enclosingElement; | 6895 Element enclosing = enclosingElement; |
| 6517 return enclosing is ClassElement && enclosing.name == name; | 6896 return enclosing is ClassElement && enclosing.name == name; |
| 6518 } | 6897 } |
| 6519 | 6898 |
| 6520 /** | 6899 /** |
| 6521 * Set an array containing all of the properties declared by this directive. | 6900 * Set an array containing all of the properties declared by this directive. |
| 6522 * | 6901 * |
| 6523 * @param properties the properties to set | 6902 * @param properties the properties to set |
| 6524 */ | 6903 */ |
| 6525 void set properties(List<AngularPropertyElement> properties) { | 6904 void set properties(List<AngularPropertyElement> properties) { |
| 6526 for (AngularPropertyElement property in properties) { | 6905 for (AngularPropertyElement property in properties) { |
| 6527 encloseElement(property as AngularPropertyElementImpl); | 6906 encloseElement(property as AngularPropertyElementImpl); |
| 6528 } | 6907 } |
| 6529 this._properties = properties; | 6908 this._properties = properties; |
| 6530 } | 6909 } |
| 6531 | 6910 |
| 6911 @override |
| 6532 void visitChildren(ElementVisitor visitor) { | 6912 void visitChildren(ElementVisitor visitor) { |
| 6533 safelyVisitChildren(_properties, visitor); | 6913 safelyVisitChildren(_properties, visitor); |
| 6534 super.visitChildren(visitor); | 6914 super.visitChildren(visitor); |
| 6535 } | 6915 } |
| 6536 | 6916 |
| 6917 @override |
| 6537 String get identifier => "NgDirective@${_offset}"; | 6918 String get identifier => "NgDirective@${_offset}"; |
| 6538 } | 6919 } |
| 6539 | 6920 |
| 6540 /** | 6921 /** |
| 6541 * Implementation of `AngularElement`. | 6922 * Implementation of `AngularElement`. |
| 6542 */ | 6923 */ |
| 6543 abstract class AngularElementImpl extends ToolkitObjectElementImpl implements An
gularElement { | 6924 abstract class AngularElementImpl extends ToolkitObjectElementImpl implements An
gularElement { |
| 6544 /** | 6925 /** |
| 6545 * The [AngularApplication] this element is used in. | 6926 * The [AngularApplication] this element is used in. |
| 6546 */ | 6927 */ |
| 6547 AngularApplication _application; | 6928 AngularApplication _application; |
| 6548 | 6929 |
| 6549 /** | 6930 /** |
| 6550 * Initialize a newly created Angular element to have the given name. | 6931 * Initialize a newly created Angular element to have the given name. |
| 6551 * | 6932 * |
| 6552 * @param name the name of this element | 6933 * @param name the name of this element |
| 6553 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6934 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6554 * declaration of this element | 6935 * declaration of this element |
| 6555 */ | 6936 */ |
| 6556 AngularElementImpl(String name, int nameOffset) : super(name, nameOffset); | 6937 AngularElementImpl(String name, int nameOffset) : super(name, nameOffset); |
| 6557 | 6938 |
| 6939 @override |
| 6558 AngularApplication get application => _application; | 6940 AngularApplication get application => _application; |
| 6559 | 6941 |
| 6560 /** | 6942 /** |
| 6561 * Set the [AngularApplication] this element is used in. | 6943 * Set the [AngularApplication] this element is used in. |
| 6562 */ | 6944 */ |
| 6563 void set application(AngularApplication application) { | 6945 void set application(AngularApplication application) { |
| 6564 this._application = application; | 6946 this._application = application; |
| 6565 } | 6947 } |
| 6566 } | 6948 } |
| 6567 | 6949 |
| 6568 /** | 6950 /** |
| 6569 * Implementation of `AngularFilterElement`. | 6951 * Implementation of `AngularFilterElement`. |
| 6570 */ | 6952 */ |
| 6571 class AngularFilterElementImpl extends AngularElementImpl implements AngularFilt
erElement { | 6953 class AngularFilterElementImpl extends AngularElementImpl implements AngularFilt
erElement { |
| 6572 /** | 6954 /** |
| 6573 * Initialize a newly created Angular filter to have the given name. | 6955 * Initialize a newly created Angular filter to have the given name. |
| 6574 * | 6956 * |
| 6575 * @param name the name of this element | 6957 * @param name the name of this element |
| 6576 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6958 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6577 * declaration of this element | 6959 * declaration of this element |
| 6578 */ | 6960 */ |
| 6579 AngularFilterElementImpl(String name, int nameOffset) : super(name, nameOffset
); | 6961 AngularFilterElementImpl(String name, int nameOffset) : super(name, nameOffset
); |
| 6580 | 6962 |
| 6963 @override |
| 6581 accept(ElementVisitor visitor) => visitor.visitAngularFilterElement(this); | 6964 accept(ElementVisitor visitor) => visitor.visitAngularFilterElement(this); |
| 6582 | 6965 |
| 6966 @override |
| 6583 ElementKind get kind => ElementKind.ANGULAR_FILTER; | 6967 ElementKind get kind => ElementKind.ANGULAR_FILTER; |
| 6584 } | 6968 } |
| 6585 | 6969 |
| 6586 /** | 6970 /** |
| 6587 * Implementation of [AngularSelectorElement] based on presence of a class. | 6971 * Implementation of [AngularSelectorElement] based on presence of a class. |
| 6588 */ | 6972 */ |
| 6589 class AngularHasClassSelectorElementImpl extends AngularSelectorElementImpl impl
ements AngularHasClassSelectorElement { | 6973 class AngularHasClassSelectorElementImpl extends AngularSelectorElementImpl impl
ements AngularHasClassSelectorElement { |
| 6590 AngularHasClassSelectorElementImpl(String name, int offset) : super(name, offs
et); | 6974 AngularHasClassSelectorElementImpl(String name, int offset) : super(name, offs
et); |
| 6591 | 6975 |
| 6976 @override |
| 6592 bool apply(XmlTagNode node) { | 6977 bool apply(XmlTagNode node) { |
| 6593 XmlAttributeNode attribute = node.getAttribute("class"); | 6978 XmlAttributeNode attribute = node.getAttribute("class"); |
| 6594 if (attribute != null) { | 6979 if (attribute != null) { |
| 6595 String text = attribute.text; | 6980 String text = attribute.text; |
| 6596 if (text != null) { | 6981 if (text != null) { |
| 6597 String name = this.name; | 6982 String name = this.name; |
| 6598 for (String className in StringUtils.split(text)) { | 6983 for (String className in StringUtils.split(text)) { |
| 6599 if (className == name) { | 6984 if (className == name) { |
| 6600 return true; | 6985 return true; |
| 6601 } | 6986 } |
| 6602 } | 6987 } |
| 6603 } | 6988 } |
| 6604 } | 6989 } |
| 6605 return false; | 6990 return false; |
| 6606 } | 6991 } |
| 6607 | 6992 |
| 6993 @override |
| 6608 void appendTo(JavaStringBuilder builder) { | 6994 void appendTo(JavaStringBuilder builder) { |
| 6609 builder.append("."); | 6995 builder.append("."); |
| 6610 builder.append(name); | 6996 builder.append(name); |
| 6611 } | 6997 } |
| 6612 } | 6998 } |
| 6613 | 6999 |
| 6614 /** | 7000 /** |
| 6615 * Implementation of `AngularSelectorElement`. | 7001 * Implementation of `AngularSelectorElement`. |
| 6616 */ | 7002 */ |
| 6617 abstract class AngularHasSelectorElementImpl extends AngularElementImpl implemen
ts AngularHasSelectorElement { | 7003 abstract class AngularHasSelectorElementImpl extends AngularElementImpl implemen
ts AngularHasSelectorElement { |
| 6618 /** | 7004 /** |
| 6619 * The selector of this element. | 7005 * The selector of this element. |
| 6620 */ | 7006 */ |
| 6621 AngularSelectorElement _selector; | 7007 AngularSelectorElement _selector; |
| 6622 | 7008 |
| 6623 /** | 7009 /** |
| 6624 * Initialize a newly created Angular element to have the given name. | 7010 * Initialize a newly created Angular element to have the given name. |
| 6625 * | 7011 * |
| 6626 * @param name the name of this element | 7012 * @param name the name of this element |
| 6627 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 7013 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6628 * declaration of this element | 7014 * declaration of this element |
| 6629 */ | 7015 */ |
| 6630 AngularHasSelectorElementImpl(String name, int nameOffset) : super(name, nameO
ffset); | 7016 AngularHasSelectorElementImpl(String name, int nameOffset) : super(name, nameO
ffset); |
| 6631 | 7017 |
| 7018 @override |
| 6632 AngularSelectorElement get selector => _selector; | 7019 AngularSelectorElement get selector => _selector; |
| 6633 | 7020 |
| 6634 /** | 7021 /** |
| 6635 * Set the selector of this selector-based element. | 7022 * Set the selector of this selector-based element. |
| 6636 * | 7023 * |
| 6637 * @param selector the selector to set | 7024 * @param selector the selector to set |
| 6638 */ | 7025 */ |
| 6639 void set selector(AngularSelectorElement selector) { | 7026 void set selector(AngularSelectorElement selector) { |
| 6640 encloseElement(selector as AngularSelectorElementImpl); | 7027 encloseElement(selector as AngularSelectorElementImpl); |
| 6641 this._selector = selector; | 7028 this._selector = selector; |
| 6642 } | 7029 } |
| 6643 | 7030 |
| 7031 @override |
| 6644 void visitChildren(ElementVisitor visitor) { | 7032 void visitChildren(ElementVisitor visitor) { |
| 6645 safelyVisitChild(_selector, visitor); | 7033 safelyVisitChild(_selector, visitor); |
| 6646 super.visitChildren(visitor); | 7034 super.visitChildren(visitor); |
| 6647 } | 7035 } |
| 6648 } | 7036 } |
| 6649 | 7037 |
| 6650 /** | 7038 /** |
| 6651 * Implementation of `AngularPropertyElement`. | 7039 * Implementation of `AngularPropertyElement`. |
| 6652 */ | 7040 */ |
| 6653 class AngularPropertyElementImpl extends AngularElementImpl implements AngularPr
opertyElement { | 7041 class AngularPropertyElementImpl extends AngularElementImpl implements AngularPr
opertyElement { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6665 | 7053 |
| 6666 /** | 7054 /** |
| 6667 * Initialize a newly created Angular property to have the given name. | 7055 * Initialize a newly created Angular property to have the given name. |
| 6668 * | 7056 * |
| 6669 * @param name the name of this element | 7057 * @param name the name of this element |
| 6670 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 7058 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6671 * declaration of this element | 7059 * declaration of this element |
| 6672 */ | 7060 */ |
| 6673 AngularPropertyElementImpl(String name, int nameOffset) : super(name, nameOffs
et); | 7061 AngularPropertyElementImpl(String name, int nameOffset) : super(name, nameOffs
et); |
| 6674 | 7062 |
| 7063 @override |
| 6675 accept(ElementVisitor visitor) => visitor.visitAngularPropertyElement(this); | 7064 accept(ElementVisitor visitor) => visitor.visitAngularPropertyElement(this); |
| 6676 | 7065 |
| 7066 @override |
| 6677 ElementKind get kind => ElementKind.ANGULAR_PROPERTY; | 7067 ElementKind get kind => ElementKind.ANGULAR_PROPERTY; |
| 6678 } | 7068 } |
| 6679 | 7069 |
| 6680 /** | 7070 /** |
| 6681 * Implementation of `AngularScopePropertyElement`. | 7071 * Implementation of `AngularScopePropertyElement`. |
| 6682 */ | 7072 */ |
| 6683 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu
larScopePropertyElement { | 7073 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu
larScopePropertyElement { |
| 6684 /** | 7074 /** |
| 6685 * The type of the property | 7075 * The type of the property |
| 6686 */ | 7076 */ |
| 6687 final DartType type; | 7077 final DartType type; |
| 6688 | 7078 |
| 6689 /** | 7079 /** |
| 6690 * Initialize a newly created Angular scope property to have the given name. | 7080 * Initialize a newly created Angular scope property to have the given name. |
| 6691 * | 7081 * |
| 6692 * @param name the name of this element | 7082 * @param name the name of this element |
| 6693 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 7083 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6694 * declaration of this element | 7084 * declaration of this element |
| 6695 */ | 7085 */ |
| 6696 AngularScopePropertyElementImpl(String name, int nameOffset, this.type) : supe
r(name, nameOffset); | 7086 AngularScopePropertyElementImpl(String name, int nameOffset, this.type) : supe
r(name, nameOffset); |
| 6697 | 7087 |
| 7088 @override |
| 6698 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi
s); | 7089 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi
s); |
| 6699 | 7090 |
| 7091 @override |
| 6700 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY; | 7092 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY; |
| 6701 } | 7093 } |
| 6702 | 7094 |
| 6703 /** | 7095 /** |
| 6704 * Implementation of `AngularFilterElement`. | 7096 * Implementation of `AngularFilterElement`. |
| 6705 */ | 7097 */ |
| 6706 abstract class AngularSelectorElementImpl extends AngularElementImpl implements
AngularSelectorElement { | 7098 abstract class AngularSelectorElementImpl extends AngularElementImpl implements
AngularSelectorElement { |
| 6707 /** | 7099 /** |
| 6708 * Initialize a newly created Angular selector to have the given name. | 7100 * Initialize a newly created Angular selector to have the given name. |
| 6709 * | 7101 * |
| 6710 * @param name the name of this element | 7102 * @param name the name of this element |
| 6711 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 7103 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6712 * declaration of this element | 7104 * declaration of this element |
| 6713 */ | 7105 */ |
| 6714 AngularSelectorElementImpl(String name, int nameOffset) : super(name, nameOffs
et); | 7106 AngularSelectorElementImpl(String name, int nameOffset) : super(name, nameOffs
et); |
| 6715 | 7107 |
| 7108 @override |
| 6716 accept(ElementVisitor visitor) => visitor.visitAngularSelectorElement(this); | 7109 accept(ElementVisitor visitor) => visitor.visitAngularSelectorElement(this); |
| 6717 | 7110 |
| 7111 @override |
| 6718 ElementKind get kind => ElementKind.ANGULAR_SELECTOR; | 7112 ElementKind get kind => ElementKind.ANGULAR_SELECTOR; |
| 6719 } | 7113 } |
| 6720 | 7114 |
| 6721 /** | 7115 /** |
| 6722 * Implementation of [AngularSelectorElement] based on tag name. | 7116 * Implementation of [AngularSelectorElement] based on tag name. |
| 6723 */ | 7117 */ |
| 6724 class AngularTagSelectorElementImpl extends AngularSelectorElementImpl implement
s AngularTagSelectorElement { | 7118 class AngularTagSelectorElementImpl extends AngularSelectorElementImpl implement
s AngularTagSelectorElement { |
| 6725 AngularTagSelectorElementImpl(String name, int offset) : super(name, offset); | 7119 AngularTagSelectorElementImpl(String name, int offset) : super(name, offset); |
| 6726 | 7120 |
| 7121 @override |
| 6727 bool apply(XmlTagNode node) { | 7122 bool apply(XmlTagNode node) { |
| 6728 String tagName = name; | 7123 String tagName = name; |
| 6729 return node.tag == tagName; | 7124 return node.tag == tagName; |
| 6730 } | 7125 } |
| 6731 | 7126 |
| 7127 @override |
| 6732 AngularApplication get application => (enclosingElement as AngularElementImpl)
.application; | 7128 AngularApplication get application => (enclosingElement as AngularElementImpl)
.application; |
| 6733 } | 7129 } |
| 6734 | 7130 |
| 6735 /** | 7131 /** |
| 6736 * Implementation of `AngularViewElement`. | 7132 * Implementation of `AngularViewElement`. |
| 6737 */ | 7133 */ |
| 6738 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl
ement { | 7134 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl
ement { |
| 6739 /** | 7135 /** |
| 6740 * The HTML template URI. | 7136 * The HTML template URI. |
| 6741 */ | 7137 */ |
| 6742 final String templateUri; | 7138 final String templateUri; |
| 6743 | 7139 |
| 6744 /** | 7140 /** |
| 6745 * The offset of the [templateUri] in the [getSource]. | 7141 * The offset of the [templateUri] in the [getSource]. |
| 6746 */ | 7142 */ |
| 6747 final int templateUriOffset; | 7143 final int templateUriOffset; |
| 6748 | 7144 |
| 6749 /** | 7145 /** |
| 6750 * The HTML template source. | 7146 * The HTML template source. |
| 6751 */ | 7147 */ |
| 6752 Source templateSource; | 7148 Source templateSource; |
| 6753 | 7149 |
| 6754 /** | 7150 /** |
| 6755 * Initialize a newly created Angular view. | 7151 * Initialize a newly created Angular view. |
| 6756 */ | 7152 */ |
| 6757 AngularViewElementImpl(this.templateUri, this.templateUriOffset) : super(null,
-1); | 7153 AngularViewElementImpl(this.templateUri, this.templateUriOffset) : super(null,
-1); |
| 6758 | 7154 |
| 7155 @override |
| 6759 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this); | 7156 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this); |
| 6760 | 7157 |
| 7158 @override |
| 6761 ElementKind get kind => ElementKind.ANGULAR_VIEW; | 7159 ElementKind get kind => ElementKind.ANGULAR_VIEW; |
| 6762 | 7160 |
| 7161 @override |
| 6763 String get identifier => "AngularView@${templateUriOffset}"; | 7162 String get identifier => "AngularView@${templateUriOffset}"; |
| 6764 } | 7163 } |
| 6765 | 7164 |
| 6766 /** | 7165 /** |
| 6767 * Implementation of [AngularSelectorElement] based on presence of attribute. | 7166 * Implementation of [AngularSelectorElement] based on presence of attribute. |
| 6768 */ | 7167 */ |
| 6769 class HasAttributeSelectorElementImpl extends AngularSelectorElementImpl impleme
nts AngularHasAttributeSelectorElement { | 7168 class HasAttributeSelectorElementImpl extends AngularSelectorElementImpl impleme
nts AngularHasAttributeSelectorElement { |
| 6770 HasAttributeSelectorElementImpl(String attributeName, int offset) : super(attr
ibuteName, offset); | 7169 HasAttributeSelectorElementImpl(String attributeName, int offset) : super(attr
ibuteName, offset); |
| 6771 | 7170 |
| 7171 @override |
| 6772 bool apply(XmlTagNode node) { | 7172 bool apply(XmlTagNode node) { |
| 6773 String attributeName = name; | 7173 String attributeName = name; |
| 6774 return node.getAttribute(attributeName) != null; | 7174 return node.getAttribute(attributeName) != null; |
| 6775 } | 7175 } |
| 6776 | 7176 |
| 7177 @override |
| 6777 void appendTo(JavaStringBuilder builder) { | 7178 void appendTo(JavaStringBuilder builder) { |
| 6778 builder.append("["); | 7179 builder.append("["); |
| 6779 builder.append(name); | 7180 builder.append(name); |
| 6780 builder.append("]"); | 7181 builder.append("]"); |
| 6781 } | 7182 } |
| 6782 } | 7183 } |
| 6783 | 7184 |
| 6784 /** | 7185 /** |
| 6785 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme
ntImpl]. | 7186 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme
ntImpl]. |
| 6786 */ | 7187 */ |
| 6787 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl { | 7188 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl { |
| 6788 final String tagName; | 7189 final String tagName; |
| 6789 | 7190 |
| 6790 final String attributeName; | 7191 final String attributeName; |
| 6791 | 7192 |
| 6792 IsTagHasAttributeSelectorElementImpl(this.tagName, this.attributeName) : super
(null, -1); | 7193 IsTagHasAttributeSelectorElementImpl(this.tagName, this.attributeName) : super
(null, -1); |
| 6793 | 7194 |
| 7195 @override |
| 6794 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib
uteName) != null; | 7196 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib
uteName) != null; |
| 6795 } | 7197 } |
| 6796 | 7198 |
| 6797 /** | 7199 /** |
| 6798 * Instances of the class `ConstructorMember` represent a constructor element de
fined in a | 7200 * Instances of the class `ConstructorMember` represent a constructor element de
fined in a |
| 6799 * parameterized type where the values of the type parameters are known. | 7201 * parameterized type where the values of the type parameters are known. |
| 6800 */ | 7202 */ |
| 6801 class ConstructorMember extends ExecutableMember implements ConstructorElement { | 7203 class ConstructorMember extends ExecutableMember implements ConstructorElement { |
| 6802 /** | 7204 /** |
| 6803 * If the given constructor's type is different when any type parameters from
the defining type's | 7205 * If the given constructor's type is different when any type parameters from
the defining type's |
| (...skipping 27 matching lines...) Expand all Loading... |
| 6831 } | 7233 } |
| 6832 | 7234 |
| 6833 /** | 7235 /** |
| 6834 * Initialize a newly created element to represent a constructor of the given
parameterized type. | 7236 * Initialize a newly created element to represent a constructor of the given
parameterized type. |
| 6835 * | 7237 * |
| 6836 * @param baseElement the element on which the parameterized element was creat
ed | 7238 * @param baseElement the element on which the parameterized element was creat
ed |
| 6837 * @param definingType the type in which the element is defined | 7239 * @param definingType the type in which the element is defined |
| 6838 */ | 7240 */ |
| 6839 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType); | 7241 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType); |
| 6840 | 7242 |
| 7243 @override |
| 6841 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 7244 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
| 6842 | 7245 |
| 7246 @override |
| 6843 ConstructorElement get baseElement => super.baseElement as ConstructorElement; | 7247 ConstructorElement get baseElement => super.baseElement as ConstructorElement; |
| 6844 | 7248 |
| 7249 @override |
| 6845 ClassElement get enclosingElement => baseElement.enclosingElement; | 7250 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 6846 | 7251 |
| 7252 @override |
| 6847 ConstructorDeclaration get node => baseElement.node; | 7253 ConstructorDeclaration get node => baseElement.node; |
| 6848 | 7254 |
| 7255 @override |
| 6849 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); | 7256 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); |
| 6850 | 7257 |
| 7258 @override |
| 6851 bool get isConst => baseElement.isConst; | 7259 bool get isConst => baseElement.isConst; |
| 6852 | 7260 |
| 7261 @override |
| 6853 bool get isDefaultConstructor => baseElement.isDefaultConstructor; | 7262 bool get isDefaultConstructor => baseElement.isDefaultConstructor; |
| 6854 | 7263 |
| 7264 @override |
| 6855 bool get isFactory => baseElement.isFactory; | 7265 bool get isFactory => baseElement.isFactory; |
| 6856 | 7266 |
| 7267 @override |
| 6857 String toString() { | 7268 String toString() { |
| 6858 ConstructorElement baseElement = this.baseElement; | 7269 ConstructorElement baseElement = this.baseElement; |
| 6859 List<ParameterElement> parameters = this.parameters; | 7270 List<ParameterElement> parameters = this.parameters; |
| 6860 FunctionType type = this.type; | 7271 FunctionType type = this.type; |
| 6861 JavaStringBuilder builder = new JavaStringBuilder(); | 7272 JavaStringBuilder builder = new JavaStringBuilder(); |
| 6862 builder.append(baseElement.enclosingElement.displayName); | 7273 builder.append(baseElement.enclosingElement.displayName); |
| 6863 String name = displayName; | 7274 String name = displayName; |
| 6864 if (name != null && !name.isEmpty) { | 7275 if (name != null && !name.isEmpty) { |
| 6865 builder.append("."); | 7276 builder.append("."); |
| 6866 builder.append(name); | 7277 builder.append(name); |
| 6867 } | 7278 } |
| 6868 builder.append("("); | 7279 builder.append("("); |
| 6869 int parameterCount = parameters.length; | 7280 int parameterCount = parameters.length; |
| 6870 for (int i = 0; i < parameterCount; i++) { | 7281 for (int i = 0; i < parameterCount; i++) { |
| 6871 if (i > 0) { | 7282 if (i > 0) { |
| 6872 builder.append(", "); | 7283 builder.append(", "); |
| 6873 } | 7284 } |
| 6874 builder.append(parameters[i]).toString(); | 7285 builder.append(parameters[i]).toString(); |
| 6875 } | 7286 } |
| 6876 builder.append(")"); | 7287 builder.append(")"); |
| 6877 if (type != null) { | 7288 if (type != null) { |
| 6878 builder.append(Element.RIGHT_ARROW); | 7289 builder.append(Element.RIGHT_ARROW); |
| 6879 builder.append(type.returnType); | 7290 builder.append(type.returnType); |
| 6880 } | 7291 } |
| 6881 return builder.toString(); | 7292 return builder.toString(); |
| 6882 } | 7293 } |
| 6883 | 7294 |
| 7295 @override |
| 6884 InterfaceType get definingType => super.definingType as InterfaceType; | 7296 InterfaceType get definingType => super.definingType as InterfaceType; |
| 6885 } | 7297 } |
| 6886 | 7298 |
| 6887 /** | 7299 /** |
| 6888 * The abstract class `ExecutableMember` defines the behavior common to members
that represent | 7300 * The abstract class `ExecutableMember` defines the behavior common to members
that represent |
| 6889 * an executable element defined in a parameterized type where the values of the
type parameters are | 7301 * an executable element defined in a parameterized type where the values of the
type parameters are |
| 6890 * known. | 7302 * known. |
| 6891 */ | 7303 */ |
| 6892 abstract class ExecutableMember extends Member implements ExecutableElement { | 7304 abstract class ExecutableMember extends Member implements ExecutableElement { |
| 6893 /** | 7305 /** |
| 6894 * Initialize a newly created element to represent an executable element of th
e given | 7306 * Initialize a newly created element to represent an executable element of th
e given |
| 6895 * parameterized type. | 7307 * parameterized type. |
| 6896 * | 7308 * |
| 6897 * @param baseElement the element on which the parameterized element was creat
ed | 7309 * @param baseElement the element on which the parameterized element was creat
ed |
| 6898 * @param definingType the type in which the element is defined | 7310 * @param definingType the type in which the element is defined |
| 6899 */ | 7311 */ |
| 6900 ExecutableMember(ExecutableElement baseElement, InterfaceType definingType) :
super(baseElement, definingType); | 7312 ExecutableMember(ExecutableElement baseElement, InterfaceType definingType) :
super(baseElement, definingType); |
| 6901 | 7313 |
| 7314 @override |
| 6902 ExecutableElement get baseElement => super.baseElement as ExecutableElement; | 7315 ExecutableElement get baseElement => super.baseElement as ExecutableElement; |
| 6903 | 7316 |
| 7317 @override |
| 6904 List<FunctionElement> get functions { | 7318 List<FunctionElement> get functions { |
| 6905 // | 7319 // |
| 6906 // Elements within this element should have type parameters substituted, jus
t like this element. | 7320 // Elements within this element should have type parameters substituted, jus
t like this element. |
| 6907 // | 7321 // |
| 6908 throw new UnsupportedOperationException(); | 7322 throw new UnsupportedOperationException(); |
| 6909 } | 7323 } |
| 6910 | 7324 |
| 7325 @override |
| 6911 List<LabelElement> get labels => baseElement.labels; | 7326 List<LabelElement> get labels => baseElement.labels; |
| 6912 | 7327 |
| 7328 @override |
| 6913 List<LocalVariableElement> get localVariables { | 7329 List<LocalVariableElement> get localVariables { |
| 6914 // | 7330 // |
| 6915 // Elements within this element should have type parameters substituted, jus
t like this element. | 7331 // Elements within this element should have type parameters substituted, jus
t like this element. |
| 6916 // | 7332 // |
| 6917 throw new UnsupportedOperationException(); | 7333 throw new UnsupportedOperationException(); |
| 6918 } | 7334 } |
| 6919 | 7335 |
| 7336 @override |
| 6920 List<ParameterElement> get parameters { | 7337 List<ParameterElement> get parameters { |
| 6921 List<ParameterElement> baseParameters = baseElement.parameters; | 7338 List<ParameterElement> baseParameters = baseElement.parameters; |
| 6922 int parameterCount = baseParameters.length; | 7339 int parameterCount = baseParameters.length; |
| 6923 if (parameterCount == 0) { | 7340 if (parameterCount == 0) { |
| 6924 return baseParameters; | 7341 return baseParameters; |
| 6925 } | 7342 } |
| 6926 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 7343 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 6927 for (int i = 0; i < parameterCount; i++) { | 7344 for (int i = 0; i < parameterCount; i++) { |
| 6928 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 7345 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
| 6929 } | 7346 } |
| 6930 return parameterizedParameters; | 7347 return parameterizedParameters; |
| 6931 } | 7348 } |
| 6932 | 7349 |
| 7350 @override |
| 6933 DartType get returnType => substituteFor(baseElement.returnType); | 7351 DartType get returnType => substituteFor(baseElement.returnType); |
| 6934 | 7352 |
| 7353 @override |
| 6935 FunctionType get type => substituteFor(baseElement.type); | 7354 FunctionType get type => substituteFor(baseElement.type); |
| 6936 | 7355 |
| 7356 @override |
| 6937 bool get isOperator => baseElement.isOperator; | 7357 bool get isOperator => baseElement.isOperator; |
| 6938 | 7358 |
| 7359 @override |
| 6939 bool get isStatic => baseElement.isStatic; | 7360 bool get isStatic => baseElement.isStatic; |
| 6940 | 7361 |
| 7362 @override |
| 6941 void visitChildren(ElementVisitor visitor) { | 7363 void visitChildren(ElementVisitor visitor) { |
| 6942 // TODO(brianwilkerson) We need to finish implementing the accessors used be
low so that we can | 7364 // TODO(brianwilkerson) We need to finish implementing the accessors used be
low so that we can |
| 6943 // safely invoke them. | 7365 // safely invoke them. |
| 6944 super.visitChildren(visitor); | 7366 super.visitChildren(visitor); |
| 6945 safelyVisitChildren(baseElement.functions, visitor); | 7367 safelyVisitChildren(baseElement.functions, visitor); |
| 6946 safelyVisitChildren(labels, visitor); | 7368 safelyVisitChildren(labels, visitor); |
| 6947 safelyVisitChildren(baseElement.localVariables, visitor); | 7369 safelyVisitChildren(baseElement.localVariables, visitor); |
| 6948 safelyVisitChildren(parameters, visitor); | 7370 safelyVisitChildren(parameters, visitor); |
| 6949 } | 7371 } |
| 6950 } | 7372 } |
| 6951 | 7373 |
| 6952 /** | 7374 /** |
| 6953 * Instances of the class `FieldFormalParameterMember` represent a parameter ele
ment defined | 7375 * Instances of the class `FieldFormalParameterMember` represent a parameter ele
ment defined |
| 6954 * in a parameterized type where the values of the type parameters are known. | 7376 * in a parameterized type where the values of the type parameters are known. |
| 6955 */ | 7377 */ |
| 6956 class FieldFormalParameterMember extends ParameterMember implements FieldFormalP
arameterElement { | 7378 class FieldFormalParameterMember extends ParameterMember implements FieldFormalP
arameterElement { |
| 6957 /** | 7379 /** |
| 6958 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. | 7380 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. |
| 6959 * | 7381 * |
| 6960 * @param baseElement the element on which the parameterized element was creat
ed | 7382 * @param baseElement the element on which the parameterized element was creat
ed |
| 6961 * @param definingType the type in which the element is defined | 7383 * @param definingType the type in which the element is defined |
| 6962 */ | 7384 */ |
| 6963 FieldFormalParameterMember(FieldFormalParameterElement baseElement, Parameteri
zedType definingType) : super(baseElement, definingType); | 7385 FieldFormalParameterMember(FieldFormalParameterElement baseElement, Parameteri
zedType definingType) : super(baseElement, definingType); |
| 6964 | 7386 |
| 7387 @override |
| 6965 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); | 7388 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi
s); |
| 6966 | 7389 |
| 7390 @override |
| 6967 FieldElement get field => (baseElement as FieldFormalParameterElement).field; | 7391 FieldElement get field => (baseElement as FieldFormalParameterElement).field; |
| 6968 } | 7392 } |
| 6969 | 7393 |
| 6970 /** | 7394 /** |
| 6971 * Instances of the class `FieldMember` represent a field element defined in a p
arameterized | 7395 * Instances of the class `FieldMember` represent a field element defined in a p
arameterized |
| 6972 * type where the values of the type parameters are known. | 7396 * type where the values of the type parameters are known. |
| 6973 */ | 7397 */ |
| 6974 class FieldMember extends VariableMember implements FieldElement { | 7398 class FieldMember extends VariableMember implements FieldElement { |
| 6975 /** | 7399 /** |
| 6976 * If the given field's type is different when any type parameters from the de
fining type's | 7400 * If the given field's type is different when any type parameters from the de
fining type's |
| (...skipping 26 matching lines...) Expand all Loading... |
| 7003 } | 7427 } |
| 7004 | 7428 |
| 7005 /** | 7429 /** |
| 7006 * Initialize a newly created element to represent a field of the given parame
terized type. | 7430 * Initialize a newly created element to represent a field of the given parame
terized type. |
| 7007 * | 7431 * |
| 7008 * @param baseElement the element on which the parameterized element was creat
ed | 7432 * @param baseElement the element on which the parameterized element was creat
ed |
| 7009 * @param definingType the type in which the element is defined | 7433 * @param definingType the type in which the element is defined |
| 7010 */ | 7434 */ |
| 7011 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType); | 7435 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base
Element, definingType); |
| 7012 | 7436 |
| 7437 @override |
| 7013 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); | 7438 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); |
| 7014 | 7439 |
| 7440 @override |
| 7015 FieldElement get baseElement => super.baseElement as FieldElement; | 7441 FieldElement get baseElement => super.baseElement as FieldElement; |
| 7016 | 7442 |
| 7443 @override |
| 7017 ClassElement get enclosingElement => baseElement.enclosingElement; | 7444 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 7018 | 7445 |
| 7446 @override |
| 7019 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); | 7447 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.
getter, definingType); |
| 7020 | 7448 |
| 7449 @override |
| 7021 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); | 7450 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.
setter, definingType); |
| 7022 | 7451 |
| 7452 @override |
| 7023 bool get isStatic => baseElement.isStatic; | 7453 bool get isStatic => baseElement.isStatic; |
| 7024 | 7454 |
| 7455 @override |
| 7025 InterfaceType get definingType => super.definingType as InterfaceType; | 7456 InterfaceType get definingType => super.definingType as InterfaceType; |
| 7026 } | 7457 } |
| 7027 | 7458 |
| 7028 /** | 7459 /** |
| 7029 * The abstract class `Member` defines the behavior common to elements that repr
esent members | 7460 * The abstract class `Member` defines the behavior common to elements that repr
esent members |
| 7030 * of parameterized types. | 7461 * of parameterized types. |
| 7031 */ | 7462 */ |
| 7032 abstract class Member implements Element { | 7463 abstract class Member implements Element { |
| 7033 /** | 7464 /** |
| 7034 * The element on which the parameterized element was created. | 7465 * The element on which the parameterized element was created. |
| 7035 */ | 7466 */ |
| 7036 Element _baseElement; | 7467 Element _baseElement; |
| 7037 | 7468 |
| 7038 /** | 7469 /** |
| 7039 * The type in which the element is defined. | 7470 * The type in which the element is defined. |
| 7040 */ | 7471 */ |
| 7041 ParameterizedType _definingType; | 7472 ParameterizedType _definingType; |
| 7042 | 7473 |
| 7043 /** | 7474 /** |
| 7044 * Initialize a newly created element to represent the member of the given par
ameterized type. | 7475 * Initialize a newly created element to represent the member of the given par
ameterized type. |
| 7045 * | 7476 * |
| 7046 * @param baseElement the element on which the parameterized element was creat
ed | 7477 * @param baseElement the element on which the parameterized element was creat
ed |
| 7047 * @param definingType the type in which the element is defined | 7478 * @param definingType the type in which the element is defined |
| 7048 */ | 7479 */ |
| 7049 Member(Element baseElement, ParameterizedType definingType) { | 7480 Member(Element baseElement, ParameterizedType definingType) { |
| 7050 this._baseElement = baseElement; | 7481 this._baseElement = baseElement; |
| 7051 this._definingType = definingType; | 7482 this._definingType = definingType; |
| 7052 } | 7483 } |
| 7053 | 7484 |
| 7485 @override |
| 7054 String computeDocumentationComment() => _baseElement.computeDocumentationComme
nt(); | 7486 String computeDocumentationComment() => _baseElement.computeDocumentationComme
nt(); |
| 7055 | 7487 |
| 7488 @override |
| 7056 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p
redicate); | 7489 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p
redicate); |
| 7057 | 7490 |
| 7058 /** | 7491 /** |
| 7059 * Return the element on which the parameterized element was created. | 7492 * Return the element on which the parameterized element was created. |
| 7060 * | 7493 * |
| 7061 * @return the element on which the parameterized element was created | 7494 * @return the element on which the parameterized element was created |
| 7062 */ | 7495 */ |
| 7063 Element get baseElement => _baseElement; | 7496 Element get baseElement => _baseElement; |
| 7064 | 7497 |
| 7498 @override |
| 7065 AnalysisContext get context => _baseElement.context; | 7499 AnalysisContext get context => _baseElement.context; |
| 7066 | 7500 |
| 7501 @override |
| 7067 String get displayName => _baseElement.displayName; | 7502 String get displayName => _baseElement.displayName; |
| 7068 | 7503 |
| 7504 @override |
| 7069 ElementKind get kind => _baseElement.kind; | 7505 ElementKind get kind => _baseElement.kind; |
| 7070 | 7506 |
| 7507 @override |
| 7071 LibraryElement get library => _baseElement.library; | 7508 LibraryElement get library => _baseElement.library; |
| 7072 | 7509 |
| 7510 @override |
| 7073 ElementLocation get location => _baseElement.location; | 7511 ElementLocation get location => _baseElement.location; |
| 7074 | 7512 |
| 7513 @override |
| 7075 List<ElementAnnotation> get metadata => _baseElement.metadata; | 7514 List<ElementAnnotation> get metadata => _baseElement.metadata; |
| 7076 | 7515 |
| 7516 @override |
| 7077 String get name => _baseElement.name; | 7517 String get name => _baseElement.name; |
| 7078 | 7518 |
| 7519 @override |
| 7079 int get nameOffset => _baseElement.nameOffset; | 7520 int get nameOffset => _baseElement.nameOffset; |
| 7080 | 7521 |
| 7522 @override |
| 7081 AstNode get node => _baseElement.node; | 7523 AstNode get node => _baseElement.node; |
| 7082 | 7524 |
| 7525 @override |
| 7083 Source get source => _baseElement.source; | 7526 Source get source => _baseElement.source; |
| 7084 | 7527 |
| 7528 @override |
| 7085 CompilationUnit get unit => _baseElement.unit; | 7529 CompilationUnit get unit => _baseElement.unit; |
| 7086 | 7530 |
| 7531 @override |
| 7087 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); | 7532 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); |
| 7088 | 7533 |
| 7534 @override |
| 7089 bool get isDeprecated => _baseElement.isDeprecated; | 7535 bool get isDeprecated => _baseElement.isDeprecated; |
| 7090 | 7536 |
| 7537 @override |
| 7091 bool get isOverride => _baseElement.isOverride; | 7538 bool get isOverride => _baseElement.isOverride; |
| 7092 | 7539 |
| 7540 @override |
| 7093 bool get isPrivate => _baseElement.isPrivate; | 7541 bool get isPrivate => _baseElement.isPrivate; |
| 7094 | 7542 |
| 7543 @override |
| 7095 bool get isPublic => _baseElement.isPublic; | 7544 bool get isPublic => _baseElement.isPublic; |
| 7096 | 7545 |
| 7546 @override |
| 7097 bool get isSynthetic => _baseElement.isSynthetic; | 7547 bool get isSynthetic => _baseElement.isSynthetic; |
| 7098 | 7548 |
| 7549 @override |
| 7099 void visitChildren(ElementVisitor visitor) { | 7550 void visitChildren(ElementVisitor visitor) { |
| 7100 } | 7551 } |
| 7101 | 7552 |
| 7102 /** | 7553 /** |
| 7103 * Return the type in which the element is defined. | 7554 * Return the type in which the element is defined. |
| 7104 * | 7555 * |
| 7105 * @return the type in which the element is defined | 7556 * @return the type in which the element is defined |
| 7106 */ | 7557 */ |
| 7107 ParameterizedType get definingType => _definingType; | 7558 ParameterizedType get definingType => _definingType; |
| 7108 | 7559 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7195 } | 7646 } |
| 7196 | 7647 |
| 7197 /** | 7648 /** |
| 7198 * Initialize a newly created element to represent a method of the given param
eterized type. | 7649 * Initialize a newly created element to represent a method of the given param
eterized type. |
| 7199 * | 7650 * |
| 7200 * @param baseElement the element on which the parameterized element was creat
ed | 7651 * @param baseElement the element on which the parameterized element was creat
ed |
| 7201 * @param definingType the type in which the element is defined | 7652 * @param definingType the type in which the element is defined |
| 7202 */ | 7653 */ |
| 7203 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType); | 7654 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType); |
| 7204 | 7655 |
| 7656 @override |
| 7205 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 7657 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
| 7206 | 7658 |
| 7659 @override |
| 7207 MethodElement get baseElement => super.baseElement as MethodElement; | 7660 MethodElement get baseElement => super.baseElement as MethodElement; |
| 7208 | 7661 |
| 7662 @override |
| 7209 ClassElement get enclosingElement => baseElement.enclosingElement; | 7663 ClassElement get enclosingElement => baseElement.enclosingElement; |
| 7210 | 7664 |
| 7665 @override |
| 7211 MethodDeclaration get node => baseElement.node; | 7666 MethodDeclaration get node => baseElement.node; |
| 7212 | 7667 |
| 7668 @override |
| 7213 bool get isAbstract => baseElement.isAbstract; | 7669 bool get isAbstract => baseElement.isAbstract; |
| 7214 | 7670 |
| 7671 @override |
| 7215 String toString() { | 7672 String toString() { |
| 7216 MethodElement baseElement = this.baseElement; | 7673 MethodElement baseElement = this.baseElement; |
| 7217 List<ParameterElement> parameters = this.parameters; | 7674 List<ParameterElement> parameters = this.parameters; |
| 7218 FunctionType type = this.type; | 7675 FunctionType type = this.type; |
| 7219 JavaStringBuilder builder = new JavaStringBuilder(); | 7676 JavaStringBuilder builder = new JavaStringBuilder(); |
| 7220 builder.append(baseElement.enclosingElement.displayName); | 7677 builder.append(baseElement.enclosingElement.displayName); |
| 7221 builder.append("."); | 7678 builder.append("."); |
| 7222 builder.append(baseElement.displayName); | 7679 builder.append(baseElement.displayName); |
| 7223 builder.append("("); | 7680 builder.append("("); |
| 7224 int parameterCount = parameters.length; | 7681 int parameterCount = parameters.length; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7278 } | 7735 } |
| 7279 | 7736 |
| 7280 /** | 7737 /** |
| 7281 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. | 7738 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. |
| 7282 * | 7739 * |
| 7283 * @param baseElement the element on which the parameterized element was creat
ed | 7740 * @param baseElement the element on which the parameterized element was creat
ed |
| 7284 * @param definingType the type in which the element is defined | 7741 * @param definingType the type in which the element is defined |
| 7285 */ | 7742 */ |
| 7286 ParameterMember(ParameterElement baseElement, ParameterizedType definingType)
: super(baseElement, definingType); | 7743 ParameterMember(ParameterElement baseElement, ParameterizedType definingType)
: super(baseElement, definingType); |
| 7287 | 7744 |
| 7745 @override |
| 7288 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); | 7746 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); |
| 7289 | 7747 |
| 7748 @override |
| 7290 Element getAncestor(Predicate<Element> predicate) { | 7749 Element getAncestor(Predicate<Element> predicate) { |
| 7291 Element element = baseElement.getAncestor(predicate); | 7750 Element element = baseElement.getAncestor(predicate); |
| 7292 ParameterizedType definingType = this.definingType; | 7751 ParameterizedType definingType = this.definingType; |
| 7293 if (definingType is InterfaceType) { | 7752 if (definingType is InterfaceType) { |
| 7294 InterfaceType definingInterfaceType = definingType; | 7753 InterfaceType definingInterfaceType = definingType; |
| 7295 if (element is ConstructorElement) { | 7754 if (element is ConstructorElement) { |
| 7296 return ConstructorMember.from(element, definingInterfaceType); | 7755 return ConstructorMember.from(element, definingInterfaceType); |
| 7297 } else if (element is MethodElement) { | 7756 } else if (element is MethodElement) { |
| 7298 return MethodMember.from(element, definingInterfaceType); | 7757 return MethodMember.from(element, definingInterfaceType); |
| 7299 } else if (element is PropertyAccessorElement) { | 7758 } else if (element is PropertyAccessorElement) { |
| 7300 return PropertyAccessorMember.from(element, definingInterfaceType); | 7759 return PropertyAccessorMember.from(element, definingInterfaceType); |
| 7301 } | 7760 } |
| 7302 } | 7761 } |
| 7303 return element; | 7762 return element; |
| 7304 } | 7763 } |
| 7305 | 7764 |
| 7765 @override |
| 7306 ParameterElement get baseElement => super.baseElement as ParameterElement; | 7766 ParameterElement get baseElement => super.baseElement as ParameterElement; |
| 7307 | 7767 |
| 7768 @override |
| 7308 SourceRange get defaultValueRange => baseElement.defaultValueRange; | 7769 SourceRange get defaultValueRange => baseElement.defaultValueRange; |
| 7309 | 7770 |
| 7771 @override |
| 7310 Element get enclosingElement => baseElement.enclosingElement; | 7772 Element get enclosingElement => baseElement.enclosingElement; |
| 7311 | 7773 |
| 7774 @override |
| 7312 ParameterKind get parameterKind => baseElement.parameterKind; | 7775 ParameterKind get parameterKind => baseElement.parameterKind; |
| 7313 | 7776 |
| 7777 @override |
| 7314 List<ParameterElement> get parameters { | 7778 List<ParameterElement> get parameters { |
| 7315 List<ParameterElement> baseParameters = baseElement.parameters; | 7779 List<ParameterElement> baseParameters = baseElement.parameters; |
| 7316 int parameterCount = baseParameters.length; | 7780 int parameterCount = baseParameters.length; |
| 7317 if (parameterCount == 0) { | 7781 if (parameterCount == 0) { |
| 7318 return baseParameters; | 7782 return baseParameters; |
| 7319 } | 7783 } |
| 7320 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 7784 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 7321 for (int i = 0; i < parameterCount; i++) { | 7785 for (int i = 0; i < parameterCount; i++) { |
| 7322 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 7786 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
| 7323 } | 7787 } |
| 7324 return parameterizedParameters; | 7788 return parameterizedParameters; |
| 7325 } | 7789 } |
| 7326 | 7790 |
| 7791 @override |
| 7327 SourceRange get visibleRange => baseElement.visibleRange; | 7792 SourceRange get visibleRange => baseElement.visibleRange; |
| 7328 | 7793 |
| 7794 @override |
| 7329 bool get isInitializingFormal => baseElement.isInitializingFormal; | 7795 bool get isInitializingFormal => baseElement.isInitializingFormal; |
| 7330 | 7796 |
| 7797 @override |
| 7331 String toString() { | 7798 String toString() { |
| 7332 ParameterElement baseElement = this.baseElement; | 7799 ParameterElement baseElement = this.baseElement; |
| 7333 String left = ""; | 7800 String left = ""; |
| 7334 String right = ""; | 7801 String right = ""; |
| 7335 while (true) { | 7802 while (true) { |
| 7336 if (baseElement.parameterKind == ParameterKind.NAMED) { | 7803 if (baseElement.parameterKind == ParameterKind.NAMED) { |
| 7337 left = "{"; | 7804 left = "{"; |
| 7338 right = "}"; | 7805 right = "}"; |
| 7339 } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) { | 7806 } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) { |
| 7340 left = "["; | 7807 left = "["; |
| 7341 right = "]"; | 7808 right = "]"; |
| 7342 } else if (baseElement.parameterKind == ParameterKind.REQUIRED) { | 7809 } else if (baseElement.parameterKind == ParameterKind.REQUIRED) { |
| 7343 } | 7810 } |
| 7344 break; | 7811 break; |
| 7345 } | 7812 } |
| 7346 JavaStringBuilder builder = new JavaStringBuilder(); | 7813 JavaStringBuilder builder = new JavaStringBuilder(); |
| 7347 builder.append(left); | 7814 builder.append(left); |
| 7348 builder.append(type); | 7815 builder.append(type); |
| 7349 builder.append(" "); | 7816 builder.append(" "); |
| 7350 builder.append(baseElement.displayName); | 7817 builder.append(baseElement.displayName); |
| 7351 builder.append(right); | 7818 builder.append(right); |
| 7352 return builder.toString(); | 7819 return builder.toString(); |
| 7353 } | 7820 } |
| 7354 | 7821 |
| 7822 @override |
| 7355 void visitChildren(ElementVisitor visitor) { | 7823 void visitChildren(ElementVisitor visitor) { |
| 7356 super.visitChildren(visitor); | 7824 super.visitChildren(visitor); |
| 7357 safelyVisitChildren(parameters, visitor); | 7825 safelyVisitChildren(parameters, visitor); |
| 7358 } | 7826 } |
| 7359 } | 7827 } |
| 7360 | 7828 |
| 7361 /** | 7829 /** |
| 7362 * Instances of the class `PropertyAccessorMember` represent a property accessor
element | 7830 * Instances of the class `PropertyAccessorMember` represent a property accessor
element |
| 7363 * defined in a parameterized type where the values of the type parameters are k
nown. | 7831 * defined in a parameterized type where the values of the type parameters are k
nown. |
| 7364 */ | 7832 */ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 7392 | 7860 |
| 7393 /** | 7861 /** |
| 7394 * Initialize a newly created element to represent a property accessor of the
given parameterized | 7862 * Initialize a newly created element to represent a property accessor of the
given parameterized |
| 7395 * type. | 7863 * type. |
| 7396 * | 7864 * |
| 7397 * @param baseElement the element on which the parameterized element was creat
ed | 7865 * @param baseElement the element on which the parameterized element was creat
ed |
| 7398 * @param definingType the type in which the element is defined | 7866 * @param definingType the type in which the element is defined |
| 7399 */ | 7867 */ |
| 7400 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi
ningType) : super(baseElement, definingType); | 7868 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi
ningType) : super(baseElement, definingType); |
| 7401 | 7869 |
| 7870 @override |
| 7402 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 7871 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 7403 | 7872 |
| 7873 @override |
| 7404 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess
orElement; | 7874 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess
orElement; |
| 7405 | 7875 |
| 7876 @override |
| 7406 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); | 7877 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); |
| 7407 | 7878 |
| 7879 @override |
| 7408 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); | 7880 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); |
| 7409 | 7881 |
| 7882 @override |
| 7410 Element get enclosingElement => baseElement.enclosingElement; | 7883 Element get enclosingElement => baseElement.enclosingElement; |
| 7411 | 7884 |
| 7885 @override |
| 7412 PropertyInducingElement get variable { | 7886 PropertyInducingElement get variable { |
| 7413 PropertyInducingElement variable = baseElement.variable; | 7887 PropertyInducingElement variable = baseElement.variable; |
| 7414 if (variable is FieldElement) { | 7888 if (variable is FieldElement) { |
| 7415 return FieldMember.from(variable, definingType); | 7889 return FieldMember.from(variable, definingType); |
| 7416 } | 7890 } |
| 7417 return variable; | 7891 return variable; |
| 7418 } | 7892 } |
| 7419 | 7893 |
| 7894 @override |
| 7420 bool get isAbstract => baseElement.isAbstract; | 7895 bool get isAbstract => baseElement.isAbstract; |
| 7421 | 7896 |
| 7897 @override |
| 7422 bool get isGetter => baseElement.isGetter; | 7898 bool get isGetter => baseElement.isGetter; |
| 7423 | 7899 |
| 7900 @override |
| 7424 bool get isSetter => baseElement.isSetter; | 7901 bool get isSetter => baseElement.isSetter; |
| 7425 | 7902 |
| 7903 @override |
| 7426 String toString() { | 7904 String toString() { |
| 7427 PropertyAccessorElement baseElement = this.baseElement; | 7905 PropertyAccessorElement baseElement = this.baseElement; |
| 7428 List<ParameterElement> parameters = this.parameters; | 7906 List<ParameterElement> parameters = this.parameters; |
| 7429 FunctionType type = this.type; | 7907 FunctionType type = this.type; |
| 7430 JavaStringBuilder builder = new JavaStringBuilder(); | 7908 JavaStringBuilder builder = new JavaStringBuilder(); |
| 7431 if (isGetter) { | 7909 if (isGetter) { |
| 7432 builder.append("get "); | 7910 builder.append("get "); |
| 7433 } else { | 7911 } else { |
| 7434 builder.append("set "); | 7912 builder.append("set "); |
| 7435 } | 7913 } |
| 7436 builder.append(baseElement.enclosingElement.displayName); | 7914 builder.append(baseElement.enclosingElement.displayName); |
| 7437 builder.append("."); | 7915 builder.append("."); |
| 7438 builder.append(baseElement.displayName); | 7916 builder.append(baseElement.displayName); |
| 7439 builder.append("("); | 7917 builder.append("("); |
| 7440 int parameterCount = parameters.length; | 7918 int parameterCount = parameters.length; |
| 7441 for (int i = 0; i < parameterCount; i++) { | 7919 for (int i = 0; i < parameterCount; i++) { |
| 7442 if (i > 0) { | 7920 if (i > 0) { |
| 7443 builder.append(", "); | 7921 builder.append(", "); |
| 7444 } | 7922 } |
| 7445 builder.append(parameters[i]).toString(); | 7923 builder.append(parameters[i]).toString(); |
| 7446 } | 7924 } |
| 7447 builder.append(")"); | 7925 builder.append(")"); |
| 7448 if (type != null) { | 7926 if (type != null) { |
| 7449 builder.append(Element.RIGHT_ARROW); | 7927 builder.append(Element.RIGHT_ARROW); |
| 7450 builder.append(type.returnType); | 7928 builder.append(type.returnType); |
| 7451 } | 7929 } |
| 7452 return builder.toString(); | 7930 return builder.toString(); |
| 7453 } | 7931 } |
| 7454 | 7932 |
| 7933 @override |
| 7455 InterfaceType get definingType => super.definingType as InterfaceType; | 7934 InterfaceType get definingType => super.definingType as InterfaceType; |
| 7456 } | 7935 } |
| 7457 | 7936 |
| 7458 /** | 7937 /** |
| 7459 * The abstract class `VariableMember` defines the behavior common to members th
at represent a | 7938 * The abstract class `VariableMember` defines the behavior common to members th
at represent a |
| 7460 * variable element defined in a parameterized type where the values of the type
parameters are | 7939 * variable element defined in a parameterized type where the values of the type
parameters are |
| 7461 * known. | 7940 * known. |
| 7462 */ | 7941 */ |
| 7463 abstract class VariableMember extends Member implements VariableElement { | 7942 abstract class VariableMember extends Member implements VariableElement { |
| 7464 /** | 7943 /** |
| 7465 * Initialize a newly created element to represent an executable element of th
e given | 7944 * Initialize a newly created element to represent an executable element of th
e given |
| 7466 * parameterized type. | 7945 * parameterized type. |
| 7467 * | 7946 * |
| 7468 * @param baseElement the element on which the parameterized element was creat
ed | 7947 * @param baseElement the element on which the parameterized element was creat
ed |
| 7469 * @param definingType the type in which the element is defined | 7948 * @param definingType the type in which the element is defined |
| 7470 */ | 7949 */ |
| 7471 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType); | 7950 VariableMember(VariableElement baseElement, ParameterizedType definingType) :
super(baseElement, definingType); |
| 7472 | 7951 |
| 7952 @override |
| 7473 VariableElement get baseElement => super.baseElement as VariableElement; | 7953 VariableElement get baseElement => super.baseElement as VariableElement; |
| 7474 | 7954 |
| 7955 @override |
| 7475 FunctionElement get initializer { | 7956 FunctionElement get initializer { |
| 7476 // | 7957 // |
| 7477 // Elements within this element should have type parameters substituted, jus
t like this element. | 7958 // Elements within this element should have type parameters substituted, jus
t like this element. |
| 7478 // | 7959 // |
| 7479 throw new UnsupportedOperationException(); | 7960 throw new UnsupportedOperationException(); |
| 7480 } | 7961 } |
| 7481 | 7962 |
| 7963 @override |
| 7482 VariableDeclaration get node => baseElement.node; | 7964 VariableDeclaration get node => baseElement.node; |
| 7483 | 7965 |
| 7966 @override |
| 7484 DartType get type => substituteFor(baseElement.type); | 7967 DartType get type => substituteFor(baseElement.type); |
| 7485 | 7968 |
| 7969 @override |
| 7486 bool get isConst => baseElement.isConst; | 7970 bool get isConst => baseElement.isConst; |
| 7487 | 7971 |
| 7972 @override |
| 7488 bool get isFinal => baseElement.isFinal; | 7973 bool get isFinal => baseElement.isFinal; |
| 7489 | 7974 |
| 7975 @override |
| 7490 void visitChildren(ElementVisitor visitor) { | 7976 void visitChildren(ElementVisitor visitor) { |
| 7491 // TODO(brianwilkerson) We need to finish implementing the accessors used be
low so that we can | 7977 // TODO(brianwilkerson) We need to finish implementing the accessors used be
low so that we can |
| 7492 // safely invoke them. | 7978 // safely invoke them. |
| 7493 super.visitChildren(visitor); | 7979 super.visitChildren(visitor); |
| 7494 safelyVisitChild(baseElement.initializer, visitor); | 7980 safelyVisitChild(baseElement.initializer, visitor); |
| 7495 } | 7981 } |
| 7496 } | 7982 } |
| 7497 | 7983 |
| 7498 /** | 7984 /** |
| 7499 * The unique instance of the class `BottomTypeImpl` implements the type `bottom
`. | 7985 * The unique instance of the class `BottomTypeImpl` implements the type `bottom
`. |
| 7500 */ | 7986 */ |
| 7501 class BottomTypeImpl extends TypeImpl { | 7987 class BottomTypeImpl extends TypeImpl { |
| 7502 /** | 7988 /** |
| 7503 * The unique instance of this class. | 7989 * The unique instance of this class. |
| 7504 */ | 7990 */ |
| 7505 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); | 7991 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); |
| 7506 | 7992 |
| 7507 /** | 7993 /** |
| 7508 * Return the unique instance of this class. | 7994 * Return the unique instance of this class. |
| 7509 * | 7995 * |
| 7510 * @return the unique instance of this class | 7996 * @return the unique instance of this class |
| 7511 */ | 7997 */ |
| 7512 static BottomTypeImpl get instance => _INSTANCE; | 7998 static BottomTypeImpl get instance => _INSTANCE; |
| 7513 | 7999 |
| 7514 /** | 8000 /** |
| 7515 * Prevent the creation of instances of this class. | 8001 * Prevent the creation of instances of this class. |
| 7516 */ | 8002 */ |
| 7517 BottomTypeImpl() : super(null, "<bottom>"); | 8003 BottomTypeImpl() : super(null, "<bottom>"); |
| 7518 | 8004 |
| 8005 @override |
| 7519 bool operator ==(Object object) => identical(object, this); | 8006 bool operator ==(Object object) => identical(object, this); |
| 7520 | 8007 |
| 8008 @override |
| 7521 int get hashCode => 0; | 8009 int get hashCode => 0; |
| 7522 | 8010 |
| 8011 @override |
| 7523 bool get isBottom => true; | 8012 bool get isBottom => true; |
| 7524 | 8013 |
| 8014 @override |
| 7525 bool isSupertypeOf(DartType type) => false; | 8015 bool isSupertypeOf(DartType type) => false; |
| 7526 | 8016 |
| 8017 @override |
| 7527 BottomTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parame
terTypes) => this; | 8018 BottomTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> parame
terTypes) => this; |
| 7528 | 8019 |
| 8020 @override |
| 7529 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); | 8021 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); |
| 7530 | 8022 |
| 8023 @override |
| 7531 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) => true; | 8024 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) => true; |
| 7532 | 8025 |
| 8026 @override |
| 7533 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => true; | 8027 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => true; |
| 7534 } | 8028 } |
| 7535 | 8029 |
| 7536 /** | 8030 /** |
| 7537 * The unique instance of the class `DynamicTypeImpl` implements the type `dynam
ic`. | 8031 * The unique instance of the class `DynamicTypeImpl` implements the type `dynam
ic`. |
| 7538 */ | 8032 */ |
| 7539 class DynamicTypeImpl extends TypeImpl { | 8033 class DynamicTypeImpl extends TypeImpl { |
| 7540 /** | 8034 /** |
| 7541 * The unique instance of this class. | 8035 * The unique instance of this class. |
| 7542 */ | 8036 */ |
| 7543 static DynamicTypeImpl _INSTANCE = new DynamicTypeImpl(); | 8037 static DynamicTypeImpl _INSTANCE = new DynamicTypeImpl(); |
| 7544 | 8038 |
| 7545 /** | 8039 /** |
| 7546 * Return the unique instance of this class. | 8040 * Return the unique instance of this class. |
| 7547 * | 8041 * |
| 7548 * @return the unique instance of this class | 8042 * @return the unique instance of this class |
| 7549 */ | 8043 */ |
| 7550 static DynamicTypeImpl get instance => _INSTANCE; | 8044 static DynamicTypeImpl get instance => _INSTANCE; |
| 7551 | 8045 |
| 7552 /** | 8046 /** |
| 7553 * Prevent the creation of instances of this class. | 8047 * Prevent the creation of instances of this class. |
| 7554 */ | 8048 */ |
| 7555 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { | 8049 DynamicTypeImpl() : super(new DynamicElementImpl(), Keyword.DYNAMIC.syntax) { |
| 7556 (element as DynamicElementImpl).type = this; | 8050 (element as DynamicElementImpl).type = this; |
| 7557 } | 8051 } |
| 7558 | 8052 |
| 8053 @override |
| 7559 bool operator ==(Object object) => identical(object, this); | 8054 bool operator ==(Object object) => identical(object, this); |
| 7560 | 8055 |
| 8056 @override |
| 7561 int get hashCode => 1; | 8057 int get hashCode => 1; |
| 7562 | 8058 |
| 8059 @override |
| 7563 bool get isDynamic => true; | 8060 bool get isDynamic => true; |
| 7564 | 8061 |
| 8062 @override |
| 7565 bool isSupertypeOf(DartType type) => true; | 8063 bool isSupertypeOf(DartType type) => true; |
| 7566 | 8064 |
| 8065 @override |
| 7567 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es) { | 8066 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es) { |
| 7568 int length = parameterTypes.length; | 8067 int length = parameterTypes.length; |
| 7569 for (int i = 0; i < length; i++) { | 8068 for (int i = 0; i < length; i++) { |
| 7570 if (parameterTypes[i] == this) { | 8069 if (parameterTypes[i] == this) { |
| 7571 return argumentTypes[i]; | 8070 return argumentTypes[i]; |
| 7572 } | 8071 } |
| 7573 } | 8072 } |
| 7574 return this; | 8073 return this; |
| 7575 } | 8074 } |
| 7576 | 8075 |
| 8076 @override |
| 7577 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); | 8077 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); |
| 7578 | 8078 |
| 8079 @override |
| 7579 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { | 8080 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { |
| 7580 // T is S | 8081 // T is S |
| 7581 if (identical(this, type)) { | 8082 if (identical(this, type)) { |
| 7582 return true; | 8083 return true; |
| 7583 } | 8084 } |
| 7584 // else | 8085 // else |
| 7585 return withDynamic; | 8086 return withDynamic; |
| 7586 } | 8087 } |
| 7587 | 8088 |
| 8089 @override |
| 7588 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => true; | 8090 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => true; |
| 7589 } | 8091 } |
| 7590 | 8092 |
| 7591 /** | 8093 /** |
| 7592 * Instances of the class `FunctionTypeImpl` defines the behavior common to obje
cts | 8094 * Instances of the class `FunctionTypeImpl` defines the behavior common to obje
cts |
| 7593 * representing the type of a function, method, constructor, getter, or setter. | 8095 * representing the type of a function, method, constructor, getter, or setter. |
| 7594 */ | 8096 */ |
| 7595 class FunctionTypeImpl extends TypeImpl implements FunctionType { | 8097 class FunctionTypeImpl extends TypeImpl implements FunctionType { |
| 7596 /** | 8098 /** |
| 7597 * Return `true` if all of the name/type pairs in the first map are equal to t
he | 8099 * Return `true` if all of the name/type pairs in the first map are equal to t
he |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7634 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n
ull ? null : element.name); | 8136 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n
ull ? null : element.name); |
| 7635 | 8137 |
| 7636 /** | 8138 /** |
| 7637 * Initialize a newly created function type to be declared by the given elemen
t and to have the | 8139 * Initialize a newly created function type to be declared by the given elemen
t and to have the |
| 7638 * given name. | 8140 * given name. |
| 7639 * | 8141 * |
| 7640 * @param element the element representing the declaration of the function typ
e | 8142 * @param element the element representing the declaration of the function typ
e |
| 7641 */ | 8143 */ |
| 7642 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme
nt == null ? null : element.name); | 8144 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme
nt == null ? null : element.name); |
| 7643 | 8145 |
| 8146 @override |
| 7644 bool operator ==(Object object) => internalEquals(object, new Set<ElementPair>
()); | 8147 bool operator ==(Object object) => internalEquals(object, new Set<ElementPair>
()); |
| 7645 | 8148 |
| 8149 @override |
| 7646 String get displayName { | 8150 String get displayName { |
| 7647 String name = this.name; | 8151 String name = this.name; |
| 7648 if (name == null || name.length == 0) { | 8152 if (name == null || name.length == 0) { |
| 7649 // TODO(brianwilkerson) Determine whether function types should ever have
an empty name. | 8153 // TODO(brianwilkerson) Determine whether function types should ever have
an empty name. |
| 7650 List<DartType> normalParameterTypes = this.normalParameterTypes; | 8154 List<DartType> normalParameterTypes = this.normalParameterTypes; |
| 7651 List<DartType> optionalParameterTypes = this.optionalParameterTypes; | 8155 List<DartType> optionalParameterTypes = this.optionalParameterTypes; |
| 7652 Map<String, DartType> namedParameterTypes = this.namedParameterTypes; | 8156 Map<String, DartType> namedParameterTypes = this.namedParameterTypes; |
| 7653 DartType returnType = this.returnType; | 8157 DartType returnType = this.returnType; |
| 7654 JavaStringBuilder builder = new JavaStringBuilder(); | 8158 JavaStringBuilder builder = new JavaStringBuilder(); |
| 7655 builder.append("("); | 8159 builder.append("("); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7705 if (returnType == null) { | 8209 if (returnType == null) { |
| 7706 builder.append("null"); | 8210 builder.append("null"); |
| 7707 } else { | 8211 } else { |
| 7708 builder.append(returnType.displayName); | 8212 builder.append(returnType.displayName); |
| 7709 } | 8213 } |
| 7710 name = builder.toString(); | 8214 name = builder.toString(); |
| 7711 } | 8215 } |
| 7712 return name; | 8216 return name; |
| 7713 } | 8217 } |
| 7714 | 8218 |
| 8219 @override |
| 7715 Map<String, DartType> get namedParameterTypes { | 8220 Map<String, DartType> get namedParameterTypes { |
| 7716 LinkedHashMap<String, DartType> namedParameterTypes = new LinkedHashMap<Stri
ng, DartType>(); | 8221 LinkedHashMap<String, DartType> namedParameterTypes = new LinkedHashMap<Stri
ng, DartType>(); |
| 7717 List<ParameterElement> parameters = baseParameters; | 8222 List<ParameterElement> parameters = baseParameters; |
| 7718 if (parameters.length == 0) { | 8223 if (parameters.length == 0) { |
| 7719 return namedParameterTypes; | 8224 return namedParameterTypes; |
| 7720 } | 8225 } |
| 7721 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8226 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 7722 for (ParameterElement parameter in parameters) { | 8227 for (ParameterElement parameter in parameters) { |
| 7723 if (identical(parameter.parameterKind, ParameterKind.NAMED)) { | 8228 if (identical(parameter.parameterKind, ParameterKind.NAMED)) { |
| 7724 namedParameterTypes[parameter.name] = parameter.type.substitute2(typeArg
uments, typeParameters); | 8229 namedParameterTypes[parameter.name] = parameter.type.substitute2(typeArg
uments, typeParameters); |
| 7725 } | 8230 } |
| 7726 } | 8231 } |
| 7727 return namedParameterTypes; | 8232 return namedParameterTypes; |
| 7728 } | 8233 } |
| 7729 | 8234 |
| 8235 @override |
| 7730 List<DartType> get normalParameterTypes { | 8236 List<DartType> get normalParameterTypes { |
| 7731 List<ParameterElement> parameters = baseParameters; | 8237 List<ParameterElement> parameters = baseParameters; |
| 7732 if (parameters.length == 0) { | 8238 if (parameters.length == 0) { |
| 7733 return TypeImpl.EMPTY_ARRAY; | 8239 return TypeImpl.EMPTY_ARRAY; |
| 7734 } | 8240 } |
| 7735 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8241 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 7736 List<DartType> types = new List<DartType>(); | 8242 List<DartType> types = new List<DartType>(); |
| 7737 for (ParameterElement parameter in parameters) { | 8243 for (ParameterElement parameter in parameters) { |
| 7738 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { | 8244 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { |
| 7739 types.add(parameter.type.substitute2(typeArguments, typeParameters)); | 8245 types.add(parameter.type.substitute2(typeArguments, typeParameters)); |
| 7740 } | 8246 } |
| 7741 } | 8247 } |
| 7742 return new List.from(types); | 8248 return new List.from(types); |
| 7743 } | 8249 } |
| 7744 | 8250 |
| 8251 @override |
| 7745 List<DartType> get optionalParameterTypes { | 8252 List<DartType> get optionalParameterTypes { |
| 7746 List<ParameterElement> parameters = baseParameters; | 8253 List<ParameterElement> parameters = baseParameters; |
| 7747 if (parameters.length == 0) { | 8254 if (parameters.length == 0) { |
| 7748 return TypeImpl.EMPTY_ARRAY; | 8255 return TypeImpl.EMPTY_ARRAY; |
| 7749 } | 8256 } |
| 7750 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8257 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 7751 List<DartType> types = new List<DartType>(); | 8258 List<DartType> types = new List<DartType>(); |
| 7752 for (ParameterElement parameter in parameters) { | 8259 for (ParameterElement parameter in parameters) { |
| 7753 if (identical(parameter.parameterKind, ParameterKind.POSITIONAL)) { | 8260 if (identical(parameter.parameterKind, ParameterKind.POSITIONAL)) { |
| 7754 types.add(parameter.type.substitute2(typeArguments, typeParameters)); | 8261 types.add(parameter.type.substitute2(typeArguments, typeParameters)); |
| 7755 } | 8262 } |
| 7756 } | 8263 } |
| 7757 return new List.from(types); | 8264 return new List.from(types); |
| 7758 } | 8265 } |
| 7759 | 8266 |
| 8267 @override |
| 7760 List<ParameterElement> get parameters { | 8268 List<ParameterElement> get parameters { |
| 7761 List<ParameterElement> baseParameters = this.baseParameters; | 8269 List<ParameterElement> baseParameters = this.baseParameters; |
| 7762 // no parameters, quick return | 8270 // no parameters, quick return |
| 7763 int parameterCount = baseParameters.length; | 8271 int parameterCount = baseParameters.length; |
| 7764 if (parameterCount == 0) { | 8272 if (parameterCount == 0) { |
| 7765 return baseParameters; | 8273 return baseParameters; |
| 7766 } | 8274 } |
| 7767 // create specialized parameters | 8275 // create specialized parameters |
| 7768 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); | 8276 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); |
| 7769 for (int i = 0; i < parameterCount; i++) { | 8277 for (int i = 0; i < parameterCount; i++) { |
| 7770 specializedParameters[i] = ParameterMember.from(baseParameters[i], this); | 8278 specializedParameters[i] = ParameterMember.from(baseParameters[i], this); |
| 7771 } | 8279 } |
| 7772 return specializedParameters; | 8280 return specializedParameters; |
| 7773 } | 8281 } |
| 7774 | 8282 |
| 8283 @override |
| 7775 DartType get returnType { | 8284 DartType get returnType { |
| 7776 DartType baseReturnType = this.baseReturnType; | 8285 DartType baseReturnType = this.baseReturnType; |
| 7777 if (baseReturnType == null) { | 8286 if (baseReturnType == null) { |
| 7778 // TODO(brianwilkerson) This is a patch. The return type should never be n
ull and we need to | 8287 // TODO(brianwilkerson) This is a patch. The return type should never be n
ull and we need to |
| 7779 // understand why it is and fix it. | 8288 // understand why it is and fix it. |
| 7780 return DynamicTypeImpl.instance; | 8289 return DynamicTypeImpl.instance; |
| 7781 } | 8290 } |
| 7782 return baseReturnType.substitute2(typeArguments, TypeParameterTypeImpl.getTy
pes(typeParameters)); | 8291 return baseReturnType.substitute2(typeArguments, TypeParameterTypeImpl.getTy
pes(typeParameters)); |
| 7783 } | 8292 } |
| 7784 | 8293 |
| 8294 @override |
| 7785 List<TypeParameterElement> get typeParameters { | 8295 List<TypeParameterElement> get typeParameters { |
| 7786 Element element = this.element; | 8296 Element element = this.element; |
| 7787 if (element is FunctionTypeAliasElement) { | 8297 if (element is FunctionTypeAliasElement) { |
| 7788 return element.typeParameters; | 8298 return element.typeParameters; |
| 7789 } | 8299 } |
| 7790 ClassElement definingClass = element.getAncestor((element) => element is Cla
ssElement); | 8300 ClassElement definingClass = element.getAncestor((element) => element is Cla
ssElement); |
| 7791 if (definingClass != null) { | 8301 if (definingClass != null) { |
| 7792 return definingClass.typeParameters; | 8302 return definingClass.typeParameters; |
| 7793 } | 8303 } |
| 7794 return TypeParameterElementImpl.EMPTY_ARRAY; | 8304 return TypeParameterElementImpl.EMPTY_ARRAY; |
| 7795 } | 8305 } |
| 7796 | 8306 |
| 8307 @override |
| 7797 int get hashCode { | 8308 int get hashCode { |
| 7798 if (element == null) { | 8309 if (element == null) { |
| 7799 return 0; | 8310 return 0; |
| 7800 } | 8311 } |
| 7801 // Reference the arrays of parameters | 8312 // Reference the arrays of parameters |
| 7802 List<DartType> normalParameterTypes = this.normalParameterTypes; | 8313 List<DartType> normalParameterTypes = this.normalParameterTypes; |
| 7803 List<DartType> optionalParameterTypes = this.optionalParameterTypes; | 8314 List<DartType> optionalParameterTypes = this.optionalParameterTypes; |
| 7804 Iterable<DartType> namedParameterTypes = this.namedParameterTypes.values; | 8315 Iterable<DartType> namedParameterTypes = this.namedParameterTypes.values; |
| 7805 // Generate the hashCode | 8316 // Generate the hashCode |
| 7806 int hashCode = returnType.hashCode; | 8317 int hashCode = returnType.hashCode; |
| 7807 for (int i = 0; i < normalParameterTypes.length; i++) { | 8318 for (int i = 0; i < normalParameterTypes.length; i++) { |
| 7808 hashCode = (hashCode << 1) + normalParameterTypes[i].hashCode; | 8319 hashCode = (hashCode << 1) + normalParameterTypes[i].hashCode; |
| 7809 } | 8320 } |
| 7810 for (int i = 0; i < optionalParameterTypes.length; i++) { | 8321 for (int i = 0; i < optionalParameterTypes.length; i++) { |
| 7811 hashCode = (hashCode << 1) + optionalParameterTypes[i].hashCode; | 8322 hashCode = (hashCode << 1) + optionalParameterTypes[i].hashCode; |
| 7812 } | 8323 } |
| 7813 for (DartType type in namedParameterTypes) { | 8324 for (DartType type in namedParameterTypes) { |
| 7814 hashCode = (hashCode << 1) + type.hashCode; | 8325 hashCode = (hashCode << 1) + type.hashCode; |
| 7815 } | 8326 } |
| 7816 return hashCode; | 8327 return hashCode; |
| 7817 } | 8328 } |
| 7818 | 8329 |
| 8330 @override |
| 7819 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { | 8331 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { |
| 7820 // trivial base cases | 8332 // trivial base cases |
| 7821 if (type == null) { | 8333 if (type == null) { |
| 7822 return false; | 8334 return false; |
| 7823 } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunctio
n || type.isObject) { | 8335 } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunctio
n || type.isObject) { |
| 7824 return true; | 8336 return true; |
| 7825 } else if (type is! FunctionType) { | 8337 } else if (type is! FunctionType) { |
| 7826 return false; | 8338 return false; |
| 7827 } else if (this == type) { | 8339 } else if (this == type) { |
| 7828 return true; | 8340 return true; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7910 return false; | 8422 return false; |
| 7911 } | 8423 } |
| 7912 } | 8424 } |
| 7913 } | 8425 } |
| 7914 } | 8426 } |
| 7915 DartType tRetType = t.returnType; | 8427 DartType tRetType = t.returnType; |
| 7916 DartType sRetType = s.returnType; | 8428 DartType sRetType = s.returnType; |
| 7917 return sRetType.isVoid || (tRetType as TypeImpl).isMoreSpecificThan2(sRetTyp
e, withDynamic, visitedTypePairs); | 8429 return sRetType.isVoid || (tRetType as TypeImpl).isMoreSpecificThan2(sRetTyp
e, withDynamic, visitedTypePairs); |
| 7918 } | 8430 } |
| 7919 | 8431 |
| 8432 @override |
| 7920 bool isAssignableTo(DartType type) => isSubtypeOf2(type, new Set<TypeImpl_Type
Pair>()); | 8433 bool isAssignableTo(DartType type) => isSubtypeOf2(type, new Set<TypeImpl_Type
Pair>()); |
| 7921 | 8434 |
| 8435 @override |
| 7922 FunctionTypeImpl substitute3(List<DartType> argumentTypes) => substitute2(argu
mentTypes, typeArguments); | 8436 FunctionTypeImpl substitute3(List<DartType> argumentTypes) => substitute2(argu
mentTypes, typeArguments); |
| 7923 | 8437 |
| 8438 @override |
| 7924 FunctionTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> para
meterTypes) { | 8439 FunctionTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> para
meterTypes) { |
| 7925 if (argumentTypes.length != parameterTypes.length) { | 8440 if (argumentTypes.length != parameterTypes.length) { |
| 7926 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); | 8441 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); |
| 7927 } | 8442 } |
| 7928 if (argumentTypes.length == 0) { | 8443 if (argumentTypes.length == 0) { |
| 7929 return this; | 8444 return this; |
| 7930 } | 8445 } |
| 7931 Element element = this.element; | 8446 Element element = this.element; |
| 7932 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType
Impl.con1(element) : new FunctionTypeImpl.con2(element as FunctionTypeAliasEleme
nt); | 8447 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType
Impl.con1(element) : new FunctionTypeImpl.con2(element as FunctionTypeAliasEleme
nt); |
| 7933 newType.typeArguments = TypeImpl.substitute(typeArguments, argumentTypes, pa
rameterTypes); | 8448 newType.typeArguments = TypeImpl.substitute(typeArguments, argumentTypes, pa
rameterTypes); |
| 7934 return newType; | 8449 return newType; |
| 7935 } | 8450 } |
| 7936 | 8451 |
| 8452 @override |
| 7937 void appendTo(JavaStringBuilder builder) { | 8453 void appendTo(JavaStringBuilder builder) { |
| 7938 List<DartType> normalParameterTypes = this.normalParameterTypes; | 8454 List<DartType> normalParameterTypes = this.normalParameterTypes; |
| 7939 List<DartType> optionalParameterTypes = this.optionalParameterTypes; | 8455 List<DartType> optionalParameterTypes = this.optionalParameterTypes; |
| 7940 Map<String, DartType> namedParameterTypes = this.namedParameterTypes; | 8456 Map<String, DartType> namedParameterTypes = this.namedParameterTypes; |
| 7941 DartType returnType = this.returnType; | 8457 DartType returnType = this.returnType; |
| 7942 builder.append("("); | 8458 builder.append("("); |
| 7943 bool needsComma = false; | 8459 bool needsComma = false; |
| 7944 if (normalParameterTypes.length > 0) { | 8460 if (normalParameterTypes.length > 0) { |
| 7945 for (DartType type in normalParameterTypes) { | 8461 for (DartType type in normalParameterTypes) { |
| 7946 if (needsComma) { | 8462 if (needsComma) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8001 */ | 8517 */ |
| 8002 List<ParameterElement> get baseParameters { | 8518 List<ParameterElement> get baseParameters { |
| 8003 Element element = this.element; | 8519 Element element = this.element; |
| 8004 if (element is ExecutableElement) { | 8520 if (element is ExecutableElement) { |
| 8005 return element.parameters; | 8521 return element.parameters; |
| 8006 } else { | 8522 } else { |
| 8007 return (element as FunctionTypeAliasElement).parameters; | 8523 return (element as FunctionTypeAliasElement).parameters; |
| 8008 } | 8524 } |
| 8009 } | 8525 } |
| 8010 | 8526 |
| 8527 @override |
| 8011 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) { | 8528 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) { |
| 8012 if (object is! FunctionTypeImpl) { | 8529 if (object is! FunctionTypeImpl) { |
| 8013 return false; | 8530 return false; |
| 8014 } | 8531 } |
| 8015 FunctionTypeImpl otherType = object as FunctionTypeImpl; | 8532 FunctionTypeImpl otherType = object as FunctionTypeImpl; |
| 8016 // If the visitedTypePairs already has the pair (this, type), use the elemen
ts to determine equality | 8533 // If the visitedTypePairs already has the pair (this, type), use the elemen
ts to determine equality |
| 8017 ElementPair elementPair = new ElementPair(element, otherType.element); | 8534 ElementPair elementPair = new ElementPair(element, otherType.element); |
| 8018 if (!visitedElementPairs.add(elementPair)) { | 8535 if (!visitedElementPairs.add(elementPair)) { |
| 8019 return elementPair.firstElt == elementPair.secondElt; | 8536 return elementPair.firstElt == elementPair.secondElt; |
| 8020 } | 8537 } |
| 8021 // Compute the result | 8538 // Compute the result |
| 8022 bool result = TypeImpl.equalArrays(normalParameterTypes, otherType.normalPar
ameterTypes, visitedElementPairs) && TypeImpl.equalArrays(optionalParameterTypes
, otherType.optionalParameterTypes, visitedElementPairs) && _equals(namedParamet
erTypes, otherType.namedParameterTypes, visitedElementPairs) && (returnType as T
ypeImpl).internalEquals(otherType.returnType, visitedElementPairs); | 8539 bool result = TypeImpl.equalArrays(normalParameterTypes, otherType.normalPar
ameterTypes, visitedElementPairs) && TypeImpl.equalArrays(optionalParameterTypes
, otherType.optionalParameterTypes, visitedElementPairs) && _equals(namedParamet
erTypes, otherType.namedParameterTypes, visitedElementPairs) && (returnType as T
ypeImpl).internalEquals(otherType.returnType, visitedElementPairs); |
| 8023 // Remove the pair from our visited pairs list | 8540 // Remove the pair from our visited pairs list |
| 8024 visitedElementPairs.remove(elementPair); | 8541 visitedElementPairs.remove(elementPair); |
| 8025 // Return the result | 8542 // Return the result |
| 8026 return result; | 8543 return result; |
| 8027 } | 8544 } |
| 8028 | 8545 |
| 8546 @override |
| 8029 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) { | 8547 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) { |
| 8030 // trivial base cases | 8548 // trivial base cases |
| 8031 if (type == null) { | 8549 if (type == null) { |
| 8032 return false; | 8550 return false; |
| 8033 } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunctio
n || type.isObject) { | 8551 } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunctio
n || type.isObject) { |
| 8034 return true; | 8552 return true; |
| 8035 } else if (type is! FunctionType) { | 8553 } else if (type is! FunctionType) { |
| 8036 return false; | 8554 return false; |
| 8037 } else if (this == type) { | 8555 } else if (this == type) { |
| 8038 return true; | 8556 return true; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8326 InterfaceTypeImpl.con1(ClassElement element) : super(element, element.displayN
ame); | 8844 InterfaceTypeImpl.con1(ClassElement element) : super(element, element.displayN
ame); |
| 8327 | 8845 |
| 8328 /** | 8846 /** |
| 8329 * Initialize a newly created type to have the given name. This constructor sh
ould only be used in | 8847 * Initialize a newly created type to have the given name. This constructor sh
ould only be used in |
| 8330 * cases where there is no declaration of the type. | 8848 * cases where there is no declaration of the type. |
| 8331 * | 8849 * |
| 8332 * @param name the name of the type | 8850 * @param name the name of the type |
| 8333 */ | 8851 */ |
| 8334 InterfaceTypeImpl.con2(String name) : super(null, name); | 8852 InterfaceTypeImpl.con2(String name) : super(null, name); |
| 8335 | 8853 |
| 8854 @override |
| 8336 bool operator ==(Object object) => internalEquals(object, new Set<ElementPair>
()); | 8855 bool operator ==(Object object) => internalEquals(object, new Set<ElementPair>
()); |
| 8337 | 8856 |
| 8857 @override |
| 8338 List<PropertyAccessorElement> get accessors { | 8858 List<PropertyAccessorElement> get accessors { |
| 8339 List<PropertyAccessorElement> accessors = element.accessors; | 8859 List<PropertyAccessorElement> accessors = element.accessors; |
| 8340 List<PropertyAccessorElement> members = new List<PropertyAccessorElement>(ac
cessors.length); | 8860 List<PropertyAccessorElement> members = new List<PropertyAccessorElement>(ac
cessors.length); |
| 8341 for (int i = 0; i < accessors.length; i++) { | 8861 for (int i = 0; i < accessors.length; i++) { |
| 8342 members[i] = PropertyAccessorMember.from(accessors[i], this); | 8862 members[i] = PropertyAccessorMember.from(accessors[i], this); |
| 8343 } | 8863 } |
| 8344 return members; | 8864 return members; |
| 8345 } | 8865 } |
| 8346 | 8866 |
| 8867 @override |
| 8347 String get displayName { | 8868 String get displayName { |
| 8348 String name = this.name; | 8869 String name = this.name; |
| 8349 List<DartType> typeArguments = this.typeArguments; | 8870 List<DartType> typeArguments = this.typeArguments; |
| 8350 bool allDynamic = true; | 8871 bool allDynamic = true; |
| 8351 for (DartType type in typeArguments) { | 8872 for (DartType type in typeArguments) { |
| 8352 if (type != null && !type.isDynamic) { | 8873 if (type != null && !type.isDynamic) { |
| 8353 allDynamic = false; | 8874 allDynamic = false; |
| 8354 break; | 8875 break; |
| 8355 } | 8876 } |
| 8356 } | 8877 } |
| 8357 // If there is at least one non-dynamic type, then list them out | 8878 // If there is at least one non-dynamic type, then list them out |
| 8358 if (!allDynamic) { | 8879 if (!allDynamic) { |
| 8359 JavaStringBuilder builder = new JavaStringBuilder(); | 8880 JavaStringBuilder builder = new JavaStringBuilder(); |
| 8360 builder.append(name); | 8881 builder.append(name); |
| 8361 builder.append("<"); | 8882 builder.append("<"); |
| 8362 for (int i = 0; i < typeArguments.length; i++) { | 8883 for (int i = 0; i < typeArguments.length; i++) { |
| 8363 if (i != 0) { | 8884 if (i != 0) { |
| 8364 builder.append(", "); | 8885 builder.append(", "); |
| 8365 } | 8886 } |
| 8366 DartType typeArg = typeArguments[i]; | 8887 DartType typeArg = typeArguments[i]; |
| 8367 builder.append(typeArg.displayName); | 8888 builder.append(typeArg.displayName); |
| 8368 } | 8889 } |
| 8369 builder.append(">"); | 8890 builder.append(">"); |
| 8370 name = builder.toString(); | 8891 name = builder.toString(); |
| 8371 } | 8892 } |
| 8372 return name; | 8893 return name; |
| 8373 } | 8894 } |
| 8374 | 8895 |
| 8896 @override |
| 8375 ClassElement get element => super.element as ClassElement; | 8897 ClassElement get element => super.element as ClassElement; |
| 8376 | 8898 |
| 8899 @override |
| 8377 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from((element as ClassElementImpl).getGetter(getterName), this); | 8900 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from((element as ClassElementImpl).getGetter(getterName), this); |
| 8378 | 8901 |
| 8902 @override |
| 8379 List<InterfaceType> get interfaces { | 8903 List<InterfaceType> get interfaces { |
| 8380 ClassElement classElement = element; | 8904 ClassElement classElement = element; |
| 8381 List<InterfaceType> interfaces = classElement.interfaces; | 8905 List<InterfaceType> interfaces = classElement.interfaces; |
| 8382 List<TypeParameterElement> typeParameters = classElement.typeParameters; | 8906 List<TypeParameterElement> typeParameters = classElement.typeParameters; |
| 8383 List<DartType> parameterTypes = classElement.type.typeArguments; | 8907 List<DartType> parameterTypes = classElement.type.typeArguments; |
| 8384 if (typeParameters.length == 0) { | 8908 if (typeParameters.length == 0) { |
| 8385 return interfaces; | 8909 return interfaces; |
| 8386 } | 8910 } |
| 8387 int count = interfaces.length; | 8911 int count = interfaces.length; |
| 8388 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); | 8912 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); |
| 8389 for (int i = 0; i < count; i++) { | 8913 for (int i = 0; i < count; i++) { |
| 8390 typedInterfaces[i] = interfaces[i].substitute2(typeArguments, parameterTyp
es); | 8914 typedInterfaces[i] = interfaces[i].substitute2(typeArguments, parameterTyp
es); |
| 8391 } | 8915 } |
| 8392 return typedInterfaces; | 8916 return typedInterfaces; |
| 8393 } | 8917 } |
| 8394 | 8918 |
| 8919 @override |
| 8395 DartType getLeastUpperBound(DartType type) { | 8920 DartType getLeastUpperBound(DartType type) { |
| 8396 // quick check for self | 8921 // quick check for self |
| 8397 if (identical(type, this)) { | 8922 if (identical(type, this)) { |
| 8398 return this; | 8923 return this; |
| 8399 } | 8924 } |
| 8400 // dynamic | 8925 // dynamic |
| 8401 DartType dynamicType = DynamicTypeImpl.instance; | 8926 DartType dynamicType = DynamicTypeImpl.instance; |
| 8402 if (identical(this, dynamicType) || identical(type, dynamicType)) { | 8927 if (identical(this, dynamicType) || identical(type, dynamicType)) { |
| 8403 return dynamicType; | 8928 return dynamicType; |
| 8404 } | 8929 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8440 if (numberOfTypesAtMaxDepth == 1) { | 8965 if (numberOfTypesAtMaxDepth == 1) { |
| 8441 return s[indexOfLeastUpperBound]; | 8966 return s[indexOfLeastUpperBound]; |
| 8442 } | 8967 } |
| 8443 } | 8968 } |
| 8444 // illegal state, log and return null- Object at maxDepth == 0 should always
return itself as | 8969 // illegal state, log and return null- Object at maxDepth == 0 should always
return itself as |
| 8445 // the least upper bound. | 8970 // the least upper bound. |
| 8446 // TODO (jwren) log the error state | 8971 // TODO (jwren) log the error state |
| 8447 return null; | 8972 return null; |
| 8448 } | 8973 } |
| 8449 | 8974 |
| 8975 @override |
| 8450 MethodElement getMethod(String methodName) => MethodMember.from((element as Cl
assElementImpl).getMethod(methodName), this); | 8976 MethodElement getMethod(String methodName) => MethodMember.from((element as Cl
assElementImpl).getMethod(methodName), this); |
| 8451 | 8977 |
| 8978 @override |
| 8452 List<MethodElement> get methods { | 8979 List<MethodElement> get methods { |
| 8453 List<MethodElement> methods = element.methods; | 8980 List<MethodElement> methods = element.methods; |
| 8454 List<MethodElement> members = new List<MethodElement>(methods.length); | 8981 List<MethodElement> members = new List<MethodElement>(methods.length); |
| 8455 for (int i = 0; i < methods.length; i++) { | 8982 for (int i = 0; i < methods.length; i++) { |
| 8456 members[i] = MethodMember.from(methods[i], this); | 8983 members[i] = MethodMember.from(methods[i], this); |
| 8457 } | 8984 } |
| 8458 return members; | 8985 return members; |
| 8459 } | 8986 } |
| 8460 | 8987 |
| 8988 @override |
| 8461 List<InterfaceType> get mixins { | 8989 List<InterfaceType> get mixins { |
| 8462 ClassElement classElement = element; | 8990 ClassElement classElement = element; |
| 8463 List<InterfaceType> mixins = classElement.mixins; | 8991 List<InterfaceType> mixins = classElement.mixins; |
| 8464 List<TypeParameterElement> typeParameters = classElement.typeParameters; | 8992 List<TypeParameterElement> typeParameters = classElement.typeParameters; |
| 8465 List<DartType> parameterTypes = classElement.type.typeArguments; | 8993 List<DartType> parameterTypes = classElement.type.typeArguments; |
| 8466 if (typeParameters.length == 0) { | 8994 if (typeParameters.length == 0) { |
| 8467 return mixins; | 8995 return mixins; |
| 8468 } | 8996 } |
| 8469 int count = mixins.length; | 8997 int count = mixins.length; |
| 8470 List<InterfaceType> typedMixins = new List<InterfaceType>(count); | 8998 List<InterfaceType> typedMixins = new List<InterfaceType>(count); |
| 8471 for (int i = 0; i < count; i++) { | 8999 for (int i = 0; i < count; i++) { |
| 8472 typedMixins[i] = mixins[i].substitute2(typeArguments, parameterTypes); | 9000 typedMixins[i] = mixins[i].substitute2(typeArguments, parameterTypes); |
| 8473 } | 9001 } |
| 8474 return typedMixins; | 9002 return typedMixins; |
| 8475 } | 9003 } |
| 8476 | 9004 |
| 9005 @override |
| 8477 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from((element as ClassElementImpl).getSetter(setterName), this); | 9006 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from((element as ClassElementImpl).getSetter(setterName), this); |
| 8478 | 9007 |
| 9008 @override |
| 8479 InterfaceType get superclass { | 9009 InterfaceType get superclass { |
| 8480 ClassElement classElement = element; | 9010 ClassElement classElement = element; |
| 8481 InterfaceType supertype = classElement.supertype; | 9011 InterfaceType supertype = classElement.supertype; |
| 8482 if (supertype == null) { | 9012 if (supertype == null) { |
| 8483 return null; | 9013 return null; |
| 8484 } | 9014 } |
| 8485 return supertype.substitute2(typeArguments, classElement.type.typeArguments)
; | 9015 return supertype.substitute2(typeArguments, classElement.type.typeArguments)
; |
| 8486 } | 9016 } |
| 8487 | 9017 |
| 9018 @override |
| 8488 List<TypeParameterElement> get typeParameters => element.typeParameters; | 9019 List<TypeParameterElement> get typeParameters => element.typeParameters; |
| 8489 | 9020 |
| 9021 @override |
| 8490 int get hashCode { | 9022 int get hashCode { |
| 8491 ClassElement element = this.element; | 9023 ClassElement element = this.element; |
| 8492 if (element == null) { | 9024 if (element == null) { |
| 8493 return 0; | 9025 return 0; |
| 8494 } | 9026 } |
| 8495 return element.hashCode; | 9027 return element.hashCode; |
| 8496 } | 9028 } |
| 8497 | 9029 |
| 9030 @override |
| 8498 bool get isDartCoreFunction { | 9031 bool get isDartCoreFunction { |
| 8499 ClassElement element = this.element; | 9032 ClassElement element = this.element; |
| 8500 if (element == null) { | 9033 if (element == null) { |
| 8501 return false; | 9034 return false; |
| 8502 } | 9035 } |
| 8503 return element.name == "Function" && element.library.isDartCore; | 9036 return element.name == "Function" && element.library.isDartCore; |
| 8504 } | 9037 } |
| 8505 | 9038 |
| 9039 @override |
| 8506 bool isDirectSupertypeOf(InterfaceType type) { | 9040 bool isDirectSupertypeOf(InterfaceType type) { |
| 8507 InterfaceType i = this; | 9041 InterfaceType i = this; |
| 8508 InterfaceType j = type; | 9042 InterfaceType j = type; |
| 8509 ClassElement jElement = j.element; | 9043 ClassElement jElement = j.element; |
| 8510 InterfaceType supertype = jElement.supertype; | 9044 InterfaceType supertype = jElement.supertype; |
| 8511 // | 9045 // |
| 8512 // If J has no direct supertype then it is Object, and Object has no direct
supertypes. | 9046 // If J has no direct supertype then it is Object, and Object has no direct
supertypes. |
| 8513 // | 9047 // |
| 8514 if (supertype == null) { | 9048 if (supertype == null) { |
| 8515 return false; | 9049 return false; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 8542 } | 9076 } |
| 8543 } | 9077 } |
| 8544 // | 9078 // |
| 8545 // J is a mixin application of the mixin of I. | 9079 // J is a mixin application of the mixin of I. |
| 8546 // | 9080 // |
| 8547 // TODO(brianwilkerson) Determine whether this needs to be implemented or wh
ether it is covered | 9081 // TODO(brianwilkerson) Determine whether this needs to be implemented or wh
ether it is covered |
| 8548 // by the case above. | 9082 // by the case above. |
| 8549 return false; | 9083 return false; |
| 8550 } | 9084 } |
| 8551 | 9085 |
| 9086 @override |
| 8552 bool get isObject => element.supertype == null; | 9087 bool get isObject => element.supertype == null; |
| 8553 | 9088 |
| 9089 @override |
| 8554 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary) { | 9090 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary) { |
| 8555 // prepare base ConstructorElement | 9091 // prepare base ConstructorElement |
| 8556 ConstructorElement constructorElement; | 9092 ConstructorElement constructorElement; |
| 8557 if (constructorName == null) { | 9093 if (constructorName == null) { |
| 8558 constructorElement = element.unnamedConstructor; | 9094 constructorElement = element.unnamedConstructor; |
| 8559 } else { | 9095 } else { |
| 8560 constructorElement = element.getNamedConstructor(constructorName); | 9096 constructorElement = element.getNamedConstructor(constructorName); |
| 8561 } | 9097 } |
| 8562 // not found or not accessible | 9098 // not found or not accessible |
| 8563 if (constructorElement == null || !constructorElement.isAccessibleIn(library
)) { | 9099 if (constructorElement == null || !constructorElement.isAccessibleIn(library
)) { |
| 8564 return null; | 9100 return null; |
| 8565 } | 9101 } |
| 8566 // return member | 9102 // return member |
| 8567 return ConstructorMember.from(constructorElement, this); | 9103 return ConstructorMember.from(constructorElement, this); |
| 8568 } | 9104 } |
| 8569 | 9105 |
| 9106 @override |
| 8570 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { | 9107 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library
) { |
| 8571 PropertyAccessorElement element = getGetter(getterName); | 9108 PropertyAccessorElement element = getGetter(getterName); |
| 8572 if (element != null && element.isAccessibleIn(library)) { | 9109 if (element != null && element.isAccessibleIn(library)) { |
| 8573 return element; | 9110 return element; |
| 8574 } | 9111 } |
| 8575 return lookUpGetterInSuperclass(getterName, library); | 9112 return lookUpGetterInSuperclass(getterName, library); |
| 8576 } | 9113 } |
| 8577 | 9114 |
| 9115 @override |
| 8578 PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryEle
ment library) { | 9116 PropertyAccessorElement lookUpGetterInSuperclass(String getterName, LibraryEle
ment library) { |
| 8579 for (InterfaceType mixin in mixins) { | 9117 for (InterfaceType mixin in mixins) { |
| 8580 PropertyAccessorElement element = mixin.getGetter(getterName); | 9118 PropertyAccessorElement element = mixin.getGetter(getterName); |
| 8581 if (element != null && element.isAccessibleIn(library)) { | 9119 if (element != null && element.isAccessibleIn(library)) { |
| 8582 return element; | 9120 return element; |
| 8583 } | 9121 } |
| 8584 } | 9122 } |
| 8585 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 9123 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 8586 InterfaceType supertype = superclass; | 9124 InterfaceType supertype = superclass; |
| 8587 ClassElement supertypeElement = supertype == null ? null : supertype.element
; | 9125 ClassElement supertypeElement = supertype == null ? null : supertype.element
; |
| 8588 while (supertype != null && !visitedClasses.contains(supertypeElement)) { | 9126 while (supertype != null && !visitedClasses.contains(supertypeElement)) { |
| 8589 visitedClasses.add(supertypeElement); | 9127 visitedClasses.add(supertypeElement); |
| 8590 PropertyAccessorElement element = supertype.getGetter(getterName); | 9128 PropertyAccessorElement element = supertype.getGetter(getterName); |
| 8591 if (element != null && element.isAccessibleIn(library)) { | 9129 if (element != null && element.isAccessibleIn(library)) { |
| 8592 return element; | 9130 return element; |
| 8593 } | 9131 } |
| 8594 for (InterfaceType mixin in supertype.mixins) { | 9132 for (InterfaceType mixin in supertype.mixins) { |
| 8595 element = mixin.getGetter(getterName); | 9133 element = mixin.getGetter(getterName); |
| 8596 if (element != null && element.isAccessibleIn(library)) { | 9134 if (element != null && element.isAccessibleIn(library)) { |
| 8597 return element; | 9135 return element; |
| 8598 } | 9136 } |
| 8599 } | 9137 } |
| 8600 supertype = supertype.superclass; | 9138 supertype = supertype.superclass; |
| 8601 supertypeElement = supertype == null ? null : supertype.element; | 9139 supertypeElement = supertype == null ? null : supertype.element; |
| 8602 } | 9140 } |
| 8603 return null; | 9141 return null; |
| 8604 } | 9142 } |
| 8605 | 9143 |
| 9144 @override |
| 8606 MethodElement lookUpMethod(String methodName, LibraryElement library) { | 9145 MethodElement lookUpMethod(String methodName, LibraryElement library) { |
| 8607 MethodElement element = getMethod(methodName); | 9146 MethodElement element = getMethod(methodName); |
| 8608 if (element != null && element.isAccessibleIn(library)) { | 9147 if (element != null && element.isAccessibleIn(library)) { |
| 8609 return element; | 9148 return element; |
| 8610 } | 9149 } |
| 8611 return lookUpMethodInSuperclass(methodName, library); | 9150 return lookUpMethodInSuperclass(methodName, library); |
| 8612 } | 9151 } |
| 8613 | 9152 |
| 9153 @override |
| 8614 MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement libra
ry) { | 9154 MethodElement lookUpMethodInSuperclass(String methodName, LibraryElement libra
ry) { |
| 8615 for (InterfaceType mixin in mixins) { | 9155 for (InterfaceType mixin in mixins) { |
| 8616 MethodElement element = mixin.getMethod(methodName); | 9156 MethodElement element = mixin.getMethod(methodName); |
| 8617 if (element != null && element.isAccessibleIn(library)) { | 9157 if (element != null && element.isAccessibleIn(library)) { |
| 8618 return element; | 9158 return element; |
| 8619 } | 9159 } |
| 8620 } | 9160 } |
| 8621 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 9161 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 8622 InterfaceType supertype = superclass; | 9162 InterfaceType supertype = superclass; |
| 8623 ClassElement supertypeElement = supertype == null ? null : supertype.element
; | 9163 ClassElement supertypeElement = supertype == null ? null : supertype.element
; |
| 8624 while (supertype != null && !visitedClasses.contains(supertypeElement)) { | 9164 while (supertype != null && !visitedClasses.contains(supertypeElement)) { |
| 8625 visitedClasses.add(supertypeElement); | 9165 visitedClasses.add(supertypeElement); |
| 8626 MethodElement element = supertype.getMethod(methodName); | 9166 MethodElement element = supertype.getMethod(methodName); |
| 8627 if (element != null && element.isAccessibleIn(library)) { | 9167 if (element != null && element.isAccessibleIn(library)) { |
| 8628 return element; | 9168 return element; |
| 8629 } | 9169 } |
| 8630 for (InterfaceType mixin in supertype.mixins) { | 9170 for (InterfaceType mixin in supertype.mixins) { |
| 8631 element = mixin.getMethod(methodName); | 9171 element = mixin.getMethod(methodName); |
| 8632 if (element != null && element.isAccessibleIn(library)) { | 9172 if (element != null && element.isAccessibleIn(library)) { |
| 8633 return element; | 9173 return element; |
| 8634 } | 9174 } |
| 8635 } | 9175 } |
| 8636 supertype = supertype.superclass; | 9176 supertype = supertype.superclass; |
| 8637 supertypeElement = supertype == null ? null : supertype.element; | 9177 supertypeElement = supertype == null ? null : supertype.element; |
| 8638 } | 9178 } |
| 8639 return null; | 9179 return null; |
| 8640 } | 9180 } |
| 8641 | 9181 |
| 9182 @override |
| 8642 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { | 9183 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { |
| 8643 PropertyAccessorElement element = getSetter(setterName); | 9184 PropertyAccessorElement element = getSetter(setterName); |
| 8644 if (element != null && element.isAccessibleIn(library)) { | 9185 if (element != null && element.isAccessibleIn(library)) { |
| 8645 return element; | 9186 return element; |
| 8646 } | 9187 } |
| 8647 return lookUpSetterInSuperclass(setterName, library); | 9188 return lookUpSetterInSuperclass(setterName, library); |
| 8648 } | 9189 } |
| 8649 | 9190 |
| 9191 @override |
| 8650 PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryEle
ment library) { | 9192 PropertyAccessorElement lookUpSetterInSuperclass(String setterName, LibraryEle
ment library) { |
| 8651 for (InterfaceType mixin in mixins) { | 9193 for (InterfaceType mixin in mixins) { |
| 8652 PropertyAccessorElement element = mixin.getSetter(setterName); | 9194 PropertyAccessorElement element = mixin.getSetter(setterName); |
| 8653 if (element != null && element.isAccessibleIn(library)) { | 9195 if (element != null && element.isAccessibleIn(library)) { |
| 8654 return element; | 9196 return element; |
| 8655 } | 9197 } |
| 8656 } | 9198 } |
| 8657 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 9199 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
| 8658 InterfaceType supertype = superclass; | 9200 InterfaceType supertype = superclass; |
| 8659 ClassElement supertypeElement = supertype == null ? null : supertype.element
; | 9201 ClassElement supertypeElement = supertype == null ? null : supertype.element
; |
| 8660 while (supertype != null && !visitedClasses.contains(supertypeElement)) { | 9202 while (supertype != null && !visitedClasses.contains(supertypeElement)) { |
| 8661 visitedClasses.add(supertypeElement); | 9203 visitedClasses.add(supertypeElement); |
| 8662 PropertyAccessorElement element = supertype.getSetter(setterName); | 9204 PropertyAccessorElement element = supertype.getSetter(setterName); |
| 8663 if (element != null && element.isAccessibleIn(library)) { | 9205 if (element != null && element.isAccessibleIn(library)) { |
| 8664 return element; | 9206 return element; |
| 8665 } | 9207 } |
| 8666 for (InterfaceType mixin in supertype.mixins) { | 9208 for (InterfaceType mixin in supertype.mixins) { |
| 8667 element = mixin.getSetter(setterName); | 9209 element = mixin.getSetter(setterName); |
| 8668 if (element != null && element.isAccessibleIn(library)) { | 9210 if (element != null && element.isAccessibleIn(library)) { |
| 8669 return element; | 9211 return element; |
| 8670 } | 9212 } |
| 8671 } | 9213 } |
| 8672 supertype = supertype.superclass; | 9214 supertype = supertype.superclass; |
| 8673 supertypeElement = supertype == null ? null : supertype.element; | 9215 supertypeElement = supertype == null ? null : supertype.element; |
| 8674 } | 9216 } |
| 8675 return null; | 9217 return null; |
| 8676 } | 9218 } |
| 8677 | 9219 |
| 9220 @override |
| 8678 InterfaceTypeImpl substitute4(List<DartType> argumentTypes) => substitute2(arg
umentTypes, typeArguments); | 9221 InterfaceTypeImpl substitute4(List<DartType> argumentTypes) => substitute2(arg
umentTypes, typeArguments); |
| 8679 | 9222 |
| 9223 @override |
| 8680 InterfaceTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> par
ameterTypes) { | 9224 InterfaceTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> par
ameterTypes) { |
| 8681 if (argumentTypes.length != parameterTypes.length) { | 9225 if (argumentTypes.length != parameterTypes.length) { |
| 8682 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); | 9226 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); |
| 8683 } | 9227 } |
| 8684 if (argumentTypes.length == 0 || typeArguments.length == 0) { | 9228 if (argumentTypes.length == 0 || typeArguments.length == 0) { |
| 8685 return this; | 9229 return this; |
| 8686 } | 9230 } |
| 8687 List<DartType> newTypeArguments = TypeImpl.substitute(typeArguments, argumen
tTypes, parameterTypes); | 9231 List<DartType> newTypeArguments = TypeImpl.substitute(typeArguments, argumen
tTypes, parameterTypes); |
| 8688 if (JavaArrays.equals(newTypeArguments, typeArguments)) { | 9232 if (JavaArrays.equals(newTypeArguments, typeArguments)) { |
| 8689 return this; | 9233 return this; |
| 8690 } | 9234 } |
| 8691 InterfaceTypeImpl newType = new InterfaceTypeImpl.con1(element); | 9235 InterfaceTypeImpl newType = new InterfaceTypeImpl.con1(element); |
| 8692 newType.typeArguments = newTypeArguments; | 9236 newType.typeArguments = newTypeArguments; |
| 8693 return newType; | 9237 return newType; |
| 8694 } | 9238 } |
| 8695 | 9239 |
| 9240 @override |
| 8696 void appendTo(JavaStringBuilder builder) { | 9241 void appendTo(JavaStringBuilder builder) { |
| 8697 builder.append(name); | 9242 builder.append(name); |
| 8698 int argumentCount = typeArguments.length; | 9243 int argumentCount = typeArguments.length; |
| 8699 if (argumentCount > 0) { | 9244 if (argumentCount > 0) { |
| 8700 builder.append("<"); | 9245 builder.append("<"); |
| 8701 for (int i = 0; i < argumentCount; i++) { | 9246 for (int i = 0; i < argumentCount; i++) { |
| 8702 if (i > 0) { | 9247 if (i > 0) { |
| 8703 builder.append(", "); | 9248 builder.append(", "); |
| 8704 } | 9249 } |
| 8705 (typeArguments[i] as TypeImpl).appendTo(builder); | 9250 (typeArguments[i] as TypeImpl).appendTo(builder); |
| 8706 } | 9251 } |
| 8707 builder.append(">"); | 9252 builder.append(">"); |
| 8708 } | 9253 } |
| 8709 } | 9254 } |
| 8710 | 9255 |
| 9256 @override |
| 8711 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) { | 9257 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) { |
| 8712 if (object is! InterfaceTypeImpl) { | 9258 if (object is! InterfaceTypeImpl) { |
| 8713 return false; | 9259 return false; |
| 8714 } | 9260 } |
| 8715 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; | 9261 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; |
| 8716 return (element == otherType.element) && TypeImpl.equalArrays(typeArguments,
otherType.typeArguments, visitedElementPairs); | 9262 return (element == otherType.element) && TypeImpl.equalArrays(typeArguments,
otherType.typeArguments, visitedElementPairs); |
| 8717 } | 9263 } |
| 8718 | 9264 |
| 9265 @override |
| 8719 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { | 9266 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) { |
| 8720 // | 9267 // |
| 8721 // S is dynamic. | 9268 // S is dynamic. |
| 8722 // The test to determine whether S is dynamic is done here because dynamic i
s not an instance of | 9269 // The test to determine whether S is dynamic is done here because dynamic i
s not an instance of |
| 8723 // InterfaceType. | 9270 // InterfaceType. |
| 8724 // | 9271 // |
| 8725 if (identical(type, DynamicTypeImpl.instance)) { | 9272 if (identical(type, DynamicTypeImpl.instance)) { |
| 8726 return true; | 9273 return true; |
| 8727 } else if (type is! InterfaceType) { | 9274 } else if (type is! InterfaceType) { |
| 8728 return false; | 9275 return false; |
| 8729 } | 9276 } |
| 8730 return _isMoreSpecificThan(type as InterfaceType, new Set<ClassElement>(), w
ithDynamic, visitedTypePairs); | 9277 return _isMoreSpecificThan(type as InterfaceType, new Set<ClassElement>(), w
ithDynamic, visitedTypePairs); |
| 8731 } | 9278 } |
| 8732 | 9279 |
| 9280 @override |
| 8733 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) { | 9281 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) { |
| 8734 // | 9282 // |
| 8735 // T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S | 9283 // T is a subtype of S, written T <: S, iff [bottom/dynamic]T << S |
| 8736 // | 9284 // |
| 8737 if (identical(type, DynamicTypeImpl.instance)) { | 9285 if (identical(type, DynamicTypeImpl.instance)) { |
| 8738 return true; | 9286 return true; |
| 8739 } else if (type is TypeParameterType) { | 9287 } else if (type is TypeParameterType) { |
| 8740 return true; | 9288 return true; |
| 8741 } else if (type is FunctionType) { | 9289 } else if (type is FunctionType) { |
| 8742 ClassElement element = this.element; | 9290 ClassElement element = this.element; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8926 /** | 9474 /** |
| 8927 * Initialize a newly created type to be declared by the given element and to
have the given name. | 9475 * Initialize a newly created type to be declared by the given element and to
have the given name. |
| 8928 * | 9476 * |
| 8929 * @param element the element representing the declaration of the type | 9477 * @param element the element representing the declaration of the type |
| 8930 * @param name the name of the type | 9478 * @param name the name of the type |
| 8931 */ | 9479 */ |
| 8932 TypeImpl(Element element, this.name) { | 9480 TypeImpl(Element element, this.name) { |
| 8933 this._element = element; | 9481 this._element = element; |
| 8934 } | 9482 } |
| 8935 | 9483 |
| 9484 @override |
| 8936 String get displayName => name; | 9485 String get displayName => name; |
| 8937 | 9486 |
| 9487 @override |
| 8938 Element get element => _element; | 9488 Element get element => _element; |
| 8939 | 9489 |
| 9490 @override |
| 8940 DartType getLeastUpperBound(DartType type) => null; | 9491 DartType getLeastUpperBound(DartType type) => null; |
| 8941 | 9492 |
| 9493 @override |
| 8942 bool isAssignableTo(DartType type) => isAssignableTo2(type, new Set<TypeImpl_T
ypePair>()); | 9494 bool isAssignableTo(DartType type) => isAssignableTo2(type, new Set<TypeImpl_T
ypePair>()); |
| 8943 | 9495 |
| 8944 /** | 9496 /** |
| 8945 * Return `true` if this type is assignable to the given type. A type <i>T</i>
may be | 9497 * Return `true` if this type is assignable to the given type. A type <i>T</i>
may be |
| 8946 * assigned to a type <i>S</i>, written <i>T</i> ⇔ <i>S</i>, iff either <
i>T</i> <: <i>S</i> | 9498 * assigned to a type <i>S</i>, written <i>T</i> ⇔ <i>S</i>, iff either <
i>T</i> <: <i>S</i> |
| 8947 * or <i>S</i> <: <i>T</i>. | 9499 * or <i>S</i> <: <i>T</i>. |
| 8948 * | 9500 * |
| 8949 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method | 9501 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method |
| 8950 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is | 9502 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is |
| 8951 * used to prevent infinite loops. | 9503 * used to prevent infinite loops. |
| 8952 * | 9504 * |
| 8953 * @param type the type being compared with this type | 9505 * @param type the type being compared with this type |
| 8954 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s | 9506 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s |
| 8955 * @return `true` if this type is assignable to the given type | 9507 * @return `true` if this type is assignable to the given type |
| 8956 */ | 9508 */ |
| 8957 bool isAssignableTo2(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) =
> isSubtypeOf2(type, visitedTypePairs) || (type as TypeImpl).isSubtypeOf2(this,
visitedTypePairs); | 9509 bool isAssignableTo2(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) =
> isSubtypeOf2(type, visitedTypePairs) || (type as TypeImpl).isSubtypeOf2(this,
visitedTypePairs); |
| 8958 | 9510 |
| 9511 @override |
| 8959 bool get isBottom => false; | 9512 bool get isBottom => false; |
| 8960 | 9513 |
| 9514 @override |
| 8961 bool get isDartCoreFunction => false; | 9515 bool get isDartCoreFunction => false; |
| 8962 | 9516 |
| 9517 @override |
| 8963 bool get isDynamic => false; | 9518 bool get isDynamic => false; |
| 8964 | 9519 |
| 9520 @override |
| 8965 bool isMoreSpecificThan(DartType type) => isMoreSpecificThan2(type, false, new
Set<TypeImpl_TypePair>()); | 9521 bool isMoreSpecificThan(DartType type) => isMoreSpecificThan2(type, false, new
Set<TypeImpl_TypePair>()); |
| 8966 | 9522 |
| 8967 /** | 9523 /** |
| 8968 * Return `true` if this type is more specific than the given type. | 9524 * Return `true` if this type is more specific than the given type. |
| 8969 * | 9525 * |
| 8970 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method | 9526 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method |
| 8971 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is | 9527 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is |
| 8972 * used to prevent infinite loops. | 9528 * used to prevent infinite loops. |
| 8973 * | 9529 * |
| 8974 * @param type the type being compared with this type | 9530 * @param type the type being compared with this type |
| 8975 * @param withDynamic `true` if "dynamic" should be considered as a subtype of
any type | 9531 * @param withDynamic `true` if "dynamic" should be considered as a subtype of
any type |
| 8976 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s | 9532 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s |
| 8977 * @return `true` if this type is more specific than the given type | 9533 * @return `true` if this type is more specific than the given type |
| 8978 */ | 9534 */ |
| 8979 bool isMoreSpecificThan2(DartType type, bool withDynamic, Set<TypeImpl_TypePai
r> visitedTypePairs) { | 9535 bool isMoreSpecificThan2(DartType type, bool withDynamic, Set<TypeImpl_TypePai
r> visitedTypePairs) { |
| 8980 // If the visitedTypePairs already has the pair (this, type), return false | 9536 // If the visitedTypePairs already has the pair (this, type), return false |
| 8981 TypeImpl_TypePair typePair = new TypeImpl_TypePair(this, type); | 9537 TypeImpl_TypePair typePair = new TypeImpl_TypePair(this, type); |
| 8982 if (!visitedTypePairs.add(typePair)) { | 9538 if (!visitedTypePairs.add(typePair)) { |
| 8983 return false; | 9539 return false; |
| 8984 } | 9540 } |
| 8985 bool result = internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs
); | 9541 bool result = internalIsMoreSpecificThan(type, withDynamic, visitedTypePairs
); |
| 8986 visitedTypePairs.remove(typePair); | 9542 visitedTypePairs.remove(typePair); |
| 8987 return result; | 9543 return result; |
| 8988 } | 9544 } |
| 8989 | 9545 |
| 9546 @override |
| 8990 bool get isObject => false; | 9547 bool get isObject => false; |
| 8991 | 9548 |
| 9549 @override |
| 8992 bool isSubtypeOf(DartType type) => isSubtypeOf2(type, new Set<TypeImpl_TypePai
r>()); | 9550 bool isSubtypeOf(DartType type) => isSubtypeOf2(type, new Set<TypeImpl_TypePai
r>()); |
| 8993 | 9551 |
| 8994 /** | 9552 /** |
| 8995 * Return `true` if this type is a subtype of the given type. | 9553 * Return `true` if this type is a subtype of the given type. |
| 8996 * | 9554 * |
| 8997 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method | 9555 * The given set of pairs of types (T1, T2), where each pair indicates that we
invoked this method |
| 8998 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is | 9556 * because we are in the process of answering the question of whether T1 is a
subtype of T2, is |
| 8999 * used to prevent infinite loops. | 9557 * used to prevent infinite loops. |
| 9000 * | 9558 * |
| 9001 * @param type the type being compared with this type | 9559 * @param type the type being compared with this type |
| 9002 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s | 9560 * @param visitedPairs the set of pairs of types used to prevent infinite loop
s |
| 9003 * @return `true` if this type is a subtype of the given type | 9561 * @return `true` if this type is a subtype of the given type |
| 9004 */ | 9562 */ |
| 9005 bool isSubtypeOf2(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) { | 9563 bool isSubtypeOf2(DartType type, Set<TypeImpl_TypePair> visitedTypePairs) { |
| 9006 // If the visitedTypePairs already has the pair (this, type), return false | 9564 // If the visitedTypePairs already has the pair (this, type), return false |
| 9007 TypeImpl_TypePair typePair = new TypeImpl_TypePair(this, type); | 9565 TypeImpl_TypePair typePair = new TypeImpl_TypePair(this, type); |
| 9008 if (!visitedTypePairs.add(typePair)) { | 9566 if (!visitedTypePairs.add(typePair)) { |
| 9009 return false; | 9567 return false; |
| 9010 } | 9568 } |
| 9011 bool result = internalIsSubtypeOf(type, visitedTypePairs); | 9569 bool result = internalIsSubtypeOf(type, visitedTypePairs); |
| 9012 visitedTypePairs.remove(typePair); | 9570 visitedTypePairs.remove(typePair); |
| 9013 return result; | 9571 return result; |
| 9014 } | 9572 } |
| 9015 | 9573 |
| 9574 @override |
| 9016 bool isSupertypeOf(DartType type) => type.isSubtypeOf(this); | 9575 bool isSupertypeOf(DartType type) => type.isSubtypeOf(this); |
| 9017 | 9576 |
| 9577 @override |
| 9018 bool get isVoid => false; | 9578 bool get isVoid => false; |
| 9019 | 9579 |
| 9580 @override |
| 9020 String toString() { | 9581 String toString() { |
| 9021 JavaStringBuilder builder = new JavaStringBuilder(); | 9582 JavaStringBuilder builder = new JavaStringBuilder(); |
| 9022 appendTo(builder); | 9583 appendTo(builder); |
| 9023 return builder.toString(); | 9584 return builder.toString(); |
| 9024 } | 9585 } |
| 9025 | 9586 |
| 9026 /** | 9587 /** |
| 9027 * Append a textual representation of this type to the given builder. | 9588 * Append a textual representation of this type to the given builder. |
| 9028 * | 9589 * |
| 9029 * @param builder the builder to which the text is to be appended | 9590 * @param builder the builder to which the text is to be appended |
| (...skipping 16 matching lines...) Expand all Loading... |
| 9046 class TypeImpl_TypePair { | 9607 class TypeImpl_TypePair { |
| 9047 DartType _firstType; | 9608 DartType _firstType; |
| 9048 | 9609 |
| 9049 DartType _secondType; | 9610 DartType _secondType; |
| 9050 | 9611 |
| 9051 TypeImpl_TypePair(DartType firstType, DartType secondType) { | 9612 TypeImpl_TypePair(DartType firstType, DartType secondType) { |
| 9052 this._firstType = firstType; | 9613 this._firstType = firstType; |
| 9053 this._secondType = secondType; | 9614 this._secondType = secondType; |
| 9054 } | 9615 } |
| 9055 | 9616 |
| 9617 @override |
| 9056 bool operator ==(Object object) { | 9618 bool operator ==(Object object) { |
| 9057 if (identical(object, this)) { | 9619 if (identical(object, this)) { |
| 9058 return true; | 9620 return true; |
| 9059 } | 9621 } |
| 9060 if (object is TypeImpl_TypePair) { | 9622 if (object is TypeImpl_TypePair) { |
| 9061 TypeImpl_TypePair typePair = object; | 9623 TypeImpl_TypePair typePair = object; |
| 9062 return _firstType == typePair._firstType && _secondType != null && _second
Type == typePair._secondType; | 9624 return _firstType == typePair._firstType && _secondType != null && _second
Type == typePair._secondType; |
| 9063 } | 9625 } |
| 9064 return false; | 9626 return false; |
| 9065 } | 9627 } |
| 9066 | 9628 |
| 9629 @override |
| 9067 int get hashCode { | 9630 int get hashCode { |
| 9068 int firstHashCode = 0; | 9631 int firstHashCode = 0; |
| 9069 if (_firstType != null) { | 9632 if (_firstType != null) { |
| 9070 firstHashCode = _firstType.element == null ? 0 : _firstType.element.hashCo
de; | 9633 firstHashCode = _firstType.element == null ? 0 : _firstType.element.hashCo
de; |
| 9071 } | 9634 } |
| 9072 int secondHashCode = 0; | 9635 int secondHashCode = 0; |
| 9073 if (_secondType != null) { | 9636 if (_secondType != null) { |
| 9074 secondHashCode = _secondType.element == null ? 0 : _secondType.element.has
hCode; | 9637 secondHashCode = _secondType.element == null ? 0 : _secondType.element.has
hCode; |
| 9075 } | 9638 } |
| 9076 return firstHashCode + secondHashCode; | 9639 return firstHashCode + secondHashCode; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9108 } | 9671 } |
| 9109 | 9672 |
| 9110 /** | 9673 /** |
| 9111 * Initialize a newly created type parameter type to be declared by the given
element and to have | 9674 * Initialize a newly created type parameter type to be declared by the given
element and to have |
| 9112 * the given name. | 9675 * the given name. |
| 9113 * | 9676 * |
| 9114 * @param element the element representing the declaration of the type paramet
er | 9677 * @param element the element representing the declaration of the type paramet
er |
| 9115 */ | 9678 */ |
| 9116 TypeParameterTypeImpl(TypeParameterElement element) : super(element, element.n
ame); | 9679 TypeParameterTypeImpl(TypeParameterElement element) : super(element, element.n
ame); |
| 9117 | 9680 |
| 9681 @override |
| 9118 bool operator ==(Object object) => object is TypeParameterTypeImpl && (element
== object.element); | 9682 bool operator ==(Object object) => object is TypeParameterTypeImpl && (element
== object.element); |
| 9119 | 9683 |
| 9684 @override |
| 9120 TypeParameterElement get element => super.element as TypeParameterElement; | 9685 TypeParameterElement get element => super.element as TypeParameterElement; |
| 9121 | 9686 |
| 9687 @override |
| 9122 int get hashCode => element.hashCode; | 9688 int get hashCode => element.hashCode; |
| 9123 | 9689 |
| 9690 @override |
| 9124 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es) { | 9691 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es) { |
| 9125 int length = parameterTypes.length; | 9692 int length = parameterTypes.length; |
| 9126 for (int i = 0; i < length; i++) { | 9693 for (int i = 0; i < length; i++) { |
| 9127 if (parameterTypes[i] == this) { | 9694 if (parameterTypes[i] == this) { |
| 9128 return argumentTypes[i]; | 9695 return argumentTypes[i]; |
| 9129 } | 9696 } |
| 9130 } | 9697 } |
| 9131 return this; | 9698 return this; |
| 9132 } | 9699 } |
| 9133 | 9700 |
| 9701 @override |
| 9134 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => th
is == object; | 9702 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => th
is == object; |
| 9135 | 9703 |
| 9704 @override |
| 9136 bool internalIsMoreSpecificThan(DartType s, bool withDynamic, Set<TypeImpl_Typ
ePair> visitedTypePairs) { | 9705 bool internalIsMoreSpecificThan(DartType s, bool withDynamic, Set<TypeImpl_Typ
ePair> visitedTypePairs) { |
| 9137 // | 9706 // |
| 9138 // A type T is more specific than a type S, written T << S, if one of the f
ollowing conditions | 9707 // A type T is more specific than a type S, written T << S, if one of the f
ollowing conditions |
| 9139 // is met: | 9708 // is met: |
| 9140 // | 9709 // |
| 9141 // Reflexivity: T is S. | 9710 // Reflexivity: T is S. |
| 9142 // | 9711 // |
| 9143 if (this == s) { | 9712 if (this == s) { |
| 9144 return true; | 9713 return true; |
| 9145 } | 9714 } |
| 9146 // S is bottom. | 9715 // S is bottom. |
| 9147 // | 9716 // |
| 9148 if (s.isBottom) { | 9717 if (s.isBottom) { |
| 9149 return true; | 9718 return true; |
| 9150 } | 9719 } |
| 9151 // S is dynamic. | 9720 // S is dynamic. |
| 9152 // | 9721 // |
| 9153 if (s.isDynamic) { | 9722 if (s.isDynamic) { |
| 9154 return true; | 9723 return true; |
| 9155 } | 9724 } |
| 9156 return _isMoreSpecificThan(s, new Set<DartType>(), withDynamic, visitedTypeP
airs); | 9725 return _isMoreSpecificThan(s, new Set<DartType>(), withDynamic, visitedTypeP
airs); |
| 9157 } | 9726 } |
| 9158 | 9727 |
| 9728 @override |
| 9159 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => isMoreSpecificThan2(type, true, new Set<TypeImpl_TypePair>()); | 9729 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => isMoreSpecificThan2(type, true, new Set<TypeImpl_TypePair>()); |
| 9160 | 9730 |
| 9161 bool _isMoreSpecificThan(DartType s, Set<DartType> visitedTypes, bool withDyna
mic, Set<TypeImpl_TypePair> visitedTypePairs) { | 9731 bool _isMoreSpecificThan(DartType s, Set<DartType> visitedTypes, bool withDyna
mic, Set<TypeImpl_TypePair> visitedTypePairs) { |
| 9162 // T is a type parameter and S is the upper bound of T. | 9732 // T is a type parameter and S is the upper bound of T. |
| 9163 // | 9733 // |
| 9164 DartType bound = element.bound; | 9734 DartType bound = element.bound; |
| 9165 if (s == bound) { | 9735 if (s == bound) { |
| 9166 return true; | 9736 return true; |
| 9167 } | 9737 } |
| 9168 // T is a type parameter and S is Object. | 9738 // T is a type parameter and S is Object. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9206 * | 9776 * |
| 9207 * @return the unique instance of this class | 9777 * @return the unique instance of this class |
| 9208 */ | 9778 */ |
| 9209 static VoidTypeImpl get instance => _INSTANCE; | 9779 static VoidTypeImpl get instance => _INSTANCE; |
| 9210 | 9780 |
| 9211 /** | 9781 /** |
| 9212 * Prevent the creation of instances of this class. | 9782 * Prevent the creation of instances of this class. |
| 9213 */ | 9783 */ |
| 9214 VoidTypeImpl() : super(null, Keyword.VOID.syntax); | 9784 VoidTypeImpl() : super(null, Keyword.VOID.syntax); |
| 9215 | 9785 |
| 9786 @override |
| 9216 bool operator ==(Object object) => identical(object, this); | 9787 bool operator ==(Object object) => identical(object, this); |
| 9217 | 9788 |
| 9789 @override |
| 9218 int get hashCode => 2; | 9790 int get hashCode => 2; |
| 9219 | 9791 |
| 9792 @override |
| 9220 bool get isVoid => true; | 9793 bool get isVoid => true; |
| 9221 | 9794 |
| 9795 @override |
| 9222 VoidTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> paramete
rTypes) => this; | 9796 VoidTypeImpl substitute2(List<DartType> argumentTypes, List<DartType> paramete
rTypes) => this; |
| 9223 | 9797 |
| 9798 @override |
| 9224 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); | 9799 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id
entical(object, this); |
| 9225 | 9800 |
| 9801 @override |
| 9226 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) => isSubtypeOf(type); | 9802 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs) => isSubtypeOf(type); |
| 9227 | 9803 |
| 9804 @override |
| 9228 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => identical(type, this) || identical(type, DynamicTypeImpl.instance); | 9805 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s) => identical(type, this) || identical(type, DynamicTypeImpl.instance); |
| 9229 } | 9806 } |
| 9230 | 9807 |
| 9231 /** | 9808 /** |
| 9232 * The interface `FunctionType` defines the behavior common to objects represent
ing the type | 9809 * The interface `FunctionType` defines the behavior common to objects represent
ing the type |
| 9233 * of a function, method, constructor, getter, or setter. Function types come in
three variations: | 9810 * of a function, method, constructor, getter, or setter. Function types come in
three variations: |
| 9234 * <ol> | 9811 * <ol> |
| 9235 * * The types of functions that only have required parameters. These have the g
eneral form | 9812 * * The types of functions that only have required parameters. These have the g
eneral form |
| 9236 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>. | 9813 * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>. |
| 9237 * * The types of functions with optional positional parameters. These have the
general form | 9814 * * The types of functions with optional positional parameters. These have the
general form |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9331 * T<sub>n</sub>, []) → T.</i> | 9908 * T<sub>n</sub>, []) → T.</i> |
| 9332 * | 9909 * |
| 9333 * All functions implement the class `Function`. However not all function type
s are a | 9910 * All functions implement the class `Function`. However not all function type
s are a |
| 9334 * subtype of `Function`. If an interface type <i>I</i> includes a method name
d | 9911 * subtype of `Function`. If an interface type <i>I</i> includes a method name
d |
| 9335 * `call()`, and the type of `call()` is the function type <i>F</i>, then <i>I
</i> is | 9912 * `call()`, and the type of `call()` is the function type <i>F</i>, then <i>I
</i> is |
| 9336 * considered to be a subtype of <i>F</i>. | 9913 * considered to be a subtype of <i>F</i>. |
| 9337 * | 9914 * |
| 9338 * @param type the type being compared with this type | 9915 * @param type the type being compared with this type |
| 9339 * @return `true` if this type is a subtype of the given type | 9916 * @return `true` if this type is a subtype of the given type |
| 9340 */ | 9917 */ |
| 9918 @override |
| 9341 bool isSubtypeOf(DartType type); | 9919 bool isSubtypeOf(DartType type); |
| 9342 | 9920 |
| 9343 /** | 9921 /** |
| 9344 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. | 9922 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. |
| 9345 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. | 9923 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. |
| 9346 * | 9924 * |
| 9347 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters | 9925 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters |
| 9348 * @return the result of performing the substitution | 9926 * @return the result of performing the substitution |
| 9349 */ | 9927 */ |
| 9350 FunctionType substitute3(List<DartType> argumentTypes); | 9928 FunctionType substitute3(List<DartType> argumentTypes); |
| 9351 | 9929 |
| 9930 @override |
| 9352 FunctionType substitute2(List<DartType> argumentTypes, List<DartType> paramete
rTypes); | 9931 FunctionType substitute2(List<DartType> argumentTypes, List<DartType> paramete
rTypes); |
| 9353 } | 9932 } |
| 9354 | 9933 |
| 9355 /** | 9934 /** |
| 9356 * The interface `InterfaceType` defines the behavior common to objects represen
ting the type | 9935 * The interface `InterfaceType` defines the behavior common to objects represen
ting the type |
| 9357 * introduced by either a class or an interface, or a reference to such a type. | 9936 * introduced by either a class or an interface, or a reference to such a type. |
| 9358 */ | 9937 */ |
| 9359 abstract class InterfaceType implements ParameterizedType { | 9938 abstract class InterfaceType implements ParameterizedType { |
| 9360 /** | 9939 /** |
| 9361 * Return an array containing all of the accessors (getters and setters) decla
red in this type. | 9940 * Return an array containing all of the accessors (getters and setters) decla
red in this type. |
| 9362 * | 9941 * |
| 9363 * @return the accessors declared in this type | 9942 * @return the accessors declared in this type |
| 9364 */ | 9943 */ |
| 9365 List<PropertyAccessorElement> get accessors; | 9944 List<PropertyAccessorElement> get accessors; |
| 9366 | 9945 |
| 9946 @override |
| 9367 ClassElement get element; | 9947 ClassElement get element; |
| 9368 | 9948 |
| 9369 /** | 9949 /** |
| 9370 * Return the element representing the getter with the given name that is decl
ared in this class, | 9950 * Return the element representing the getter with the given name that is decl
ared in this class, |
| 9371 * or `null` if this class does not declare a getter with the given name. | 9951 * or `null` if this class does not declare a getter with the given name. |
| 9372 * | 9952 * |
| 9373 * @param getterName the name of the getter to be returned | 9953 * @param getterName the name of the getter to be returned |
| 9374 * @return the getter declared in this class with the given name | 9954 * @return the getter declared in this class with the given name |
| 9375 */ | 9955 */ |
| 9376 PropertyAccessorElement getGetter(String getterName); | 9956 PropertyAccessorElement getGetter(String getterName); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 9393 * and let <i>S = (I ∪ S<sub>I</sub>) ∩ (J ∪ S<sub>J</sub>)</i>. F
urthermore, we | 9973 * and let <i>S = (I ∪ S<sub>I</sub>) ∩ (J ∪ S<sub>J</sub>)</i>. F
urthermore, we |
| 9394 * define <i>S<sub>n</sub> = {T | T ∈ S ∧ depth(T) = n}</i> for any f
inite <i>n</i>, | 9974 * define <i>S<sub>n</sub> = {T | T ∈ S ∧ depth(T) = n}</i> for any f
inite <i>n</i>, |
| 9395 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat
h from <i>T</i> to | 9975 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat
h from <i>T</i> to |
| 9396 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub
></i> has | 9976 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub
></i> has |
| 9397 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole
element of | 9977 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole
element of |
| 9398 * <i>S<sub>q</sub></i>. | 9978 * <i>S<sub>q</sub></i>. |
| 9399 * | 9979 * |
| 9400 * @param type the other type used to compute the least upper bound | 9980 * @param type the other type used to compute the least upper bound |
| 9401 * @return the least upper bound of this type and the given type | 9981 * @return the least upper bound of this type and the given type |
| 9402 */ | 9982 */ |
| 9983 @override |
| 9403 DartType getLeastUpperBound(DartType type); | 9984 DartType getLeastUpperBound(DartType type); |
| 9404 | 9985 |
| 9405 /** | 9986 /** |
| 9406 * Return the element representing the method with the given name that is decl
ared in this class, | 9987 * Return the element representing the method with the given name that is decl
ared in this class, |
| 9407 * or `null` if this class does not declare a method with the given name. | 9988 * or `null` if this class does not declare a method with the given name. |
| 9408 * | 9989 * |
| 9409 * @param methodName the name of the method to be returned | 9990 * @param methodName the name of the method to be returned |
| 9410 * @return the method declared in this class with the given name | 9991 * @return the method declared in this class with the given name |
| 9411 */ | 9992 */ |
| 9412 MethodElement getMethod(String methodName); | 9993 MethodElement getMethod(String methodName); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9472 * * Direct supertype: <i>S</i> is a direct supertype of <i>T</i>. | 10053 * * Direct supertype: <i>S</i> is a direct supertype of <i>T</i>. |
| 9473 * * <i>T</i> is a type parameter and <i>S</i> is the upper bound of <i>T</i>. | 10054 * * <i>T</i> is a type parameter and <i>S</i> is the upper bound of <i>T</i>. |
| 9474 * * Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<su
b>n</sub>></i> | 10055 * * Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<su
b>n</sub>></i> |
| 9475 * and S</i> is of the form <i>I<S<sub>1</sub>, …, S<sub>n</sub>>
</i> and | 10056 * and S</i> is of the form <i>I<S<sub>1</sub>, …, S<sub>n</sub>>
</i> and |
| 9476 * <i>T<sub>i</sub> « S<sub>i</sub></i>, <i>1 <= i <= n</i>. | 10057 * <i>T<sub>i</sub> « S<sub>i</sub></i>, <i>1 <= i <= n</i>. |
| 9477 * * Transitivity: <i>T « U</i> and <i>U « S</i>. | 10058 * * Transitivity: <i>T « U</i> and <i>U « S</i>. |
| 9478 * | 10059 * |
| 9479 * @param type the type being compared with this type | 10060 * @param type the type being compared with this type |
| 9480 * @return `true` if this type is more specific than the given type | 10061 * @return `true` if this type is more specific than the given type |
| 9481 */ | 10062 */ |
| 10063 @override |
| 9482 bool isMoreSpecificThan(DartType type); | 10064 bool isMoreSpecificThan(DartType type); |
| 9483 | 10065 |
| 9484 /** | 10066 /** |
| 9485 * Return `true` if this type is a subtype of the given type. An interface typ
e <i>T</i> is | 10067 * Return `true` if this type is a subtype of the given type. An interface typ
e <i>T</i> is |
| 9486 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff | 10068 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff |
| 9487 * <i>[bottom/dynamic]T</i> « <i>S</i> (<i>T</i> is more specific than <
i>S</i>). If an | 10069 * <i>[bottom/dynamic]T</i> « <i>S</i> (<i>T</i> is more specific than <
i>S</i>). If an |
| 9488 * interface type <i>I</i> includes a method named <i>call()</i>, and the type
of <i>call()</i> is | 10070 * interface type <i>I</i> includes a method named <i>call()</i>, and the type
of <i>call()</i> is |
| 9489 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of
<i>F</i>. | 10071 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of
<i>F</i>. |
| 9490 * | 10072 * |
| 9491 * @param type the type being compared with this type | 10073 * @param type the type being compared with this type |
| 9492 * @return `true` if this type is a subtype of the given type | 10074 * @return `true` if this type is a subtype of the given type |
| 9493 */ | 10075 */ |
| 10076 @override |
| 9494 bool isSubtypeOf(DartType type); | 10077 bool isSubtypeOf(DartType type); |
| 9495 | 10078 |
| 9496 /** | 10079 /** |
| 9497 * Return the element representing the constructor that results from looking u
p the given | 10080 * Return the element representing the constructor that results from looking u
p the given |
| 9498 * constructor in this class with respect to the given library, or `null` if t
he look up | 10081 * constructor in this class with respect to the given library, or `null` if t
he look up |
| 9499 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section | 10082 * fails. The behavior of this method is defined by the Dart Language Specific
ation in section |
| 9500 * 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 | 10083 * 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 |
| 9501 * the constructor <i>T.id</i>, otherwise let <i>q<i> be the constructor <i>T<
i>. Otherwise, if | 10084 * the constructor <i>T.id</i>, otherwise let <i>q<i> be the constructor <i>T<
i>. Otherwise, if |
| 9502 * <i>q</i> is not defined or not accessible, a NoSuchMethodException is throw
n. </blockquote> | 10085 * <i>q</i> is not defined or not accessible, a NoSuchMethodException is throw
n. </blockquote> |
| 9503 * | 10086 * |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9628 | 10211 |
| 9629 /** | 10212 /** |
| 9630 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. | 10213 * Return the type resulting from substituting the given arguments for this ty
pe's parameters. |
| 9631 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. | 10214 * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`
. |
| 9632 * | 10215 * |
| 9633 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters | 10216 * @param argumentTypes the actual type arguments being substituted for the ty
pe parameters |
| 9634 * @return the result of performing the substitution | 10217 * @return the result of performing the substitution |
| 9635 */ | 10218 */ |
| 9636 InterfaceType substitute4(List<DartType> argumentTypes); | 10219 InterfaceType substitute4(List<DartType> argumentTypes); |
| 9637 | 10220 |
| 10221 @override |
| 9638 InterfaceType substitute2(List<DartType> argumentTypes, List<DartType> paramet
erTypes); | 10222 InterfaceType substitute2(List<DartType> argumentTypes, List<DartType> paramet
erTypes); |
| 9639 } | 10223 } |
| 9640 | 10224 |
| 9641 /** | 10225 /** |
| 9642 * The interface `ParameterizedType` defines the behavior common to objects repr
esenting a | 10226 * The interface `ParameterizedType` defines the behavior common to objects repr
esenting a |
| 9643 * type with type parameters, such as a class or function type alias. | 10227 * type with type parameters, such as a class or function type alias. |
| 9644 */ | 10228 */ |
| 9645 abstract class ParameterizedType implements DartType { | 10229 abstract class ParameterizedType implements DartType { |
| 9646 /** | 10230 /** |
| 9647 * Return an array containing the actual types of the type arguments. If this
type's element does | 10231 * Return an array containing the actual types of the type arguments. If this
type's element does |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9787 * @return the result of performing the substitution | 10371 * @return the result of performing the substitution |
| 9788 */ | 10372 */ |
| 9789 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); | 10373 DartType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); |
| 9790 } | 10374 } |
| 9791 | 10375 |
| 9792 /** | 10376 /** |
| 9793 * The interface `TypeParameterType` defines the behavior of objects representin
g the type | 10377 * The interface `TypeParameterType` defines the behavior of objects representin
g the type |
| 9794 * introduced by a type parameter. | 10378 * introduced by a type parameter. |
| 9795 */ | 10379 */ |
| 9796 abstract class TypeParameterType implements DartType { | 10380 abstract class TypeParameterType implements DartType { |
| 10381 @override |
| 9797 TypeParameterElement get element; | 10382 TypeParameterElement get element; |
| 9798 } | 10383 } |
| 9799 | 10384 |
| 9800 /** | 10385 /** |
| 9801 * The interface `VoidType` defines the behavior of the unique object representi
ng the type | 10386 * The interface `VoidType` defines the behavior of the unique object representi
ng the type |
| 9802 * `void`. | 10387 * `void`. |
| 9803 */ | 10388 */ |
| 9804 abstract class VoidType implements DartType { | 10389 abstract class VoidType implements DartType { |
| 10390 @override |
| 9805 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); | 10391 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); |
| 9806 } | 10392 } |
| OLD | NEW |