| 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 * @return `true` if this annotation marks the associated class as implementin
g a proxy | 724 * @return `true` if this annotation marks the associated class as implementin
g a proxy |
| 725 * object | 725 * object |
| 726 */ | 726 */ |
| 727 bool get isProxy; | 727 bool get isProxy; |
| 728 } | 728 } |
| 729 | 729 |
| 730 /** | 730 /** |
| 731 * The enumeration `ElementKind` defines the various kinds of elements in the el
ement model. | 731 * The enumeration `ElementKind` defines the various kinds of elements in the el
ement model. |
| 732 */ | 732 */ |
| 733 class ElementKind extends Enum<ElementKind> { | 733 class ElementKind extends Enum<ElementKind> { |
| 734 static final ElementKind ANGULAR_FILTER = new ElementKind('ANGULAR_FILTER', 0,
"Angular filter"); | 734 static const ElementKind ANGULAR_FILTER = const ElementKind('ANGULAR_FILTER',
0, "Angular filter"); |
| 735 | 735 |
| 736 static final ElementKind ANGULAR_COMPONENT = new ElementKind('ANGULAR_COMPONEN
T', 1, "Angular component"); | 736 static const ElementKind ANGULAR_COMPONENT = const ElementKind('ANGULAR_COMPON
ENT', 1, "Angular component"); |
| 737 | 737 |
| 738 static final ElementKind ANGULAR_CONTROLLER = new ElementKind('ANGULAR_CONTROL
LER', 2, "Angular controller"); | 738 static const ElementKind ANGULAR_CONTROLLER = const ElementKind('ANGULAR_CONTR
OLLER', 2, "Angular controller"); |
| 739 | 739 |
| 740 static final ElementKind ANGULAR_DIRECTIVE = new ElementKind('ANGULAR_DIRECTIV
E', 3, "Angular directive"); | 740 static const ElementKind ANGULAR_DIRECTIVE = const ElementKind('ANGULAR_DIRECT
IVE', 3, "Angular directive"); |
| 741 | 741 |
| 742 static final ElementKind ANGULAR_PROPERTY = new ElementKind('ANGULAR_PROPERTY'
, 4, "Angular property"); | 742 static const ElementKind ANGULAR_PROPERTY = const ElementKind('ANGULAR_PROPERT
Y', 4, "Angular property"); |
| 743 | 743 |
| 744 static final ElementKind ANGULAR_SCOPE_PROPERTY = new ElementKind('ANGULAR_SCO
PE_PROPERTY', 5, "Angular scope property"); | 744 static const ElementKind ANGULAR_SCOPE_PROPERTY = const ElementKind('ANGULAR_S
COPE_PROPERTY', 5, "Angular scope property"); |
| 745 | 745 |
| 746 static final ElementKind ANGULAR_SELECTOR = new ElementKind('ANGULAR_SELECTOR'
, 6, "Angular selector"); | 746 static const ElementKind ANGULAR_SELECTOR = const ElementKind('ANGULAR_SELECTO
R', 6, "Angular selector"); |
| 747 | 747 |
| 748 static final ElementKind ANGULAR_VIEW = new ElementKind('ANGULAR_VIEW', 7, "An
gular view"); | 748 static const ElementKind ANGULAR_VIEW = const ElementKind('ANGULAR_VIEW', 7, "
Angular view"); |
| 749 | 749 |
| 750 static final ElementKind CLASS = new ElementKind('CLASS', 8, "class"); | 750 static const ElementKind CLASS = const ElementKind('CLASS', 8, "class"); |
| 751 | 751 |
| 752 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT'
, 9, "compilation unit"); | 752 static const ElementKind COMPILATION_UNIT = const ElementKind('COMPILATION_UNI
T', 9, "compilation unit"); |
| 753 | 753 |
| 754 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 10, "con
structor"); | 754 static const ElementKind CONSTRUCTOR = const ElementKind('CONSTRUCTOR', 10, "c
onstructor"); |
| 755 | 755 |
| 756 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 11, "<dynamic>")
; | 756 static const ElementKind DYNAMIC = const ElementKind('DYNAMIC', 11, "<dynamic>
"); |
| 757 | 757 |
| 758 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML
_SCRIPT', 12, "embedded html script"); | 758 static const ElementKind EMBEDDED_HTML_SCRIPT = const ElementKind('EMBEDDED_HT
ML_SCRIPT', 12, "embedded html script"); |
| 759 | 759 |
| 760 static final ElementKind ERROR = new ElementKind('ERROR', 13, "<error>"); | 760 static const ElementKind ERROR = const ElementKind('ERROR', 13, "<error>"); |
| 761 | 761 |
| 762 static final ElementKind EXPORT = new ElementKind('EXPORT', 14, "export direct
ive"); | 762 static const ElementKind EXPORT = const ElementKind('EXPORT', 14, "export dire
ctive"); |
| 763 | 763 |
| 764 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML
_SCRIPT', 15, "external html script"); | 764 static const ElementKind EXTERNAL_HTML_SCRIPT = const ElementKind('EXTERNAL_HT
ML_SCRIPT', 15, "external html script"); |
| 765 | 765 |
| 766 static final ElementKind FIELD = new ElementKind('FIELD', 16, "field"); | 766 static const ElementKind FIELD = const ElementKind('FIELD', 16, "field"); |
| 767 | 767 |
| 768 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 17, "function"
); | 768 static const ElementKind FUNCTION = const ElementKind('FUNCTION', 17, "functio
n"); |
| 769 | 769 |
| 770 static final ElementKind GETTER = new ElementKind('GETTER', 18, "getter"); | 770 static const ElementKind GETTER = const ElementKind('GETTER', 18, "getter"); |
| 771 | 771 |
| 772 static final ElementKind HTML = new ElementKind('HTML', 19, "html"); | 772 static const ElementKind HTML = const ElementKind('HTML', 19, "html"); |
| 773 | 773 |
| 774 static final ElementKind IMPORT = new ElementKind('IMPORT', 20, "import direct
ive"); | 774 static const ElementKind IMPORT = const ElementKind('IMPORT', 20, "import dire
ctive"); |
| 775 | 775 |
| 776 static final ElementKind LABEL = new ElementKind('LABEL', 21, "label"); | 776 static const ElementKind LABEL = const ElementKind('LABEL', 21, "label"); |
| 777 | 777 |
| 778 static final ElementKind LIBRARY = new ElementKind('LIBRARY', 22, "library"); | 778 static const ElementKind LIBRARY = const ElementKind('LIBRARY', 22, "library")
; |
| 779 | 779 |
| 780 static final ElementKind LOCAL_VARIABLE = new ElementKind('LOCAL_VARIABLE', 23
, "local variable"); | 780 static const ElementKind LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE',
23, "local variable"); |
| 781 | 781 |
| 782 static final ElementKind METHOD = new ElementKind('METHOD', 24, "method"); | 782 static const ElementKind METHOD = const ElementKind('METHOD', 24, "method"); |
| 783 | 783 |
| 784 static final ElementKind NAME = new ElementKind('NAME', 25, "<name>"); | 784 static const ElementKind NAME = const ElementKind('NAME', 25, "<name>"); |
| 785 | 785 |
| 786 static final ElementKind PARAMETER = new ElementKind('PARAMETER', 26, "paramet
er"); | 786 static const ElementKind PARAMETER = const ElementKind('PARAMETER', 26, "param
eter"); |
| 787 | 787 |
| 788 static final ElementKind PREFIX = new ElementKind('PREFIX', 27, "import prefix
"); | 788 static const ElementKind PREFIX = const ElementKind('PREFIX', 27, "import pref
ix"); |
| 789 | 789 |
| 790 static final ElementKind SETTER = new ElementKind('SETTER', 28, "setter"); | 790 static const ElementKind SETTER = const ElementKind('SETTER', 28, "setter"); |
| 791 | 791 |
| 792 static final ElementKind TOP_LEVEL_VARIABLE = new ElementKind('TOP_LEVEL_VARIA
BLE', 29, "top level variable"); | 792 static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VAR
IABLE', 29, "top level variable"); |
| 793 | 793 |
| 794 static final ElementKind FUNCTION_TYPE_ALIAS = new ElementKind('FUNCTION_TYPE_
ALIAS', 30, "function type alias"); | 794 static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYP
E_ALIAS', 30, "function type alias"); |
| 795 | 795 |
| 796 static final ElementKind TYPE_PARAMETER = new ElementKind('TYPE_PARAMETER', 31
, "type parameter"); | 796 static const ElementKind TYPE_PARAMETER = const ElementKind('TYPE_PARAMETER',
31, "type parameter"); |
| 797 | 797 |
| 798 static final ElementKind UNIVERSE = new ElementKind('UNIVERSE', 32, "<universe
>"); | 798 static const ElementKind UNIVERSE = const ElementKind('UNIVERSE', 32, "<univer
se>"); |
| 799 | 799 |
| 800 static final List<ElementKind> values = [ | 800 static const List<ElementKind> values = const [ |
| 801 ANGULAR_FILTER, | 801 ANGULAR_FILTER, |
| 802 ANGULAR_COMPONENT, | 802 ANGULAR_COMPONENT, |
| 803 ANGULAR_CONTROLLER, | 803 ANGULAR_CONTROLLER, |
| 804 ANGULAR_DIRECTIVE, | 804 ANGULAR_DIRECTIVE, |
| 805 ANGULAR_PROPERTY, | 805 ANGULAR_PROPERTY, |
| 806 ANGULAR_SCOPE_PROPERTY, | 806 ANGULAR_SCOPE_PROPERTY, |
| 807 ANGULAR_SELECTOR, | 807 ANGULAR_SELECTOR, |
| 808 ANGULAR_VIEW, | 808 ANGULAR_VIEW, |
| 809 CLASS, | 809 CLASS, |
| 810 COMPILATION_UNIT, | 810 COMPILATION_UNIT, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 static ElementKind of(Element element) { | 842 static ElementKind of(Element element) { |
| 843 if (element == null) { | 843 if (element == null) { |
| 844 return ERROR; | 844 return ERROR; |
| 845 } | 845 } |
| 846 return element.kind; | 846 return element.kind; |
| 847 } | 847 } |
| 848 | 848 |
| 849 /** | 849 /** |
| 850 * The name displayed in the UI for this kind of element. | 850 * The name displayed in the UI for this kind of element. |
| 851 */ | 851 */ |
| 852 String displayName; | 852 final String displayName; |
| 853 | 853 |
| 854 /** | 854 /** |
| 855 * Initialize a newly created element kind to have the given display name. | 855 * Initialize a newly created element kind to have the given display name. |
| 856 * | 856 * |
| 857 * @param displayName the name displayed in the UI for this kind of element | 857 * @param displayName the name displayed in the UI for this kind of element |
| 858 */ | 858 */ |
| 859 ElementKind(String name, int ordinal, String displayName) : super(name, ordina
l) { | 859 const ElementKind(String name, int ordinal, this.displayName) : super(name, or
dinal); |
| 860 this.displayName = displayName; | |
| 861 } | |
| 862 } | 860 } |
| 863 | 861 |
| 864 /** | 862 /** |
| 865 * The interface `ElementLocation` defines the behavior of objects that represen
t the location | 863 * The interface `ElementLocation` defines the behavior of objects that represen
t the location |
| 866 * of an element within the element model. | 864 * of an element within the element model. |
| 867 */ | 865 */ |
| 868 abstract class ElementLocation { | 866 abstract class ElementLocation { |
| 869 /** | 867 /** |
| 870 * Return an encoded representation of this location that can be used to creat
e a location that is | 868 * Return an encoded representation of this location that can be used to creat
e a location that is |
| 871 * equal to this location. | 869 * equal to this location. |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 | 1978 |
| 1981 /** | 1979 /** |
| 1982 * The enumeration `AngularPropertyKind` defines the different kinds of property
bindings. | 1980 * The enumeration `AngularPropertyKind` defines the different kinds of property
bindings. |
| 1983 */ | 1981 */ |
| 1984 class AngularPropertyKind extends Enum<AngularPropertyKind> { | 1982 class AngularPropertyKind extends Enum<AngularPropertyKind> { |
| 1985 /** | 1983 /** |
| 1986 * `@` - Map the DOM attribute string. The attribute string will be taken lite
rally or | 1984 * `@` - Map the DOM attribute string. The attribute string will be taken lite
rally or |
| 1987 * interpolated if it contains binding {{}} syntax and assigned to the express
ion. (cost: 0 | 1985 * interpolated if it contains binding {{}} syntax and assigned to the express
ion. (cost: 0 |
| 1988 * watches) | 1986 * watches) |
| 1989 */ | 1987 */ |
| 1990 static final AngularPropertyKind ATTR = new AngularPropertyKind('ATTR', 0); | 1988 static const AngularPropertyKind ATTR = const AngularPropertyKind('ATTR', 0); |
| 1991 | 1989 |
| 1992 /** | 1990 /** |
| 1993 * `&` - Treat the DOM attribute value as an expression. Assign a closure func
tion into the field. | 1991 * `&` - Treat the DOM attribute value as an expression. Assign a closure func
tion into the field. |
| 1994 * This allows the component to control the invocation of the closure. This is
useful for passing | 1992 * This allows the component to control the invocation of the closure. This is
useful for passing |
| 1995 * expressions into controllers which act like callbacks. (cost: 0 watches) | 1993 * expressions into controllers which act like callbacks. (cost: 0 watches) |
| 1996 */ | 1994 */ |
| 1997 static final AngularPropertyKind CALLBACK = new AngularPropertyKind('CALLBACK'
, 1); | 1995 static const AngularPropertyKind CALLBACK = const AngularPropertyKind('CALLBAC
K', 1); |
| 1998 | 1996 |
| 1999 /** | 1997 /** |
| 2000 * `=>` - Treat the DOM attribute value as an expression. Set up a watch, whic
h will read the | 1998 * `=>` - Treat the DOM attribute value as an expression. Set up a watch, whic
h will read the |
| 2001 * expression in the attribute and assign the value to destination expression.
(cost: 1 watch) | 1999 * expression in the attribute and assign the value to destination expression.
(cost: 1 watch) |
| 2002 */ | 2000 */ |
| 2003 static final AngularPropertyKind ONE_WAY = new AngularPropertyKind('ONE_WAY',
2); | 2001 static const AngularPropertyKind ONE_WAY = const AngularPropertyKind('ONE_WAY'
, 2); |
| 2004 | 2002 |
| 2005 /** | 2003 /** |
| 2006 * `=>!` - Treat the DOM attribute value as an expression. Set up a one time w
atch on expression. | 2004 * `=>!` - Treat the DOM attribute value as an expression. Set up a one time w
atch on expression. |
| 2007 * Once the expression turns not null it will no longer update. (cost: 1 watch
es until not null, | 2005 * Once the expression turns not null it will no longer update. (cost: 1 watch
es until not null, |
| 2008 * then 0 watches) | 2006 * then 0 watches) |
| 2009 */ | 2007 */ |
| 2010 static final AngularPropertyKind ONE_WAY_ONE_TIME = new AngularPropertyKind('O
NE_WAY_ONE_TIME', 3); | 2008 static const AngularPropertyKind ONE_WAY_ONE_TIME = const AngularPropertyKind(
'ONE_WAY_ONE_TIME', 3); |
| 2011 | 2009 |
| 2012 /** | 2010 /** |
| 2013 * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on b
oth outside as well | 2011 * `<=>` - Treat the DOM attribute value as an expression. Set up a watch on b
oth outside as well |
| 2014 * as component scope to keep the source and destination in sync. (cost: 2 wat
ches) | 2012 * as component scope to keep the source and destination in sync. (cost: 2 wat
ches) |
| 2015 */ | 2013 */ |
| 2016 static final AngularPropertyKind TWO_WAY = new AngularPropertyKind_TWO_WAY('TW
O_WAY', 4); | 2014 static const AngularPropertyKind TWO_WAY = const AngularPropertyKind_TWO_WAY('
TWO_WAY', 4); |
| 2017 | 2015 |
| 2018 static final List<AngularPropertyKind> values = [ATTR, CALLBACK, ONE_WAY, ONE_
WAY_ONE_TIME, TWO_WAY]; | 2016 static const List<AngularPropertyKind> values = const [ATTR, CALLBACK, ONE_WAY
, ONE_WAY_ONE_TIME, TWO_WAY]; |
| 2019 | 2017 |
| 2020 /** | 2018 /** |
| 2021 * Returns `true` if property of this kind calls field getter. | 2019 * Returns `true` if property of this kind calls field getter. |
| 2022 */ | 2020 */ |
| 2023 bool callsGetter() => false; | 2021 bool callsGetter() => false; |
| 2024 | 2022 |
| 2025 /** | 2023 /** |
| 2026 * Returns `true` if property of this kind calls field setter. | 2024 * Returns `true` if property of this kind calls field setter. |
| 2027 */ | 2025 */ |
| 2028 bool callsSetter() => true; | 2026 bool callsSetter() => true; |
| 2029 | 2027 |
| 2030 AngularPropertyKind(String name, int ordinal) : super(name, ordinal); | 2028 const AngularPropertyKind(String name, int ordinal) : super(name, ordinal); |
| 2031 } | 2029 } |
| 2032 | 2030 |
| 2033 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind { | 2031 class AngularPropertyKind_TWO_WAY extends AngularPropertyKind { |
| 2034 AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordinal); | 2032 const AngularPropertyKind_TWO_WAY(String name, int ordinal) : super(name, ordi
nal); |
| 2035 | 2033 |
| 2036 @override | 2034 @override |
| 2037 bool callsGetter() => true; | 2035 bool callsGetter() => true; |
| 2038 } | 2036 } |
| 2039 | 2037 |
| 2040 /** | 2038 /** |
| 2041 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</
code> | 2039 * The interface `AngularScopeVariableElement` defines the Angular <code>Scope</
code> |
| 2042 * property. They are created for every <code>scope['property'] = value;</code>
code snippet. | 2040 * property. They are created for every <code>scope['property'] = value;</code>
code snippet. |
| 2043 */ | 2041 */ |
| 2044 abstract class AngularScopePropertyElement implements AngularElement { | 2042 abstract class AngularScopePropertyElement implements AngularElement { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2560 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST
node, in an | 2558 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST
node, in an |
| 2561 * [AuxiliaryElements]. Since resolved elements are either statically resolved o
r resolved | 2559 * [AuxiliaryElements]. Since resolved elements are either statically resolved o
r resolved |
| 2562 * using propagated type information, this class is a wrapper for a pair of | 2560 * using propagated type information, this class is a wrapper for a pair of |
| 2563 * [ExecutableElement]s, not just a single [ExecutableElement]. | 2561 * [ExecutableElement]s, not just a single [ExecutableElement]. |
| 2564 */ | 2562 */ |
| 2565 class AuxiliaryElements { | 2563 class AuxiliaryElements { |
| 2566 /** | 2564 /** |
| 2567 * The element based on propagated type information, or `null` if the AST stru
cture has not | 2565 * The element based on propagated type information, or `null` if the AST stru
cture has not |
| 2568 * been resolved or if this identifier could not be resolved. | 2566 * been resolved or if this identifier could not be resolved. |
| 2569 */ | 2567 */ |
| 2570 ExecutableElement propagatedElement; | 2568 final ExecutableElement propagatedElement; |
| 2571 | 2569 |
| 2572 /** | 2570 /** |
| 2573 * The element associated with this identifier based on static type informatio
n, or `null` | 2571 * The element associated with this identifier based on static type informatio
n, or `null` |
| 2574 * if the AST structure has not been resolved or if this identifier could not
be resolved. | 2572 * if the AST structure has not been resolved or if this identifier could not
be resolved. |
| 2575 */ | 2573 */ |
| 2576 ExecutableElement staticElement; | 2574 final ExecutableElement staticElement; |
| 2577 | 2575 |
| 2578 /** | 2576 /** |
| 2579 * Create the [AuxiliaryElements] with a static and propagated [ExecutableElem
ent]. | 2577 * Create the [AuxiliaryElements] with a static and propagated [ExecutableElem
ent]. |
| 2580 * | 2578 * |
| 2581 * @param staticElement the static element | 2579 * @param staticElement the static element |
| 2582 * @param propagatedElement the propagated element | 2580 * @param propagatedElement the propagated element |
| 2583 */ | 2581 */ |
| 2584 AuxiliaryElements(ExecutableElement staticElement, ExecutableElement propagate
dElement) { | 2582 AuxiliaryElements(this.staticElement, this.propagatedElement); |
| 2585 this.staticElement = staticElement; | |
| 2586 this.propagatedElement = propagatedElement; | |
| 2587 } | |
| 2588 } | 2583 } |
| 2589 | 2584 |
| 2590 /** | 2585 /** |
| 2591 * Instances of the class `ClassElementImpl` implement a `ClassElement`. | 2586 * Instances of the class `ClassElementImpl` implement a `ClassElement`. |
| 2592 */ | 2587 */ |
| 2593 class ClassElementImpl extends ElementImpl implements ClassElement { | 2588 class ClassElementImpl extends ElementImpl implements ClassElement { |
| 2594 /** | 2589 /** |
| 2595 * An array containing all of the accessors (getters and setters) contained in
this class. | 2590 * An array containing all of the accessors (getters and setters) contained in
this class. |
| 2596 */ | 2591 */ |
| 2597 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; | 2592 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3088 | 3083 |
| 3089 void _collectAllSupertypes(List<InterfaceType> supertypes) { | 3084 void _collectAllSupertypes(List<InterfaceType> supertypes) { |
| 3090 List<InterfaceType> typesToVisit = new List<InterfaceType>(); | 3085 List<InterfaceType> typesToVisit = new List<InterfaceType>(); |
| 3091 List<ClassElement> visitedClasses = new List<ClassElement>(); | 3086 List<ClassElement> visitedClasses = new List<ClassElement>(); |
| 3092 typesToVisit.add(this.type); | 3087 typesToVisit.add(this.type); |
| 3093 while (!typesToVisit.isEmpty) { | 3088 while (!typesToVisit.isEmpty) { |
| 3094 InterfaceType currentType = typesToVisit.removeAt(0); | 3089 InterfaceType currentType = typesToVisit.removeAt(0); |
| 3095 ClassElement currentElement = currentType.element; | 3090 ClassElement currentElement = currentType.element; |
| 3096 if (!visitedClasses.contains(currentElement)) { | 3091 if (!visitedClasses.contains(currentElement)) { |
| 3097 visitedClasses.add(currentElement); | 3092 visitedClasses.add(currentElement); |
| 3098 if (currentType != this.type) { | 3093 if (!identical(currentType, this.type)) { |
| 3099 supertypes.add(currentType); | 3094 supertypes.add(currentType); |
| 3100 } | 3095 } |
| 3101 InterfaceType supertype = currentType.superclass; | 3096 InterfaceType supertype = currentType.superclass; |
| 3102 if (supertype != null) { | 3097 if (supertype != null) { |
| 3103 typesToVisit.add(supertype); | 3098 typesToVisit.add(supertype); |
| 3104 } | 3099 } |
| 3105 for (InterfaceType type in currentElement.interfaces) { | 3100 for (InterfaceType type in currentElement.interfaces) { |
| 3106 typesToVisit.add(type); | 3101 typesToVisit.add(type); |
| 3107 } | 3102 } |
| 3108 for (InterfaceType type in currentElement.mixins) { | 3103 for (InterfaceType type in currentElement.mixins) { |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3525 | 3520 |
| 3526 @override | 3521 @override |
| 3527 bool get isDefaultConstructor { | 3522 bool get isDefaultConstructor { |
| 3528 // unnamed | 3523 // unnamed |
| 3529 String name = this.name; | 3524 String name = this.name; |
| 3530 if (name != null && name.length != 0) { | 3525 if (name != null && name.length != 0) { |
| 3531 return false; | 3526 return false; |
| 3532 } | 3527 } |
| 3533 // no required parameters | 3528 // no required parameters |
| 3534 for (ParameterElement parameter in parameters) { | 3529 for (ParameterElement parameter in parameters) { |
| 3535 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { | 3530 if (parameter.parameterKind == ParameterKind.REQUIRED) { |
| 3536 return false; | 3531 return false; |
| 3537 } | 3532 } |
| 3538 } | 3533 } |
| 3539 // OK, can be used as default constructor | 3534 // OK, can be used as default constructor |
| 3540 return true; | 3535 return true; |
| 3541 } | 3536 } |
| 3542 | 3537 |
| 3543 @override | 3538 @override |
| 3544 bool get isFactory => hasModifier(Modifier.FACTORY); | 3539 bool get isFactory => hasModifier(Modifier.FACTORY); |
| 3545 | 3540 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3661 ElementKind get kind => ElementKind.DYNAMIC; | 3656 ElementKind get kind => ElementKind.DYNAMIC; |
| 3662 } | 3657 } |
| 3663 | 3658 |
| 3664 /** | 3659 /** |
| 3665 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio
n]. | 3660 * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotatio
n]. |
| 3666 */ | 3661 */ |
| 3667 class ElementAnnotationImpl implements ElementAnnotation { | 3662 class ElementAnnotationImpl implements ElementAnnotation { |
| 3668 /** | 3663 /** |
| 3669 * The element representing the field, variable, or constructor being used as
an annotation. | 3664 * The element representing the field, variable, or constructor being used as
an annotation. |
| 3670 */ | 3665 */ |
| 3671 Element element; | 3666 final Element element; |
| 3672 | 3667 |
| 3673 /** | 3668 /** |
| 3674 * An empty array of annotations. | 3669 * An empty array of annotations. |
| 3675 */ | 3670 */ |
| 3676 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp
l>(0); | 3671 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp
l>(0); |
| 3677 | 3672 |
| 3678 /** | 3673 /** |
| 3679 * The name of the class used to mark an element as being deprecated. | 3674 * The name of the class used to mark an element as being deprecated. |
| 3680 */ | 3675 */ |
| 3681 static String _DEPRECATED_CLASS_NAME = "Deprecated"; | 3676 static String _DEPRECATED_CLASS_NAME = "Deprecated"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3695 * The name of the top-level variable used to mark a class as implementing a p
roxy object. | 3690 * The name of the top-level variable used to mark a class as implementing a p
roxy object. |
| 3696 */ | 3691 */ |
| 3697 static String _PROXY_VARIABLE_NAME = "proxy"; | 3692 static String _PROXY_VARIABLE_NAME = "proxy"; |
| 3698 | 3693 |
| 3699 /** | 3694 /** |
| 3700 * Initialize a newly created annotation. | 3695 * Initialize a newly created annotation. |
| 3701 * | 3696 * |
| 3702 * @param element the element representing the field, variable, or constructor
being used as an | 3697 * @param element the element representing the field, variable, or constructor
being used as an |
| 3703 * annotation | 3698 * annotation |
| 3704 */ | 3699 */ |
| 3705 ElementAnnotationImpl(Element element) { | 3700 ElementAnnotationImpl(this.element); |
| 3706 this.element = element; | |
| 3707 } | |
| 3708 | 3701 |
| 3709 @override | 3702 @override |
| 3710 bool get isDeprecated { | 3703 bool get isDeprecated { |
| 3711 if (element != null) { | 3704 if (element != null) { |
| 3712 LibraryElement library = element.library; | 3705 LibraryElement library = element.library; |
| 3713 if (library != null && library.isDartCore) { | 3706 if (library != null && library.isDartCore) { |
| 3714 if (element is ConstructorElement) { | 3707 if (element is ConstructorElement) { |
| 3715 ConstructorElement constructorElement = element as ConstructorElement; | 3708 ConstructorElement constructorElement = element as ConstructorElement; |
| 3716 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME
) { | 3709 if (constructorElement.enclosingElement.name == _DEPRECATED_CLASS_NAME
) { |
| 3717 return true; | 3710 return true; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3798 */ | 3791 */ |
| 3799 ElementImpl.forNode(Identifier name) : this(name == null ? "" : name.name, nam
e == null ? -1 : name.offset); | 3792 ElementImpl.forNode(Identifier name) : this(name == null ? "" : name.name, nam
e == null ? -1 : name.offset); |
| 3800 | 3793 |
| 3801 /** | 3794 /** |
| 3802 * Initialize a newly created element to have the given name. | 3795 * Initialize a newly created element to have the given name. |
| 3803 * | 3796 * |
| 3804 * @param name the name of this element | 3797 * @param name the name of this element |
| 3805 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 3798 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 3806 * declaration of this element | 3799 * declaration of this element |
| 3807 */ | 3800 */ |
| 3808 ElementImpl(String name, int nameOffset) { | 3801 ElementImpl(String name, this.nameOffset) { |
| 3809 this._name = StringUtilities.intern(name); | 3802 this._name = StringUtilities.intern(name); |
| 3810 this.nameOffset = nameOffset; | |
| 3811 } | 3803 } |
| 3812 | 3804 |
| 3813 @override | 3805 @override |
| 3814 String computeDocumentationComment() { | 3806 String computeDocumentationComment() { |
| 3815 AnalysisContext context = this.context; | 3807 AnalysisContext context = this.context; |
| 3816 if (context == null) { | 3808 if (context == null) { |
| 3817 return null; | 3809 return null; |
| 3818 } | 3810 } |
| 3819 return context.computeDocumentationComment(this); | 3811 return context.computeDocumentationComment(this); |
| 3820 } | 3812 } |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4263 } | 4255 } |
| 4264 | 4256 |
| 4265 /** | 4257 /** |
| 4266 * The class `ElementPair` is a pair of [Element]s. [Object#equals] and | 4258 * The class `ElementPair` is a pair of [Element]s. [Object#equals] and |
| 4267 * [Object#hashCode] so this class can be used in hashed data structures. | 4259 * [Object#hashCode] so this class can be used in hashed data structures. |
| 4268 */ | 4260 */ |
| 4269 class ElementPair { | 4261 class ElementPair { |
| 4270 /** | 4262 /** |
| 4271 * The first [Element] | 4263 * The first [Element] |
| 4272 */ | 4264 */ |
| 4273 Element _first; | 4265 final Element _first; |
| 4274 | 4266 |
| 4275 /** | 4267 /** |
| 4276 * The second [Element] | 4268 * The second [Element] |
| 4277 */ | 4269 */ |
| 4278 Element _second; | 4270 final Element _second; |
| 4279 | 4271 |
| 4280 /** | 4272 /** |
| 4281 * The sole constructor for this class, taking two [Element]s. | 4273 * The sole constructor for this class, taking two [Element]s. |
| 4282 * | 4274 * |
| 4283 * @param first the first element | 4275 * @param first the first element |
| 4284 * @param second the second element | 4276 * @param second the second element |
| 4285 */ | 4277 */ |
| 4286 ElementPair(Element first, Element second) { | 4278 ElementPair(this._first, this._second); |
| 4287 this._first = first; | |
| 4288 this._second = second; | |
| 4289 } | |
| 4290 | 4279 |
| 4291 @override | 4280 @override |
| 4292 bool operator ==(Object object) { | 4281 bool operator ==(Object object) { |
| 4293 if (identical(object, this)) { | 4282 if (identical(object, this)) { |
| 4294 return true; | 4283 return true; |
| 4295 } | 4284 } |
| 4296 if (object is ElementPair) { | 4285 if (object is ElementPair) { |
| 4297 ElementPair elementPair = object; | 4286 ElementPair elementPair = object; |
| 4298 return (_first == elementPair._first) && (_second == elementPair._second); | 4287 return (_first == elementPair._first) && (_second == elementPair._second); |
| 4299 } | 4288 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 for (int i = 0; i < parameterCount; i++) { | 4512 for (int i = 0; i < parameterCount; i++) { |
| 4524 if (i > 0) { | 4513 if (i > 0) { |
| 4525 builder.append(", "); | 4514 builder.append(", "); |
| 4526 } | 4515 } |
| 4527 ParameterElementImpl parameter = _parameters[i] as ParameterElementImpl; | 4516 ParameterElementImpl parameter = _parameters[i] as ParameterElementImpl; |
| 4528 ParameterKind parameterKind = parameter.parameterKind; | 4517 ParameterKind parameterKind = parameter.parameterKind; |
| 4529 if (parameterKind != kind) { | 4518 if (parameterKind != kind) { |
| 4530 if (closing != null) { | 4519 if (closing != null) { |
| 4531 builder.append(closing); | 4520 builder.append(closing); |
| 4532 } | 4521 } |
| 4533 if (identical(parameterKind, ParameterKind.POSITIONAL)) { | 4522 if (parameterKind == ParameterKind.POSITIONAL) { |
| 4534 builder.append("["); | 4523 builder.append("["); |
| 4535 closing = "]"; | 4524 closing = "]"; |
| 4536 } else if (identical(parameterKind, ParameterKind.NAMED)) { | 4525 } else if (parameterKind == ParameterKind.NAMED) { |
| 4537 builder.append("{"); | 4526 builder.append("{"); |
| 4538 closing = "}"; | 4527 closing = "}"; |
| 4539 } else { | 4528 } else { |
| 4540 closing = null; | 4529 closing = null; |
| 4541 } | 4530 } |
| 4542 } | 4531 } |
| 4543 kind = parameterKind; | 4532 kind = parameterKind; |
| 4544 parameter.appendToWithoutDelimiters(builder); | 4533 parameter.appendToWithoutDelimiters(builder); |
| 4545 } | 4534 } |
| 4546 if (closing != null) { | 4535 if (closing != null) { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4954 */ | 4943 */ |
| 4955 class HtmlElementImpl extends ElementImpl implements HtmlElement { | 4944 class HtmlElementImpl extends ElementImpl implements HtmlElement { |
| 4956 /** | 4945 /** |
| 4957 * An empty array of HTML file elements. | 4946 * An empty array of HTML file elements. |
| 4958 */ | 4947 */ |
| 4959 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0); | 4948 static List<HtmlElement> EMPTY_ARRAY = new List<HtmlElement>(0); |
| 4960 | 4949 |
| 4961 /** | 4950 /** |
| 4962 * The analysis context in which this library is defined. | 4951 * The analysis context in which this library is defined. |
| 4963 */ | 4952 */ |
| 4964 AnalysisContext context; | 4953 final AnalysisContext context; |
| 4965 | 4954 |
| 4966 /** | 4955 /** |
| 4967 * The scripts contained in or referenced from script tags in the HTML file. | 4956 * The scripts contained in or referenced from script tags in the HTML file. |
| 4968 */ | 4957 */ |
| 4969 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY; | 4958 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY; |
| 4970 | 4959 |
| 4971 /** | 4960 /** |
| 4972 * The source that corresponds to this HTML file. | 4961 * The source that corresponds to this HTML file. |
| 4973 */ | 4962 */ |
| 4974 Source source; | 4963 Source source; |
| 4975 | 4964 |
| 4976 /** | 4965 /** |
| 4977 * The element associated with Dart pieces in this HTML unit or `null` if the
receiver is | 4966 * The element associated with Dart pieces in this HTML unit or `null` if the
receiver is |
| 4978 * not resolved. | 4967 * not resolved. |
| 4979 */ | 4968 */ |
| 4980 CompilationUnitElement angularCompilationUnit; | 4969 CompilationUnitElement angularCompilationUnit; |
| 4981 | 4970 |
| 4982 /** | 4971 /** |
| 4983 * Initialize a newly created HTML element to have the given name. | 4972 * Initialize a newly created HTML element to have the given name. |
| 4984 * | 4973 * |
| 4985 * @param context the analysis context in which the HTML file is defined | 4974 * @param context the analysis context in which the HTML file is defined |
| 4986 * @param name the name of this element | 4975 * @param name the name of this element |
| 4987 */ | 4976 */ |
| 4988 HtmlElementImpl(AnalysisContext context, String name) : super(name, -1) { | 4977 HtmlElementImpl(this.context, String name) : super(name, -1); |
| 4989 this.context = context; | |
| 4990 } | |
| 4991 | 4978 |
| 4992 @override | 4979 @override |
| 4993 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this); | 4980 accept(ElementVisitor visitor) => visitor.visitHtmlElement(this); |
| 4994 | 4981 |
| 4995 @override | 4982 @override |
| 4996 bool operator ==(Object object) { | 4983 bool operator ==(Object object) { |
| 4997 if (identical(object, this)) { | 4984 if (identical(object, this)) { |
| 4998 return true; | 4985 return true; |
| 4999 } | 4986 } |
| 5000 if (object == null) { | 4987 if (object == null) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5116 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier
}@${nameOffset}"; | 5103 String get identifier => "${(importedLibrary as LibraryElementImpl).identifier
}@${nameOffset}"; |
| 5117 } | 5104 } |
| 5118 | 5105 |
| 5119 /** | 5106 /** |
| 5120 * Instances of the class `LabelElementImpl` implement a `LabelElement`. | 5107 * Instances of the class `LabelElementImpl` implement a `LabelElement`. |
| 5121 */ | 5108 */ |
| 5122 class LabelElementImpl extends ElementImpl implements LabelElement { | 5109 class LabelElementImpl extends ElementImpl implements LabelElement { |
| 5123 /** | 5110 /** |
| 5124 * A flag indicating whether this label is associated with a `switch` statemen
t. | 5111 * A flag indicating whether this label is associated with a `switch` statemen
t. |
| 5125 */ | 5112 */ |
| 5126 bool _onSwitchStatement = false; | 5113 final bool _onSwitchStatement; |
| 5127 | 5114 |
| 5128 /** | 5115 /** |
| 5129 * A flag indicating whether this label is associated with a `switch` member (
`case` | 5116 * A flag indicating whether this label is associated with a `switch` member (
`case` |
| 5130 * or `default`). | 5117 * or `default`). |
| 5131 */ | 5118 */ |
| 5132 bool _onSwitchMember = false; | 5119 final bool _onSwitchMember; |
| 5133 | 5120 |
| 5134 /** | 5121 /** |
| 5135 * An empty array of label elements. | 5122 * An empty array of label elements. |
| 5136 */ | 5123 */ |
| 5137 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0); | 5124 static List<LabelElement> EMPTY_ARRAY = new List<LabelElement>(0); |
| 5138 | 5125 |
| 5139 /** | 5126 /** |
| 5140 * Initialize a newly created label element to have the given name. | 5127 * Initialize a newly created label element to have the given name. |
| 5141 * | 5128 * |
| 5142 * @param name the name of this element | 5129 * @param name the name of this element |
| 5143 * @param onSwitchStatement `true` if this label is associated with a `switch` | 5130 * @param onSwitchStatement `true` if this label is associated with a `switch` |
| 5144 * statement | 5131 * statement |
| 5145 * @param onSwitchMember `true` if this label is associated with a `switch` me
mber | 5132 * @param onSwitchMember `true` if this label is associated with a `switch` me
mber |
| 5146 */ | 5133 */ |
| 5147 LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember)
: super.forNode(name) { | 5134 LabelElementImpl(Identifier name, this._onSwitchStatement, this._onSwitchMembe
r) : super.forNode(name); |
| 5148 this._onSwitchStatement = onSwitchStatement; | |
| 5149 this._onSwitchMember = onSwitchMember; | |
| 5150 } | |
| 5151 | 5135 |
| 5152 @override | 5136 @override |
| 5153 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); | 5137 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); |
| 5154 | 5138 |
| 5155 @override | 5139 @override |
| 5156 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; | 5140 ExecutableElement get enclosingElement => super.enclosingElement as Executable
Element; |
| 5157 | 5141 |
| 5158 @override | 5142 @override |
| 5159 ElementKind get kind => ElementKind.LABEL; | 5143 ElementKind get kind => ElementKind.LABEL; |
| 5160 | 5144 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5216 return false; | 5200 return false; |
| 5217 } | 5201 } |
| 5218 } | 5202 } |
| 5219 } | 5203 } |
| 5220 return true; | 5204 return true; |
| 5221 } | 5205 } |
| 5222 | 5206 |
| 5223 /** | 5207 /** |
| 5224 * The analysis context in which this library is defined. | 5208 * The analysis context in which this library is defined. |
| 5225 */ | 5209 */ |
| 5226 AnalysisContext context; | 5210 final AnalysisContext context; |
| 5227 | 5211 |
| 5228 /** | 5212 /** |
| 5229 * The compilation unit that defines this library. | 5213 * The compilation unit that defines this library. |
| 5230 */ | 5214 */ |
| 5231 CompilationUnitElement _definingCompilationUnit; | 5215 CompilationUnitElement _definingCompilationUnit; |
| 5232 | 5216 |
| 5233 /** | 5217 /** |
| 5234 * The entry point for this library, or `null` if this library does not have a
n entry point. | 5218 * The entry point for this library, or `null` if this library does not have a
n entry point. |
| 5235 */ | 5219 */ |
| 5236 FunctionElement entryPoint; | 5220 FunctionElement entryPoint; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 5255 * Is `true` if this library is created for Angular analysis. | 5239 * Is `true` if this library is created for Angular analysis. |
| 5256 */ | 5240 */ |
| 5257 bool _isAngularHtml = false; | 5241 bool _isAngularHtml = false; |
| 5258 | 5242 |
| 5259 /** | 5243 /** |
| 5260 * Initialize a newly created library element to have the given name. | 5244 * Initialize a newly created library element to have the given name. |
| 5261 * | 5245 * |
| 5262 * @param context the analysis context in which the library is defined | 5246 * @param context the analysis context in which the library is defined |
| 5263 * @param name the name of this element | 5247 * @param name the name of this element |
| 5264 */ | 5248 */ |
| 5265 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.fo
rNode(name) { | 5249 LibraryElementImpl(this.context, LibraryIdentifier name) : super.forNode(name)
; |
| 5266 this.context = context; | |
| 5267 } | |
| 5268 | 5250 |
| 5269 @override | 5251 @override |
| 5270 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); | 5252 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); |
| 5271 | 5253 |
| 5272 @override | 5254 @override |
| 5273 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC
ompilationUnit; | 5255 bool operator ==(Object object) => object != null && runtimeType == object.run
timeType && _definingCompilationUnit == (object as LibraryElementImpl).definingC
ompilationUnit; |
| 5274 | 5256 |
| 5275 @override | 5257 @override |
| 5276 ElementImpl getChild(String identifier) { | 5258 ElementImpl getChild(String identifier) { |
| 5277 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i
dentifier) { | 5259 if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier == i
dentifier) { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5755 } | 5737 } |
| 5756 | 5738 |
| 5757 /** | 5739 /** |
| 5758 * The enumeration `Modifier` defines constants for all of the modifiers defined
by the Dart | 5740 * The enumeration `Modifier` defines constants for all of the modifiers defined
by the Dart |
| 5759 * language and for a few additional flags that are useful. | 5741 * language and for a few additional flags that are useful. |
| 5760 */ | 5742 */ |
| 5761 class Modifier extends Enum<Modifier> { | 5743 class Modifier extends Enum<Modifier> { |
| 5762 /** | 5744 /** |
| 5763 * Indicates that the modifier 'abstract' was applied to the element. | 5745 * Indicates that the modifier 'abstract' was applied to the element. |
| 5764 */ | 5746 */ |
| 5765 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0); | 5747 static const Modifier ABSTRACT = const Modifier('ABSTRACT', 0); |
| 5766 | 5748 |
| 5767 /** | 5749 /** |
| 5768 * Indicates that the modifier 'const' was applied to the element. | 5750 * Indicates that the modifier 'const' was applied to the element. |
| 5769 */ | 5751 */ |
| 5770 static final Modifier CONST = new Modifier('CONST', 1); | 5752 static const Modifier CONST = const Modifier('CONST', 1); |
| 5771 | 5753 |
| 5772 /** | 5754 /** |
| 5773 * Indicates that the modifier 'factory' was applied to the element. | 5755 * Indicates that the modifier 'factory' was applied to the element. |
| 5774 */ | 5756 */ |
| 5775 static final Modifier FACTORY = new Modifier('FACTORY', 2); | 5757 static const Modifier FACTORY = const Modifier('FACTORY', 2); |
| 5776 | 5758 |
| 5777 /** | 5759 /** |
| 5778 * Indicates that the modifier 'final' was applied to the element. | 5760 * Indicates that the modifier 'final' was applied to the element. |
| 5779 */ | 5761 */ |
| 5780 static final Modifier FINAL = new Modifier('FINAL', 3); | 5762 static const Modifier FINAL = const Modifier('FINAL', 3); |
| 5781 | 5763 |
| 5782 /** | 5764 /** |
| 5783 * Indicates that the pseudo-modifier 'get' was applied to the element. | 5765 * Indicates that the pseudo-modifier 'get' was applied to the element. |
| 5784 */ | 5766 */ |
| 5785 static final Modifier GETTER = new Modifier('GETTER', 4); | 5767 static const Modifier GETTER = const Modifier('GETTER', 4); |
| 5786 | 5768 |
| 5787 /** | 5769 /** |
| 5788 * A flag used for libraries indicating that the defining compilation unit con
tains at least one | 5770 * A flag used for libraries indicating that the defining compilation unit con
tains at least one |
| 5789 * import directive whose URI uses the "dart-ext" scheme. | 5771 * import directive whose URI uses the "dart-ext" scheme. |
| 5790 */ | 5772 */ |
| 5791 static final Modifier HAS_EXT_URI = new Modifier('HAS_EXT_URI', 5); | 5773 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 5); |
| 5792 | 5774 |
| 5793 static final Modifier MIXIN = new Modifier('MIXIN', 6); | 5775 static const Modifier MIXIN = const Modifier('MIXIN', 6); |
| 5794 | 5776 |
| 5795 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 7); | 5777 static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 7)
; |
| 5796 | 5778 |
| 5797 /** | 5779 /** |
| 5798 * Indicates that the pseudo-modifier 'set' was applied to the element. | 5780 * Indicates that the pseudo-modifier 'set' was applied to the element. |
| 5799 */ | 5781 */ |
| 5800 static final Modifier SETTER = new Modifier('SETTER', 8); | 5782 static const Modifier SETTER = const Modifier('SETTER', 8); |
| 5801 | 5783 |
| 5802 /** | 5784 /** |
| 5803 * Indicates that the modifier 'static' was applied to the element. | 5785 * Indicates that the modifier 'static' was applied to the element. |
| 5804 */ | 5786 */ |
| 5805 static final Modifier STATIC = new Modifier('STATIC', 9); | 5787 static const Modifier STATIC = const Modifier('STATIC', 9); |
| 5806 | 5788 |
| 5807 /** | 5789 /** |
| 5808 * Indicates that the element does not appear in the source code but was impli
citly created. For | 5790 * Indicates that the element does not appear in the source code but was impli
citly created. For |
| 5809 * example, if a class does not define any constructors, an implicit zero-argu
ment constructor | 5791 * example, if a class does not define any constructors, an implicit zero-argu
ment constructor |
| 5810 * will be created and it will be marked as being synthetic. | 5792 * will be created and it will be marked as being synthetic. |
| 5811 */ | 5793 */ |
| 5812 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 10); | 5794 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 10); |
| 5813 | 5795 |
| 5814 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 11); | 5796 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 11); |
| 5815 | 5797 |
| 5816 static final List<Modifier> values = [ | 5798 static const List<Modifier> values = const [ |
| 5817 ABSTRACT, | 5799 ABSTRACT, |
| 5818 CONST, | 5800 CONST, |
| 5819 FACTORY, | 5801 FACTORY, |
| 5820 FINAL, | 5802 FINAL, |
| 5821 GETTER, | 5803 GETTER, |
| 5822 HAS_EXT_URI, | 5804 HAS_EXT_URI, |
| 5823 MIXIN, | 5805 MIXIN, |
| 5824 REFERENCES_SUPER, | 5806 REFERENCES_SUPER, |
| 5825 SETTER, | 5807 SETTER, |
| 5826 STATIC, | 5808 STATIC, |
| 5827 SYNTHETIC, | 5809 SYNTHETIC, |
| 5828 TYPEDEF]; | 5810 TYPEDEF]; |
| 5829 | 5811 |
| 5830 Modifier(String name, int ordinal) : super(name, ordinal); | 5812 const Modifier(String name, int ordinal) : super(name, ordinal); |
| 5831 } | 5813 } |
| 5832 | 5814 |
| 5833 /** | 5815 /** |
| 5834 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of
elements that | 5816 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of
elements that |
| 5835 * have the same name within the same scope. | 5817 * have the same name within the same scope. |
| 5836 */ | 5818 */ |
| 5837 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { | 5819 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { |
| 5838 /** | 5820 /** |
| 5839 * Return an element that represents the given conflicting elements. | 5821 * Return an element that represents the given conflicting elements. |
| 5840 * | 5822 * |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5882 static List<Element> _computeConflictingElements(Element firstElement, Element
secondElement) { | 5864 static List<Element> _computeConflictingElements(Element firstElement, Element
secondElement) { |
| 5883 Set<Element> elements = new Set<Element>(); | 5865 Set<Element> elements = new Set<Element>(); |
| 5884 _add(elements, firstElement); | 5866 _add(elements, firstElement); |
| 5885 _add(elements, secondElement); | 5867 _add(elements, secondElement); |
| 5886 return new List.from(elements); | 5868 return new List.from(elements); |
| 5887 } | 5869 } |
| 5888 | 5870 |
| 5889 /** | 5871 /** |
| 5890 * The analysis context in which the multiply defined elements are defined. | 5872 * The analysis context in which the multiply defined elements are defined. |
| 5891 */ | 5873 */ |
| 5892 AnalysisContext context; | 5874 final AnalysisContext context; |
| 5893 | 5875 |
| 5894 /** | 5876 /** |
| 5895 * The name of the conflicting elements. | 5877 * The name of the conflicting elements. |
| 5896 */ | 5878 */ |
| 5897 String _name; | 5879 String _name; |
| 5898 | 5880 |
| 5899 /** | 5881 /** |
| 5900 * A list containing all of the elements that conflict. | 5882 * A list containing all of the elements that conflict. |
| 5901 */ | 5883 */ |
| 5902 List<Element> conflictingElements; | 5884 final List<Element> conflictingElements; |
| 5903 | 5885 |
| 5904 /** | 5886 /** |
| 5905 * Initialize a newly created element to represent a list of conflicting eleme
nts. | 5887 * Initialize a newly created element to represent a list of conflicting eleme
nts. |
| 5906 * | 5888 * |
| 5907 * @param context the analysis context in which the multiply defined elements
are defined | 5889 * @param context the analysis context in which the multiply defined elements
are defined |
| 5908 * @param conflictingElements the elements that conflict | 5890 * @param conflictingElements the elements that conflict |
| 5909 */ | 5891 */ |
| 5910 MultiplyDefinedElementImpl(AnalysisContext context, List<Element> conflictingE
lements) { | 5892 MultiplyDefinedElementImpl(this.context, this.conflictingElements) { |
| 5911 this.context = context; | |
| 5912 _name = conflictingElements[0].name; | 5893 _name = conflictingElements[0].name; |
| 5913 this.conflictingElements = conflictingElements; | |
| 5914 } | 5894 } |
| 5915 | 5895 |
| 5916 @override | 5896 @override |
| 5917 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); | 5897 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); |
| 5918 | 5898 |
| 5919 @override | 5899 @override |
| 5920 String computeDocumentationComment() => null; | 5900 String computeDocumentationComment() => null; |
| 5921 | 5901 |
| 5922 @override | 5902 @override |
| 5923 Element getAncestor(Predicate<Element> predicate) => null; | 5903 Element getAncestor(Predicate<Element> predicate) => null; |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6332 */ | 6312 */ |
| 6333 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable) : super
.con2(variable.name, variable.nameOffset) { | 6313 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable) : super
.con2(variable.name, variable.nameOffset) { |
| 6334 this.variable = variable; | 6314 this.variable = variable; |
| 6335 synthetic = true; | 6315 synthetic = true; |
| 6336 } | 6316 } |
| 6337 | 6317 |
| 6338 @override | 6318 @override |
| 6339 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 6319 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 6340 | 6320 |
| 6341 @override | 6321 @override |
| 6342 bool operator ==(Object object) => super == object && identical(isGetter, (obj
ect as PropertyAccessorElement).isGetter); | 6322 bool operator ==(Object object) => super == object && isGetter == (object as P
ropertyAccessorElement).isGetter; |
| 6343 | 6323 |
| 6344 @override | 6324 @override |
| 6345 PropertyAccessorElement get correspondingGetter { | 6325 PropertyAccessorElement get correspondingGetter { |
| 6346 if (isGetter || variable == null) { | 6326 if (isGetter || variable == null) { |
| 6347 return null; | 6327 return null; |
| 6348 } | 6328 } |
| 6349 return variable.getter; | 6329 return variable.getter; |
| 6350 } | 6330 } |
| 6351 | 6331 |
| 6352 @override | 6332 @override |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6767 builder.append(type); | 6747 builder.append(type); |
| 6768 builder.append(" "); | 6748 builder.append(" "); |
| 6769 builder.append(displayName); | 6749 builder.append(displayName); |
| 6770 } | 6750 } |
| 6771 } | 6751 } |
| 6772 | 6752 |
| 6773 /** | 6753 /** |
| 6774 * Information about Angular application. | 6754 * Information about Angular application. |
| 6775 */ | 6755 */ |
| 6776 class AngularApplication { | 6756 class AngularApplication { |
| 6777 Source entryPoint; | 6757 final Source entryPoint; |
| 6778 | 6758 |
| 6779 Set<Source> _librarySources; | 6759 final Set<Source> _librarySources; |
| 6780 | 6760 |
| 6781 List<AngularElement> elements; | 6761 final List<AngularElement> elements; |
| 6782 | 6762 |
| 6783 List<Source> elementSources; | 6763 final List<Source> elementSources; |
| 6784 | 6764 |
| 6785 AngularApplication(Source entryPoint, Set<Source> librarySources, List<Angular
Element> elements, List<Source> elementSources) { | 6765 AngularApplication(this.entryPoint, this._librarySources, this.elements, this.
elementSources); |
| 6786 this.entryPoint = entryPoint; | |
| 6787 this._librarySources = librarySources; | |
| 6788 this.elements = elements; | |
| 6789 this.elementSources = elementSources; | |
| 6790 } | |
| 6791 | 6766 |
| 6792 /** | 6767 /** |
| 6793 * Checks if this application depends on the library with the given [Source]. | 6768 * Checks if this application depends on the library with the given [Source]. |
| 6794 */ | 6769 */ |
| 6795 bool dependsOn(Source librarySource) => _librarySources.contains(librarySource
); | 6770 bool dependsOn(Source librarySource) => _librarySources.contains(librarySource
); |
| 6796 } | 6771 } |
| 6797 | 6772 |
| 6798 /** | 6773 /** |
| 6799 * Implementation of `AngularComponentElement`. | 6774 * Implementation of `AngularComponentElement`. |
| 6800 */ | 6775 */ |
| 6801 class AngularComponentElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularComponentElement { | 6776 class AngularComponentElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularComponentElement { |
| 6802 /** | 6777 /** |
| 6803 * The offset of the defining <code>NgComponent</code> annotation. | 6778 * The offset of the defining <code>NgComponent</code> annotation. |
| 6804 */ | 6779 */ |
| 6805 int _annotationOffset = 0; | 6780 final int _annotationOffset; |
| 6806 | 6781 |
| 6807 /** | 6782 /** |
| 6808 * The array containing all of the properties declared by this component. | 6783 * The array containing all of the properties declared by this component. |
| 6809 */ | 6784 */ |
| 6810 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; | 6785 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; |
| 6811 | 6786 |
| 6812 /** | 6787 /** |
| 6813 * The array containing all of the scope properties set by this component. | 6788 * The array containing all of the scope properties set by this component. |
| 6814 */ | 6789 */ |
| 6815 List<AngularScopePropertyElement> _scopeProperties = AngularScopePropertyEleme
nt.EMPTY_ARRAY; | 6790 List<AngularScopePropertyElement> _scopeProperties = AngularScopePropertyEleme
nt.EMPTY_ARRAY; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 6839 */ | 6814 */ |
| 6840 int templateUriOffset = 0; | 6815 int templateUriOffset = 0; |
| 6841 | 6816 |
| 6842 /** | 6817 /** |
| 6843 * Initialize a newly created Angular component to have the given name. | 6818 * Initialize a newly created Angular component to have the given name. |
| 6844 * | 6819 * |
| 6845 * @param name the name of this element | 6820 * @param name the name of this element |
| 6846 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 6821 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 6847 * declaration of this element | 6822 * declaration of this element |
| 6848 */ | 6823 */ |
| 6849 AngularComponentElementImpl(String name, int nameOffset, int annotationOffset)
: super(name, nameOffset) { | 6824 AngularComponentElementImpl(String name, int nameOffset, this._annotationOffse
t) : super(name, nameOffset); |
| 6850 this._annotationOffset = annotationOffset; | |
| 6851 } | |
| 6852 | 6825 |
| 6853 @override | 6826 @override |
| 6854 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this); | 6827 accept(ElementVisitor visitor) => visitor.visitAngularComponentElement(this); |
| 6855 | 6828 |
| 6856 @override | 6829 @override |
| 6857 ElementKind get kind => ElementKind.ANGULAR_COMPONENT; | 6830 ElementKind get kind => ElementKind.ANGULAR_COMPONENT; |
| 6858 | 6831 |
| 6859 @override | 6832 @override |
| 6860 List<AngularPropertyElement> get properties => _properties; | 6833 List<AngularPropertyElement> get properties => _properties; |
| 6861 | 6834 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6917 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER; | 6890 ElementKind get kind => ElementKind.ANGULAR_CONTROLLER; |
| 6918 } | 6891 } |
| 6919 | 6892 |
| 6920 /** | 6893 /** |
| 6921 * Implementation of `AngularDirectiveElement`. | 6894 * Implementation of `AngularDirectiveElement`. |
| 6922 */ | 6895 */ |
| 6923 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularDirectiveElement { | 6896 class AngularDirectiveElementImpl extends AngularHasSelectorElementImpl implemen
ts AngularDirectiveElement { |
| 6924 /** | 6897 /** |
| 6925 * The offset of the annotation that defines this directive. | 6898 * The offset of the annotation that defines this directive. |
| 6926 */ | 6899 */ |
| 6927 int _offset = 0; | 6900 final int _offset; |
| 6928 | 6901 |
| 6929 /** | 6902 /** |
| 6930 * The array containing all of the properties declared by this directive. | 6903 * The array containing all of the properties declared by this directive. |
| 6931 */ | 6904 */ |
| 6932 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; | 6905 List<AngularPropertyElement> _properties = AngularPropertyElement.EMPTY_ARRAY; |
| 6933 | 6906 |
| 6934 /** | 6907 /** |
| 6935 * Initialize a newly created Angular directive to have the given name. | 6908 * Initialize a newly created Angular directive to have the given name. |
| 6936 * | 6909 * |
| 6937 * @param offset the offset of the annotation that defines this directive | 6910 * @param offset the offset of the annotation that defines this directive |
| 6938 */ | 6911 */ |
| 6939 AngularDirectiveElementImpl(int offset) : super(null, -1) { | 6912 AngularDirectiveElementImpl(this._offset) : super(null, -1); |
| 6940 this._offset = offset; | |
| 6941 } | |
| 6942 | 6913 |
| 6943 @override | 6914 @override |
| 6944 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this); | 6915 accept(ElementVisitor visitor) => visitor.visitAngularDirectiveElement(this); |
| 6945 | 6916 |
| 6946 @override | 6917 @override |
| 6947 String get displayName => selector.displayName; | 6918 String get displayName => selector.displayName; |
| 6948 | 6919 |
| 6949 @override | 6920 @override |
| 6950 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE; | 6921 ElementKind get kind => ElementKind.ANGULAR_DIRECTIVE; |
| 6951 | 6922 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7129 ElementKind get kind => ElementKind.ANGULAR_PROPERTY; | 7100 ElementKind get kind => ElementKind.ANGULAR_PROPERTY; |
| 7130 } | 7101 } |
| 7131 | 7102 |
| 7132 /** | 7103 /** |
| 7133 * Implementation of `AngularScopePropertyElement`. | 7104 * Implementation of `AngularScopePropertyElement`. |
| 7134 */ | 7105 */ |
| 7135 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu
larScopePropertyElement { | 7106 class AngularScopePropertyElementImpl extends AngularElementImpl implements Angu
larScopePropertyElement { |
| 7136 /** | 7107 /** |
| 7137 * The type of the property | 7108 * The type of the property |
| 7138 */ | 7109 */ |
| 7139 DartType type; | 7110 final DartType type; |
| 7140 | 7111 |
| 7141 /** | 7112 /** |
| 7142 * Initialize a newly created Angular scope property to have the given name. | 7113 * Initialize a newly created Angular scope property to have the given name. |
| 7143 * | 7114 * |
| 7144 * @param name the name of this element | 7115 * @param name the name of this element |
| 7145 * @param nameOffset the offset of the name of this element in the file that c
ontains the | 7116 * @param nameOffset the offset of the name of this element in the file that c
ontains the |
| 7146 * declaration of this element | 7117 * declaration of this element |
| 7147 */ | 7118 */ |
| 7148 AngularScopePropertyElementImpl(String name, int nameOffset, DartType type) :
super(name, nameOffset) { | 7119 AngularScopePropertyElementImpl(String name, int nameOffset, this.type) : supe
r(name, nameOffset); |
| 7149 this.type = type; | |
| 7150 } | |
| 7151 | 7120 |
| 7152 @override | 7121 @override |
| 7153 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi
s); | 7122 accept(ElementVisitor visitor) => visitor.visitAngularScopePropertyElement(thi
s); |
| 7154 | 7123 |
| 7155 @override | 7124 @override |
| 7156 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY; | 7125 ElementKind get kind => ElementKind.ANGULAR_SCOPE_PROPERTY; |
| 7157 } | 7126 } |
| 7158 | 7127 |
| 7159 /** | 7128 /** |
| 7160 * Implementation of `AngularFilterElement`. | 7129 * Implementation of `AngularFilterElement`. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7192 AngularApplication get application => (enclosingElement as AngularElementImpl)
.application; | 7161 AngularApplication get application => (enclosingElement as AngularElementImpl)
.application; |
| 7193 } | 7162 } |
| 7194 | 7163 |
| 7195 /** | 7164 /** |
| 7196 * Implementation of `AngularViewElement`. | 7165 * Implementation of `AngularViewElement`. |
| 7197 */ | 7166 */ |
| 7198 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl
ement { | 7167 class AngularViewElementImpl extends AngularElementImpl implements AngularViewEl
ement { |
| 7199 /** | 7168 /** |
| 7200 * The HTML template URI. | 7169 * The HTML template URI. |
| 7201 */ | 7170 */ |
| 7202 String templateUri; | 7171 final String templateUri; |
| 7203 | 7172 |
| 7204 /** | 7173 /** |
| 7205 * The offset of the [templateUri] in the [getSource]. | 7174 * The offset of the [templateUri] in the [getSource]. |
| 7206 */ | 7175 */ |
| 7207 int templateUriOffset = 0; | 7176 final int templateUriOffset; |
| 7208 | 7177 |
| 7209 /** | 7178 /** |
| 7210 * The HTML template source. | 7179 * The HTML template source. |
| 7211 */ | 7180 */ |
| 7212 Source templateSource; | 7181 Source templateSource; |
| 7213 | 7182 |
| 7214 /** | 7183 /** |
| 7215 * Initialize a newly created Angular view. | 7184 * Initialize a newly created Angular view. |
| 7216 */ | 7185 */ |
| 7217 AngularViewElementImpl(String templateUri, int templateUriOffset) : super(null
, -1) { | 7186 AngularViewElementImpl(this.templateUri, this.templateUriOffset) : super(null,
-1); |
| 7218 this.templateUri = templateUri; | |
| 7219 this.templateUriOffset = templateUriOffset; | |
| 7220 } | |
| 7221 | 7187 |
| 7222 @override | 7188 @override |
| 7223 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this); | 7189 accept(ElementVisitor visitor) => visitor.visitAngularViewElement(this); |
| 7224 | 7190 |
| 7225 @override | 7191 @override |
| 7226 ElementKind get kind => ElementKind.ANGULAR_VIEW; | 7192 ElementKind get kind => ElementKind.ANGULAR_VIEW; |
| 7227 | 7193 |
| 7228 @override | 7194 @override |
| 7229 String get identifier => "AngularView@${templateUriOffset}"; | 7195 String get identifier => "AngularView@${templateUriOffset}"; |
| 7230 } | 7196 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 7246 builder.append("["); | 7212 builder.append("["); |
| 7247 builder.append(name); | 7213 builder.append(name); |
| 7248 builder.append("]"); | 7214 builder.append("]"); |
| 7249 } | 7215 } |
| 7250 } | 7216 } |
| 7251 | 7217 |
| 7252 /** | 7218 /** |
| 7253 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme
ntImpl]. | 7219 * Combination of [AngularTagSelectorElementImpl] and [HasAttributeSelectorEleme
ntImpl]. |
| 7254 */ | 7220 */ |
| 7255 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl { | 7221 class IsTagHasAttributeSelectorElementImpl extends AngularSelectorElementImpl { |
| 7256 String tagName; | 7222 final String tagName; |
| 7257 | 7223 |
| 7258 String attributeName; | 7224 final String attributeName; |
| 7259 | 7225 |
| 7260 IsTagHasAttributeSelectorElementImpl(String tagName, String attributeName) : s
uper(null, -1) { | 7226 IsTagHasAttributeSelectorElementImpl(this.tagName, this.attributeName) : super
(null, -1); |
| 7261 this.tagName = tagName; | |
| 7262 this.attributeName = attributeName; | |
| 7263 } | |
| 7264 | 7227 |
| 7265 @override | 7228 @override |
| 7266 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib
uteName) != null; | 7229 bool apply(XmlTagNode node) => node.tag == tagName && node.getAttribute(attrib
uteName) != null; |
| 7267 } | 7230 } |
| 7268 | 7231 |
| 7269 /** | 7232 /** |
| 7270 * Instances of the class `ConstructorMember` represent a constructor element de
fined in a | 7233 * Instances of the class `ConstructorMember` represent a constructor element de
fined in a |
| 7271 * parameterized type where the values of the type parameters are known. | 7234 * parameterized type where the values of the type parameters are known. |
| 7272 */ | 7235 */ |
| 7273 class ConstructorMember extends ExecutableMember implements ConstructorElement { | 7236 class ConstructorMember extends ExecutableMember implements ConstructorElement { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7527 } | 7490 } |
| 7528 | 7491 |
| 7529 /** | 7492 /** |
| 7530 * The abstract class `Member` defines the behavior common to elements that repr
esent members | 7493 * The abstract class `Member` defines the behavior common to elements that repr
esent members |
| 7531 * of parameterized types. | 7494 * of parameterized types. |
| 7532 */ | 7495 */ |
| 7533 abstract class Member implements Element { | 7496 abstract class Member implements Element { |
| 7534 /** | 7497 /** |
| 7535 * The element on which the parameterized element was created. | 7498 * The element on which the parameterized element was created. |
| 7536 */ | 7499 */ |
| 7537 Element _baseElement; | 7500 final Element _baseElement; |
| 7538 | 7501 |
| 7539 /** | 7502 /** |
| 7540 * The type in which the element is defined. | 7503 * The type in which the element is defined. |
| 7541 */ | 7504 */ |
| 7542 ParameterizedType _definingType; | 7505 final ParameterizedType _definingType; |
| 7543 | 7506 |
| 7544 /** | 7507 /** |
| 7545 * Initialize a newly created element to represent the member of the given par
ameterized type. | 7508 * Initialize a newly created element to represent the member of the given par
ameterized type. |
| 7546 * | 7509 * |
| 7547 * @param baseElement the element on which the parameterized element was creat
ed | 7510 * @param baseElement the element on which the parameterized element was creat
ed |
| 7548 * @param definingType the type in which the element is defined | 7511 * @param definingType the type in which the element is defined |
| 7549 */ | 7512 */ |
| 7550 Member(Element baseElement, ParameterizedType definingType) { | 7513 Member(this._baseElement, this._definingType); |
| 7551 this._baseElement = baseElement; | |
| 7552 this._definingType = definingType; | |
| 7553 } | |
| 7554 | 7514 |
| 7555 @override | 7515 @override |
| 7556 String computeDocumentationComment() => _baseElement.computeDocumentationComme
nt(); | 7516 String computeDocumentationComment() => _baseElement.computeDocumentationComme
nt(); |
| 7557 | 7517 |
| 7558 @override | 7518 @override |
| 7559 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p
redicate); | 7519 Element getAncestor(Predicate<Element> predicate) => baseElement.getAncestor(p
redicate); |
| 7560 | 7520 |
| 7561 /** | 7521 /** |
| 7562 * Return the element on which the parameterized element was created. | 7522 * Return the element on which the parameterized element was created. |
| 7563 * | 7523 * |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8288 | 8248 |
| 8289 @override | 8249 @override |
| 8290 Map<String, DartType> get namedParameterTypes { | 8250 Map<String, DartType> get namedParameterTypes { |
| 8291 LinkedHashMap<String, DartType> namedParameterTypes = new LinkedHashMap<Stri
ng, DartType>(); | 8251 LinkedHashMap<String, DartType> namedParameterTypes = new LinkedHashMap<Stri
ng, DartType>(); |
| 8292 List<ParameterElement> parameters = baseParameters; | 8252 List<ParameterElement> parameters = baseParameters; |
| 8293 if (parameters.length == 0) { | 8253 if (parameters.length == 0) { |
| 8294 return namedParameterTypes; | 8254 return namedParameterTypes; |
| 8295 } | 8255 } |
| 8296 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8256 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 8297 for (ParameterElement parameter in parameters) { | 8257 for (ParameterElement parameter in parameters) { |
| 8298 if (identical(parameter.parameterKind, ParameterKind.NAMED)) { | 8258 if (parameter.parameterKind == ParameterKind.NAMED) { |
| 8299 namedParameterTypes[parameter.name] = parameter.type.substitute2(typeArg
uments, typeParameters); | 8259 namedParameterTypes[parameter.name] = parameter.type.substitute2(typeArg
uments, typeParameters); |
| 8300 } | 8260 } |
| 8301 } | 8261 } |
| 8302 return namedParameterTypes; | 8262 return namedParameterTypes; |
| 8303 } | 8263 } |
| 8304 | 8264 |
| 8305 @override | 8265 @override |
| 8306 List<DartType> get normalParameterTypes { | 8266 List<DartType> get normalParameterTypes { |
| 8307 List<ParameterElement> parameters = baseParameters; | 8267 List<ParameterElement> parameters = baseParameters; |
| 8308 if (parameters.length == 0) { | 8268 if (parameters.length == 0) { |
| 8309 return TypeImpl.EMPTY_ARRAY; | 8269 return TypeImpl.EMPTY_ARRAY; |
| 8310 } | 8270 } |
| 8311 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8271 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 8312 List<DartType> types = new List<DartType>(); | 8272 List<DartType> types = new List<DartType>(); |
| 8313 for (ParameterElement parameter in parameters) { | 8273 for (ParameterElement parameter in parameters) { |
| 8314 if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) { | 8274 if (parameter.parameterKind == ParameterKind.REQUIRED) { |
| 8315 types.add(parameter.type.substitute2(typeArguments, typeParameters)); | 8275 types.add(parameter.type.substitute2(typeArguments, typeParameters)); |
| 8316 } | 8276 } |
| 8317 } | 8277 } |
| 8318 return new List.from(types); | 8278 return new List.from(types); |
| 8319 } | 8279 } |
| 8320 | 8280 |
| 8321 @override | 8281 @override |
| 8322 List<DartType> get optionalParameterTypes { | 8282 List<DartType> get optionalParameterTypes { |
| 8323 List<ParameterElement> parameters = baseParameters; | 8283 List<ParameterElement> parameters = baseParameters; |
| 8324 if (parameters.length == 0) { | 8284 if (parameters.length == 0) { |
| 8325 return TypeImpl.EMPTY_ARRAY; | 8285 return TypeImpl.EMPTY_ARRAY; |
| 8326 } | 8286 } |
| 8327 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); | 8287 List<DartType> typeParameters = TypeParameterTypeImpl.getTypes(this.typePara
meters); |
| 8328 List<DartType> types = new List<DartType>(); | 8288 List<DartType> types = new List<DartType>(); |
| 8329 for (ParameterElement parameter in parameters) { | 8289 for (ParameterElement parameter in parameters) { |
| 8330 if (identical(parameter.parameterKind, ParameterKind.POSITIONAL)) { | 8290 if (parameter.parameterKind == ParameterKind.POSITIONAL) { |
| 8331 types.add(parameter.type.substitute2(typeArguments, typeParameters)); | 8291 types.add(parameter.type.substitute2(typeArguments, typeParameters)); |
| 8332 } | 8292 } |
| 8333 } | 8293 } |
| 8334 return new List.from(types); | 8294 return new List.from(types); |
| 8335 } | 8295 } |
| 8336 | 8296 |
| 8337 @override | 8297 @override |
| 8338 List<ParameterElement> get parameters { | 8298 List<ParameterElement> get parameters { |
| 8339 List<ParameterElement> baseParameters = this.baseParameters; | 8299 List<ParameterElement> baseParameters = this.baseParameters; |
| 8340 // no parameters, quick return | 8300 // no parameters, quick return |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9522 for (int i = 0; i < length; i++) { | 9482 for (int i = 0; i < length; i++) { |
| 9523 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); | 9483 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); |
| 9524 } | 9484 } |
| 9525 return newTypes; | 9485 return newTypes; |
| 9526 } | 9486 } |
| 9527 | 9487 |
| 9528 /** | 9488 /** |
| 9529 * The element representing the declaration of this type, or `null` if the typ
e has not, or | 9489 * The element representing the declaration of this type, or `null` if the typ
e has not, or |
| 9530 * cannot, be associated with an element. | 9490 * cannot, be associated with an element. |
| 9531 */ | 9491 */ |
| 9532 Element _element; | 9492 final Element _element; |
| 9533 | 9493 |
| 9534 /** | 9494 /** |
| 9535 * The name of this type, or `null` if the type does not have a name. | 9495 * The name of this type, or `null` if the type does not have a name. |
| 9536 */ | 9496 */ |
| 9537 String name; | 9497 final String name; |
| 9538 | 9498 |
| 9539 /** | 9499 /** |
| 9540 * An empty array of types. | 9500 * An empty array of types. |
| 9541 */ | 9501 */ |
| 9542 static List<DartType> EMPTY_ARRAY = new List<DartType>(0); | 9502 static List<DartType> EMPTY_ARRAY = new List<DartType>(0); |
| 9543 | 9503 |
| 9544 /** | 9504 /** |
| 9545 * Initialize a newly created type to be declared by the given element and to
have the given name. | 9505 * Initialize a newly created type to be declared by the given element and to
have the given name. |
| 9546 * | 9506 * |
| 9547 * @param element the element representing the declaration of the type | 9507 * @param element the element representing the declaration of the type |
| 9548 * @param name the name of the type | 9508 * @param name the name of the type |
| 9549 */ | 9509 */ |
| 9550 TypeImpl(Element element, String name) { | 9510 TypeImpl(this._element, this.name); |
| 9551 this._element = element; | |
| 9552 this.name = name; | |
| 9553 } | |
| 9554 | 9511 |
| 9555 @override | 9512 @override |
| 9556 String get displayName => name; | 9513 String get displayName => name; |
| 9557 | 9514 |
| 9558 @override | 9515 @override |
| 9559 Element get element => _element; | 9516 Element get element => _element; |
| 9560 | 9517 |
| 9561 @override | 9518 @override |
| 9562 DartType getLeastUpperBound(DartType type) => null; | 9519 DartType getLeastUpperBound(DartType type) => null; |
| 9563 | 9520 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9669 } | 9626 } |
| 9670 | 9627 |
| 9671 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs); | 9628 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs); |
| 9672 | 9629 |
| 9673 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs); | 9630 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_
TypePair> visitedTypePairs); |
| 9674 | 9631 |
| 9675 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s); | 9632 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair
s); |
| 9676 } | 9633 } |
| 9677 | 9634 |
| 9678 class TypeImpl_TypePair { | 9635 class TypeImpl_TypePair { |
| 9679 DartType _firstType; | 9636 final DartType _firstType; |
| 9680 | 9637 |
| 9681 DartType _secondType; | 9638 final DartType _secondType; |
| 9682 | 9639 |
| 9683 int _cachedHashCode = 0; | 9640 int _cachedHashCode = 0; |
| 9684 | 9641 |
| 9685 TypeImpl_TypePair(DartType firstType, DartType secondType) { | 9642 TypeImpl_TypePair(this._firstType, this._secondType); |
| 9686 this._firstType = firstType; | |
| 9687 this._secondType = secondType; | |
| 9688 } | |
| 9689 | 9643 |
| 9690 @override | 9644 @override |
| 9691 bool operator ==(Object object) { | 9645 bool operator ==(Object object) { |
| 9692 if (identical(object, this)) { | 9646 if (identical(object, this)) { |
| 9693 return true; | 9647 return true; |
| 9694 } | 9648 } |
| 9695 if (object is TypeImpl_TypePair) { | 9649 if (object is TypeImpl_TypePair) { |
| 9696 TypeImpl_TypePair typePair = object; | 9650 TypeImpl_TypePair typePair = object; |
| 9697 return _firstType == typePair._firstType && _secondType != null && _second
Type == typePair._secondType; | 9651 return _firstType == typePair._firstType && _secondType != null && _second
Type == typePair._secondType; |
| 9698 } | 9652 } |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10461 } | 10415 } |
| 10462 | 10416 |
| 10463 /** | 10417 /** |
| 10464 * The interface `VoidType` defines the behavior of the unique object representi
ng the type | 10418 * The interface `VoidType` defines the behavior of the unique object representi
ng the type |
| 10465 * `void`. | 10419 * `void`. |
| 10466 */ | 10420 */ |
| 10467 abstract class VoidType implements DartType { | 10421 abstract class VoidType implements DartType { |
| 10468 @override | 10422 @override |
| 10469 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); | 10423 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp
es); |
| 10470 } | 10424 } |
| OLD | NEW |