Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 1061993003: Rename EMPTY_ARRAY to EMPTY_LIST in element model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 @override 103 @override
104 BottomTypeImpl substitute2( 104 BottomTypeImpl substitute2(
105 List<DartType> argumentTypes, List<DartType> parameterTypes) => this; 105 List<DartType> argumentTypes, List<DartType> parameterTypes) => this;
106 } 106 }
107 107
108 /** 108 /**
109 * An element that represents a class. 109 * An element that represents a class.
110 */ 110 */
111 abstract class ClassElement implements Element { 111 abstract class ClassElement implements Element {
112 /** 112 /**
113 * An empty list of class elements.
114 */
115 static const List<ClassElement> EMPTY_LIST = const <ClassElement>[];
116
117 /**
113 * Return a list containing all of the accessors (getters and setters) 118 * Return a list containing all of the accessors (getters and setters)
114 * declared in this class. 119 * declared in this class.
115 */ 120 */
116 List<PropertyAccessorElement> get accessors; 121 List<PropertyAccessorElement> get accessors;
117 122
118 /** 123 /**
119 * Return a list containing all the supertypes defined for this class and its 124 * Return a list containing all the supertypes defined for this class and its
120 * supertypes. This includes superclasses, mixins and interfaces. 125 * supertypes. This includes superclasses, mixins and interfaces.
121 */ 126 */
122 List<InterfaceType> get allSupertypes; 127 List<InterfaceType> get allSupertypes;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 String setterName, LibraryElement library); 458 String setterName, LibraryElement library);
454 } 459 }
455 460
456 /** 461 /**
457 * A concrete implementation of a [ClassElement]. 462 * A concrete implementation of a [ClassElement].
458 */ 463 */
459 class ClassElementImpl extends ElementImpl implements ClassElement { 464 class ClassElementImpl extends ElementImpl implements ClassElement {
460 /** 465 /**
461 * An empty list of class elements. 466 * An empty list of class elements.
462 */ 467 */
468 @deprecated // Use ClassElement.EMPTY_LIST
463 static const List<ClassElement> EMPTY_ARRAY = const <ClassElement>[]; 469 static const List<ClassElement> EMPTY_ARRAY = const <ClassElement>[];
464 470
465 /** 471 /**
466 * A list containing all of the accessors (getters and setters) contained in 472 * A list containing all of the accessors (getters and setters) contained in
467 * this class. 473 * this class.
468 */ 474 */
469 List<PropertyAccessorElement> _accessors = 475 List<PropertyAccessorElement> _accessors = PropertyAccessorElement.EMPTY_LIST;
470 PropertyAccessorElementImpl.EMPTY_ARRAY;
471 476
472 /** 477 /**
473 * A list containing all of the constructors contained in this class. 478 * A list containing all of the constructors contained in this class.
474 */ 479 */
475 List<ConstructorElement> _constructors = ConstructorElementImpl.EMPTY_ARRAY; 480 List<ConstructorElement> _constructors = ConstructorElement.EMPTY_LIST;
476 481
477 /** 482 /**
478 * A list containing all of the fields contained in this class. 483 * A list containing all of the fields contained in this class.
479 */ 484 */
480 List<FieldElement> _fields = FieldElementImpl.EMPTY_ARRAY; 485 List<FieldElement> _fields = FieldElement.EMPTY_LIST;
481 486
482 /** 487 /**
483 * A list containing all of the mixins that are applied to the class being 488 * A list containing all of the mixins that are applied to the class being
484 * extended in order to derive the superclass of this class. 489 * extended in order to derive the superclass of this class.
485 */ 490 */
486 List<InterfaceType> mixins = InterfaceType.EMPTY_ARRAY; 491 List<InterfaceType> mixins = InterfaceType.EMPTY_LIST;
487 492
488 /** 493 /**
489 * A list containing all of the interfaces that are implemented by this class. 494 * A list containing all of the interfaces that are implemented by this class.
490 */ 495 */
491 List<InterfaceType> interfaces = InterfaceType.EMPTY_ARRAY; 496 List<InterfaceType> interfaces = InterfaceType.EMPTY_LIST;
492 497
493 /** 498 /**
494 * A list containing all of the methods contained in this class. 499 * A list containing all of the methods contained in this class.
495 */ 500 */
496 List<MethodElement> _methods = MethodElementImpl.EMPTY_ARRAY; 501 List<MethodElement> _methods = MethodElement.EMPTY_LIST;
497 502
498 /** 503 /**
499 * The superclass of the class, or `null` if the class does not have an 504 * The superclass of the class, or `null` if the class does not have an
500 * explicit superclass. 505 * explicit superclass.
501 */ 506 */
502 InterfaceType supertype; 507 InterfaceType supertype;
503 508
504 /** 509 /**
505 * The type defined by the class. 510 * The type defined by the class.
506 */ 511 */
507 InterfaceType type; 512 InterfaceType type;
508 513
509 /** 514 /**
510 * A list containing all of the type parameters defined for this class. 515 * A list containing all of the type parameters defined for this class.
511 */ 516 */
512 List<TypeParameterElement> _typeParameters = 517 List<TypeParameterElement> _typeParameters = TypeParameterElement.EMPTY_LIST;
513 TypeParameterElementImpl.EMPTY_ARRAY;
514 518
515 /** 519 /**
516 * The [SourceRange] of the `with` clause, `null` if there is no one. 520 * The [SourceRange] of the `with` clause, `null` if there is no one.
517 */ 521 */
518 SourceRange withClauseRange; 522 SourceRange withClauseRange;
519 523
520 /** 524 /**
521 * Initialize a newly created class element to have the given [name] at the 525 * Initialize a newly created class element to have the given [name] at the
522 * given [offset] in the file that contains the declaration of this element. 526 * given [offset] in the file that contains the declaration of this element.
523 */ 527 */
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 * an entire library or class. 1153 * an entire library or class.
1150 */ 1154 */
1151 bool get isStatic; 1155 bool get isStatic;
1152 } 1156 }
1153 1157
1154 /** 1158 /**
1155 * An element representing a compilation unit. 1159 * An element representing a compilation unit.
1156 */ 1160 */
1157 abstract class CompilationUnitElement implements Element, UriReferencedElement { 1161 abstract class CompilationUnitElement implements Element, UriReferencedElement {
1158 /** 1162 /**
1163 * An empty list of compilation unit elements.
1164 */
1165 static const List<CompilationUnitElement> EMPTY_LIST =
1166 const <CompilationUnitElement>[];
1167
1168 /**
1159 * Return a list containing all of the top-level accessors (getters and 1169 * Return a list containing all of the top-level accessors (getters and
1160 * setters) contained in this compilation unit. 1170 * setters) contained in this compilation unit.
1161 */ 1171 */
1162 List<PropertyAccessorElement> get accessors; 1172 List<PropertyAccessorElement> get accessors;
1163 1173
1164 /** 1174 /**
1165 * Return the library in which this compilation unit is defined. 1175 * Return the library in which this compilation unit is defined.
1166 */ 1176 */
1167 @override 1177 @override
1168 LibraryElement get enclosingElement; 1178 LibraryElement get enclosingElement;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 } 1243 }
1234 1244
1235 /** 1245 /**
1236 * A concrete implementation of a [CompilationUnitElement]. 1246 * A concrete implementation of a [CompilationUnitElement].
1237 */ 1247 */
1238 class CompilationUnitElementImpl extends UriReferencedElementImpl 1248 class CompilationUnitElementImpl extends UriReferencedElementImpl
1239 implements CompilationUnitElement { 1249 implements CompilationUnitElement {
1240 /** 1250 /**
1241 * An empty list of compilation unit elements. 1251 * An empty list of compilation unit elements.
1242 */ 1252 */
1253 @deprecated // Use CompilationUnitElement.EMPTY_LIST
1243 static const List<CompilationUnitElement> EMPTY_ARRAY = 1254 static const List<CompilationUnitElement> EMPTY_ARRAY =
1244 const <CompilationUnitElement>[]; 1255 const <CompilationUnitElement>[];
1245 1256
1246 /** 1257 /**
1247 * The source that corresponds to this compilation unit. 1258 * The source that corresponds to this compilation unit.
1248 */ 1259 */
1249 Source source; 1260 Source source;
1250 1261
1251 /** 1262 /**
1252 * A list containing all of the top-level accessors (getters and setters) 1263 * A list containing all of the top-level accessors (getters and setters)
1253 * contained in this compilation unit. 1264 * contained in this compilation unit.
1254 */ 1265 */
1255 List<PropertyAccessorElement> _accessors = 1266 List<PropertyAccessorElement> _accessors = PropertyAccessorElement.EMPTY_LIST;
1256 PropertyAccessorElementImpl.EMPTY_ARRAY;
1257 1267
1258 /** 1268 /**
1259 * A list containing all of the enums contained in this compilation unit. 1269 * A list containing all of the enums contained in this compilation unit.
1260 */ 1270 */
1261 List<ClassElement> _enums = ClassElementImpl.EMPTY_ARRAY; 1271 List<ClassElement> _enums = ClassElement.EMPTY_LIST;
1262 1272
1263 /** 1273 /**
1264 * A list containing all of the top-level functions contained in this 1274 * A list containing all of the top-level functions contained in this
1265 * compilation unit. 1275 * compilation unit.
1266 */ 1276 */
1267 List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY; 1277 List<FunctionElement> _functions = FunctionElement.EMPTY_LIST;
1268 1278
1269 /** 1279 /**
1270 * A list containing all of the function type aliases contained in this 1280 * A list containing all of the function type aliases contained in this
1271 * compilation unit. 1281 * compilation unit.
1272 */ 1282 */
1273 List<FunctionTypeAliasElement> _typeAliases = 1283 List<FunctionTypeAliasElement> _typeAliases =
1274 FunctionTypeAliasElementImpl.EMPTY_ARRAY; 1284 FunctionTypeAliasElement.EMPTY_LIST;
1275 1285
1276 /** 1286 /**
1277 * A list containing all of the types contained in this compilation unit. 1287 * A list containing all of the types contained in this compilation unit.
1278 */ 1288 */
1279 List<ClassElement> _types = ClassElementImpl.EMPTY_ARRAY; 1289 List<ClassElement> _types = ClassElement.EMPTY_LIST;
1280 1290
1281 /** 1291 /**
1282 * A list containing all of the variables contained in this compilation unit. 1292 * A list containing all of the variables contained in this compilation unit.
1283 */ 1293 */
1284 List<TopLevelVariableElement> _variables = 1294 List<TopLevelVariableElement> _variables = TopLevelVariableElement.EMPTY_LIST;
1285 TopLevelVariableElementImpl.EMPTY_ARRAY;
1286 1295
1287 /** 1296 /**
1288 * A map from offsets to elements of this unit at these offsets. 1297 * A map from offsets to elements of this unit at these offsets.
1289 */ 1298 */
1290 final Map<int, Element> _offsetToElementMap = new HashMap<int, Element>(); 1299 final Map<int, Element> _offsetToElementMap = new HashMap<int, Element>();
1291 1300
1292 /** 1301 /**
1293 * Initialize a newly created compilation unit element to have the given 1302 * Initialize a newly created compilation unit element to have the given
1294 * [name]. 1303 * [name].
1295 */ 1304 */
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 } 1585 }
1577 } 1586 }
1578 1587
1579 /** 1588 /**
1580 * An element representing a constructor or a factory method defined within a 1589 * An element representing a constructor or a factory method defined within a
1581 * class. 1590 * class.
1582 */ 1591 */
1583 abstract class ConstructorElement 1592 abstract class ConstructorElement
1584 implements ClassMemberElement, ExecutableElement { 1593 implements ClassMemberElement, ExecutableElement {
1585 /** 1594 /**
1595 * An empty list of constructor elements.
1596 */
1597 static const List<ConstructorElement> EMPTY_LIST =
1598 const <ConstructorElement>[];
1599
1600 /**
1586 * Return `true` if this constructor is a const constructor. 1601 * Return `true` if this constructor is a const constructor.
1587 */ 1602 */
1588 bool get isConst; 1603 bool get isConst;
1589 1604
1590 /** 1605 /**
1591 * Return `true` if this constructor can be used as a default constructor - 1606 * Return `true` if this constructor can be used as a default constructor -
1592 * unnamed and has no required parameters. 1607 * unnamed and has no required parameters.
1593 */ 1608 */
1594 bool get isDefaultConstructor; 1609 bool get isDefaultConstructor;
1595 1610
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 } 1644 }
1630 1645
1631 /** 1646 /**
1632 * A concrete implementation of a [ConstructorElement]. 1647 * A concrete implementation of a [ConstructorElement].
1633 */ 1648 */
1634 class ConstructorElementImpl extends ExecutableElementImpl 1649 class ConstructorElementImpl extends ExecutableElementImpl
1635 implements ConstructorElement { 1650 implements ConstructorElement {
1636 /** 1651 /**
1637 * An empty list of constructor elements. 1652 * An empty list of constructor elements.
1638 */ 1653 */
1654 @deprecated // Use ConstructorElement.EMPTY_LIST
1639 static const List<ConstructorElement> EMPTY_ARRAY = 1655 static const List<ConstructorElement> EMPTY_ARRAY =
1640 const <ConstructorElement>[]; 1656 const <ConstructorElement>[];
1641 1657
1642 /** 1658 /**
1643 * The constructor to which this constructor is redirecting. 1659 * The constructor to which this constructor is redirecting.
1644 */ 1660 */
1645 ConstructorElement redirectedConstructor; 1661 ConstructorElement redirectedConstructor;
1646 1662
1647 /** 1663 /**
1648 * The initializers for this constructor (used for evaluating constant 1664 * The initializers for this constructor (used for evaluating constant
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 * initializers. 1925 * initializers.
1910 */ 1926 */
1911 Expression constantInitializer; 1927 Expression constantInitializer;
1912 } 1928 }
1913 1929
1914 /** 1930 /**
1915 * The type associated with elements in the element model. 1931 * The type associated with elements in the element model.
1916 */ 1932 */
1917 abstract class DartType { 1933 abstract class DartType {
1918 /** 1934 /**
1935 * An empty list of types.
1936 */
1937 static const List<DartType> EMPTY_LIST = const <DartType>[];
1938
1939 /**
1919 * Return the name of this type as it should appear when presented to users in 1940 * Return the name of this type as it should appear when presented to users in
1920 * contexts such as error messages. 1941 * contexts such as error messages.
1921 */ 1942 */
1922 String get displayName; 1943 String get displayName;
1923 1944
1924 /** 1945 /**
1925 * Return the element representing the declaration of this type, or `null` if 1946 * Return the element representing the declaration of this type, or `null` if
1926 * the type has not, or cannot, be associated with an element. The former case 1947 * the type has not, or cannot, be associated with an element. The former case
1927 * will occur if the element model is not yet complete; the latter case will 1948 * will occur if the element model is not yet complete; the latter case will
1928 * occur if this object represents an undefined type. 1949 * occur if this object represents an undefined type.
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 * is no guarantee of the order in which the children will be visited. 2401 * is no guarantee of the order in which the children will be visited.
2381 */ 2402 */
2382 void visitChildren(ElementVisitor visitor); 2403 void visitChildren(ElementVisitor visitor);
2383 } 2404 }
2384 2405
2385 /** 2406 /**
2386 * A single annotation associated with an element. 2407 * A single annotation associated with an element.
2387 */ 2408 */
2388 abstract class ElementAnnotation { 2409 abstract class ElementAnnotation {
2389 /** 2410 /**
2411 * An empty list of annotations.
2412 */
2413 static const List<ElementAnnotation> EMPTY_LIST = const <ElementAnnotation>[];
2414
2415 /**
2390 * Return the element representing the field, variable, or const constructor 2416 * Return the element representing the field, variable, or const constructor
2391 * being used as an annotation. 2417 * being used as an annotation.
2392 */ 2418 */
2393 Element get element; 2419 Element get element;
2394 2420
2395 /** 2421 /**
2396 * Return `true` if this annotation marks the associated element as being 2422 * Return `true` if this annotation marks the associated element as being
2397 * deprecated. 2423 * deprecated.
2398 */ 2424 */
2399 bool get isDeprecated; 2425 bool get isDeprecated;
(...skipping 11 matching lines...) Expand all
2411 bool get isProxy; 2437 bool get isProxy;
2412 } 2438 }
2413 2439
2414 /** 2440 /**
2415 * A concrete implementation of an [ElementAnnotation]. 2441 * A concrete implementation of an [ElementAnnotation].
2416 */ 2442 */
2417 class ElementAnnotationImpl implements ElementAnnotation { 2443 class ElementAnnotationImpl implements ElementAnnotation {
2418 /** 2444 /**
2419 * An empty list of annotations. 2445 * An empty list of annotations.
2420 */ 2446 */
2447 @deprecated // Use ElementAnnotation.EMPTY_LIST
2421 static const List<ElementAnnotationImpl> EMPTY_ARRAY = 2448 static const List<ElementAnnotationImpl> EMPTY_ARRAY =
2422 const <ElementAnnotationImpl>[]; 2449 const <ElementAnnotationImpl>[];
2423 2450
2424 /** 2451 /**
2425 * The name of the class used to mark an element as being deprecated. 2452 * The name of the class used to mark an element as being deprecated.
2426 */ 2453 */
2427 static String _DEPRECATED_CLASS_NAME = "Deprecated"; 2454 static String _DEPRECATED_CLASS_NAME = "Deprecated";
2428 2455
2429 /** 2456 /**
2430 * The name of the top-level variable used to mark an element as being 2457 * The name of the top-level variable used to mark an element as being
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 int _nameOffset = 0; 2569 int _nameOffset = 0;
2543 2570
2544 /** 2571 /**
2545 * A bit-encoded form of the modifiers associated with this element. 2572 * A bit-encoded form of the modifiers associated with this element.
2546 */ 2573 */
2547 int _modifiers = 0; 2574 int _modifiers = 0;
2548 2575
2549 /** 2576 /**
2550 * A list containing all of the metadata associated with this element. 2577 * A list containing all of the metadata associated with this element.
2551 */ 2578 */
2552 List<ElementAnnotation> metadata = ElementAnnotationImpl.EMPTY_ARRAY; 2579 List<ElementAnnotation> metadata = ElementAnnotation.EMPTY_LIST;
2553 2580
2554 /** 2581 /**
2555 * A cached copy of the calculated hashCode for this element. 2582 * A cached copy of the calculated hashCode for this element.
2556 */ 2583 */
2557 int _cachedHashCode; 2584 int _cachedHashCode;
2558 2585
2559 /** 2586 /**
2560 * A cached copy of the calculated location for this element. 2587 * A cached copy of the calculated location for this element.
2561 */ 2588 */
2562 ElementLocation _cachedLocation; 2589 ElementLocation _cachedLocation;
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
3296 safelyVisitChild(_scriptLibrary, visitor); 3323 safelyVisitChild(_scriptLibrary, visitor);
3297 } 3324 }
3298 } 3325 }
3299 3326
3300 /** 3327 /**
3301 * An element representing an executable object, including functions, methods, 3328 * An element representing an executable object, including functions, methods,
3302 * constructors, getters, and setters. 3329 * constructors, getters, and setters.
3303 */ 3330 */
3304 abstract class ExecutableElement implements Element { 3331 abstract class ExecutableElement implements Element {
3305 /** 3332 /**
3333 * An empty list of executable elements.
3334 */
3335 static const List<ExecutableElement> EMPTY_LIST = const <ExecutableElement>[];
3336
3337 /**
3306 * Return a list containing all of the functions defined within this 3338 * Return a list containing all of the functions defined within this
3307 * executable element. 3339 * executable element.
3308 */ 3340 */
3309 List<FunctionElement> get functions; 3341 List<FunctionElement> get functions;
3310 3342
3311 /** 3343 /**
3312 * Return `true` if this executable element is abstract. 3344 * Return `true` if this executable element is abstract.
3313 * Executable elements are abstract if they are not external and have no body. 3345 * Executable elements are abstract if they are not external and have no body.
3314 */ 3346 */
3315 bool get isAbstract; 3347 bool get isAbstract;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3376 } 3408 }
3377 3409
3378 /** 3410 /**
3379 * A base class for concrete implementations of an [ExecutableElement]. 3411 * A base class for concrete implementations of an [ExecutableElement].
3380 */ 3412 */
3381 abstract class ExecutableElementImpl extends ElementImpl 3413 abstract class ExecutableElementImpl extends ElementImpl
3382 implements ExecutableElement { 3414 implements ExecutableElement {
3383 /** 3415 /**
3384 * An empty list of executable elements. 3416 * An empty list of executable elements.
3385 */ 3417 */
3418 @deprecated // Use ExecutableElement.EMPTY_LIST
3386 static const List<ExecutableElement> EMPTY_ARRAY = 3419 static const List<ExecutableElement> EMPTY_ARRAY =
3387 const <ExecutableElement>[]; 3420 const <ExecutableElement>[];
3388 3421
3389 /** 3422 /**
3390 * A list containing all of the functions defined within this executable 3423 * A list containing all of the functions defined within this executable
3391 * element. 3424 * element.
3392 */ 3425 */
3393 List<FunctionElement> _functions = FunctionElementImpl.EMPTY_ARRAY; 3426 List<FunctionElement> _functions = FunctionElement.EMPTY_LIST;
3394 3427
3395 /** 3428 /**
3396 * A list containing all of the labels defined within this executable element. 3429 * A list containing all of the labels defined within this executable element.
3397 */ 3430 */
3398 List<LabelElement> _labels = LabelElementImpl.EMPTY_ARRAY; 3431 List<LabelElement> _labels = LabelElement.EMPTY_LIST;
3399 3432
3400 /** 3433 /**
3401 * A list containing all of the local variables defined within this executable 3434 * A list containing all of the local variables defined within this executable
3402 * element. 3435 * element.
3403 */ 3436 */
3404 List<LocalVariableElement> _localVariables = 3437 List<LocalVariableElement> _localVariables = LocalVariableElement.EMPTY_LIST;
3405 LocalVariableElementImpl.EMPTY_ARRAY;
3406 3438
3407 /** 3439 /**
3408 * A list containing all of the parameters defined by this executable element. 3440 * A list containing all of the parameters defined by this executable element.
3409 */ 3441 */
3410 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; 3442 List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
3411 3443
3412 /** 3444 /**
3413 * The return type defined by this executable element. 3445 * The return type defined by this executable element.
3414 */ 3446 */
3415 DartType returnType; 3447 DartType returnType;
3416 3448
3417 /** 3449 /**
3418 * The type of function defined by this executable element. 3450 * The type of function defined by this executable element.
3419 */ 3451 */
3420 FunctionType type; 3452 FunctionType type;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 } 3713 }
3682 } 3714 }
3683 3715
3684 /** 3716 /**
3685 * An export directive within a library. 3717 * An export directive within a library.
3686 */ 3718 */
3687 abstract class ExportElement implements Element, UriReferencedElement { 3719 abstract class ExportElement implements Element, UriReferencedElement {
3688 /** 3720 /**
3689 * An empty list of export elements. 3721 * An empty list of export elements.
3690 */ 3722 */
3723 @deprecated // Use ExportElement.EMPTY_LIST
3691 static const List<ExportElement> EMPTY_ARRAY = const <ExportElement>[]; 3724 static const List<ExportElement> EMPTY_ARRAY = const <ExportElement>[];
3692 3725
3693 /** 3726 /**
3727 * An empty list of export elements.
3728 */
3729 static const List<ExportElement> EMPTY_LIST = const <ExportElement>[];
3730
3731 /**
3694 * Return a list containing the combinators that were specified as part of the 3732 * Return a list containing the combinators that were specified as part of the
3695 * export directive in the order in which they were specified. 3733 * export directive in the order in which they were specified.
3696 */ 3734 */
3697 List<NamespaceCombinator> get combinators; 3735 List<NamespaceCombinator> get combinators;
3698 3736
3699 /** 3737 /**
3700 * Return the library that is exported from this library by this export 3738 * Return the library that is exported from this library by this export
3701 * directive. 3739 * directive.
3702 */ 3740 */
3703 LibraryElement get exportedLibrary; 3741 LibraryElement get exportedLibrary;
3704 } 3742 }
3705 3743
3706 /** 3744 /**
3707 * A concrete implementation of an [ExportElement]. 3745 * A concrete implementation of an [ExportElement].
3708 */ 3746 */
3709 class ExportElementImpl extends UriReferencedElementImpl 3747 class ExportElementImpl extends UriReferencedElementImpl
3710 implements ExportElement { 3748 implements ExportElement {
3711 /** 3749 /**
3712 * The library that is exported from this library by this export directive. 3750 * The library that is exported from this library by this export directive.
3713 */ 3751 */
3714 LibraryElement exportedLibrary; 3752 LibraryElement exportedLibrary;
3715 3753
3716 /** 3754 /**
3717 * The combinators that were specified as part of the export directive in the 3755 * The combinators that were specified as part of the export directive in the
3718 * order in which they were specified. 3756 * order in which they were specified.
3719 */ 3757 */
3720 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY; 3758 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST;
3721 3759
3722 /** 3760 /**
3723 * Initialize a newly created export element at the given [offset]. 3761 * Initialize a newly created export element at the given [offset].
3724 */ 3762 */
3725 ExportElementImpl(int offset) : super(null, offset); 3763 ExportElementImpl(int offset) : super(null, offset);
3726 3764
3727 @override 3765 @override
3728 String get identifier => exportedLibrary.name; 3766 String get identifier => exportedLibrary.name;
3729 3767
3730 @override 3768 @override
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3775 accept(ElementVisitor visitor) => 3813 accept(ElementVisitor visitor) =>
3776 visitor.visitExternalHtmlScriptElement(this); 3814 visitor.visitExternalHtmlScriptElement(this);
3777 } 3815 }
3778 3816
3779 /** 3817 /**
3780 * A field defined within a type. 3818 * A field defined within a type.
3781 */ 3819 */
3782 abstract class FieldElement 3820 abstract class FieldElement
3783 implements ClassMemberElement, PropertyInducingElement { 3821 implements ClassMemberElement, PropertyInducingElement {
3784 /** 3822 /**
3823 * An empty list of field elements.
3824 */
3825 static const List<FieldElement> EMPTY_LIST = const <FieldElement>[];
3826
3827 /**
3785 * Return {@code true} if this element is an enum constant. 3828 * Return {@code true} if this element is an enum constant.
3786 */ 3829 */
3787 bool get isEnumConstant; 3830 bool get isEnumConstant;
3788 3831
3789 /** 3832 /**
3790 * Return the resolved [VariableDeclaration] or [EnumConstantDeclaration] 3833 * Return the resolved [VariableDeclaration] or [EnumConstantDeclaration]
3791 * node that declares this [FieldElement]. 3834 * node that declares this [FieldElement].
3792 * 3835 *
3793 * This method is expensive, because resolved AST might be evicted from cache, 3836 * This method is expensive, because resolved AST might be evicted from cache,
3794 * so parsing and resolving will be performed. 3837 * so parsing and resolving will be performed.
3795 */ 3838 */
3796 @override 3839 @override
3797 AstNode get node; 3840 AstNode get node;
3798 } 3841 }
3799 3842
3800 /** 3843 /**
3801 * A concrete implementation of a [FieldElement]. 3844 * A concrete implementation of a [FieldElement].
3802 */ 3845 */
3803 class FieldElementImpl extends PropertyInducingElementImpl 3846 class FieldElementImpl extends PropertyInducingElementImpl
3804 with PotentiallyConstVariableElement implements FieldElement { 3847 with PotentiallyConstVariableElement implements FieldElement {
3805 /** 3848 /**
3806 * An empty list of field elements. 3849 * An empty list of field elements.
3807 */ 3850 */
3851 @deprecated // Use FieldElement.EMPTY_LIST
3808 static const List<FieldElement> EMPTY_ARRAY = const <FieldElement>[]; 3852 static const List<FieldElement> EMPTY_ARRAY = const <FieldElement>[];
3809 3853
3810 /** 3854 /**
3811 * Initialize a newly created synthetic field element to have the given [name] 3855 * Initialize a newly created synthetic field element to have the given [name]
3812 * at the given [offset]. 3856 * at the given [offset].
3813 */ 3857 */
3814 FieldElementImpl(String name, int offset) : super(name, offset); 3858 FieldElementImpl(String name, int offset) : super(name, offset);
3815 3859
3816 /** 3860 /**
3817 * Initialize a newly created field element to have the given [name]. 3861 * Initialize a newly created field element to have the given [name].
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 } 4055 }
4012 } 4056 }
4013 4057
4014 /** 4058 /**
4015 * A (non-method) function. This can be either a top-level function, a local 4059 * A (non-method) function. This can be either a top-level function, a local
4016 * function, a closure, or the initialization expression for a field or 4060 * function, a closure, or the initialization expression for a field or
4017 * variable. 4061 * variable.
4018 */ 4062 */
4019 abstract class FunctionElement implements ExecutableElement, LocalElement { 4063 abstract class FunctionElement implements ExecutableElement, LocalElement {
4020 /** 4064 /**
4065 * An empty list of function elements.
4066 */
4067 static const List<FunctionElement> EMPTY_LIST = const <FunctionElement>[];
4068
4069 /**
4021 * The name of the method that can be implemented by a class to allow its 4070 * The name of the method that can be implemented by a class to allow its
4022 * instances to be invoked as if they were a function. 4071 * instances to be invoked as if they were a function.
4023 */ 4072 */
4024 static final String CALL_METHOD_NAME = "call"; 4073 static final String CALL_METHOD_NAME = "call";
4025 4074
4026 /** 4075 /**
4027 * The name of the synthetic function defined for libraries that are deferred. 4076 * The name of the synthetic function defined for libraries that are deferred.
4028 */ 4077 */
4029 static final String LOAD_LIBRARY_NAME = "loadLibrary"; 4078 static final String LOAD_LIBRARY_NAME = "loadLibrary";
4030 4079
(...skipping 25 matching lines...) Expand all
4056 } 4105 }
4057 4106
4058 /** 4107 /**
4059 * A concrete implementation of a [FunctionElement]. 4108 * A concrete implementation of a [FunctionElement].
4060 */ 4109 */
4061 class FunctionElementImpl extends ExecutableElementImpl 4110 class FunctionElementImpl extends ExecutableElementImpl
4062 implements FunctionElement { 4111 implements FunctionElement {
4063 /** 4112 /**
4064 * An empty list of function elements. 4113 * An empty list of function elements.
4065 */ 4114 */
4115 @deprecated // Use FunctionElement.EMPTY_LIST
4066 static const List<FunctionElement> EMPTY_ARRAY = const <FunctionElement>[]; 4116 static const List<FunctionElement> EMPTY_ARRAY = const <FunctionElement>[];
4067 4117
4068 /** 4118 /**
4069 * The offset to the beginning of the visible range for this element. 4119 * The offset to the beginning of the visible range for this element.
4070 */ 4120 */
4071 int _visibleRangeOffset = 0; 4121 int _visibleRangeOffset = 0;
4072 4122
4073 /** 4123 /**
4074 * The length of the visible range for this element, or `-1` if this element 4124 * The length of the visible range for this element, or `-1` if this element
4075 * does not have a visible range. 4125 * does not have a visible range.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
4270 * `substitute(argumentTypes, getTypeArguments())`. 4320 * `substitute(argumentTypes, getTypeArguments())`.
4271 */ 4321 */
4272 FunctionType substitute3(List<DartType> argumentTypes); 4322 FunctionType substitute3(List<DartType> argumentTypes);
4273 } 4323 }
4274 4324
4275 /** 4325 /**
4276 * A function type alias (`typedef`). 4326 * A function type alias (`typedef`).
4277 */ 4327 */
4278 abstract class FunctionTypeAliasElement implements Element { 4328 abstract class FunctionTypeAliasElement implements Element {
4279 /** 4329 /**
4330 * An empty array of type alias elements.
4331 */
4332 static List<FunctionTypeAliasElement> EMPTY_LIST =
4333 new List<FunctionTypeAliasElement>(0);
4334
4335 /**
4280 * Return the compilation unit in which this type alias is defined. 4336 * Return the compilation unit in which this type alias is defined.
4281 */ 4337 */
4282 @override 4338 @override
4283 CompilationUnitElement get enclosingElement; 4339 CompilationUnitElement get enclosingElement;
4284 4340
4285 /** 4341 /**
4286 * Return the resolved function type alias node that declares this element. 4342 * Return the resolved function type alias node that declares this element.
4287 * 4343 *
4288 * This method is expensive, because resolved AST might be evicted from cache, 4344 * This method is expensive, because resolved AST might be evicted from cache,
4289 * so parsing and resolving will be performed. 4345 * so parsing and resolving will be performed.
(...skipping 23 matching lines...) Expand all
4313 } 4369 }
4314 4370
4315 /** 4371 /**
4316 * A concrete implementation of a [FunctionTypeAliasElement]. 4372 * A concrete implementation of a [FunctionTypeAliasElement].
4317 */ 4373 */
4318 class FunctionTypeAliasElementImpl extends ElementImpl 4374 class FunctionTypeAliasElementImpl extends ElementImpl
4319 implements FunctionTypeAliasElement { 4375 implements FunctionTypeAliasElement {
4320 /** 4376 /**
4321 * An empty array of type alias elements. 4377 * An empty array of type alias elements.
4322 */ 4378 */
4379 @deprecated // Use FunctionTypeAliasElement.EMPTY_LIST
4323 static List<FunctionTypeAliasElement> EMPTY_ARRAY = 4380 static List<FunctionTypeAliasElement> EMPTY_ARRAY =
4324 new List<FunctionTypeAliasElement>(0); 4381 new List<FunctionTypeAliasElement>(0);
4325 4382
4326 /** 4383 /**
4327 * A list containing all of the parameters defined by this type alias. 4384 * A list containing all of the parameters defined by this type alias.
4328 */ 4385 */
4329 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; 4386 List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
4330 4387
4331 /** 4388 /**
4332 * The return type defined by this type alias. 4389 * The return type defined by this type alias.
4333 */ 4390 */
4334 DartType returnType; 4391 DartType returnType;
4335 4392
4336 /** 4393 /**
4337 * The type of function defined by this type alias. 4394 * The type of function defined by this type alias.
4338 */ 4395 */
4339 FunctionType type; 4396 FunctionType type;
4340 4397
4341 /** 4398 /**
4342 * A list containing all of the type parameters defined for this type. 4399 * A list containing all of the type parameters defined for this type.
4343 */ 4400 */
4344 List<TypeParameterElement> _typeParameters = 4401 List<TypeParameterElement> _typeParameters = TypeParameterElement.EMPTY_LIST;
4345 TypeParameterElementImpl.EMPTY_ARRAY;
4346 4402
4347 /** 4403 /**
4348 * Initialize a newly created type alias element to have the given name. 4404 * Initialize a newly created type alias element to have the given name.
4349 * 4405 *
4350 * [name] the name of this element 4406 * [name] the name of this element
4351 * [nameOffset] the offset of the name of this element in the file that 4407 * [nameOffset] the offset of the name of this element in the file that
4352 * contains the declaration of this element 4408 * contains the declaration of this element
4353 */ 4409 */
4354 FunctionTypeAliasElementImpl(String name, int nameOffset) 4410 FunctionTypeAliasElementImpl(String name, int nameOffset)
4355 : super(name, nameOffset); 4411 : super(name, nameOffset);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
4477 } 4533 }
4478 } 4534 }
4479 4535
4480 /** 4536 /**
4481 * The type of a function, method, constructor, getter, or setter. 4537 * The type of a function, method, constructor, getter, or setter.
4482 */ 4538 */
4483 class FunctionTypeImpl extends TypeImpl implements FunctionType { 4539 class FunctionTypeImpl extends TypeImpl implements FunctionType {
4484 /** 4540 /**
4485 * A list containing the actual types of the type arguments. 4541 * A list containing the actual types of the type arguments.
4486 */ 4542 */
4487 List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY; 4543 List<DartType> typeArguments = DartType.EMPTY_LIST;
4488 4544
4489 /** 4545 /**
4490 * Initialize a newly created function type to be declared by the given 4546 * Initialize a newly created function type to be declared by the given
4491 * [element]. 4547 * [element].
4492 */ 4548 */
4493 FunctionTypeImpl.con1(ExecutableElement element) : super(element, null); 4549 FunctionTypeImpl.con1(ExecutableElement element) : super(element, null);
4494 4550
4495 /** 4551 /**
4496 * Initialize a newly created function type to be declared by the given 4552 * Initialize a newly created function type to be declared by the given
4497 * [element]. 4553 * [element].
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 namedParameterTypes[parameter.name] = type; 4673 namedParameterTypes[parameter.name] = type;
4618 } 4674 }
4619 } 4675 }
4620 return namedParameterTypes; 4676 return namedParameterTypes;
4621 } 4677 }
4622 4678
4623 @override 4679 @override
4624 List<DartType> get normalParameterTypes { 4680 List<DartType> get normalParameterTypes {
4625 List<ParameterElement> parameters = baseParameters; 4681 List<ParameterElement> parameters = baseParameters;
4626 if (parameters.length == 0) { 4682 if (parameters.length == 0) {
4627 return TypeImpl.EMPTY_ARRAY; 4683 return DartType.EMPTY_LIST;
4628 } 4684 }
4629 List<DartType> typeParameters = 4685 List<DartType> typeParameters =
4630 TypeParameterTypeImpl.getTypes(this.typeParameters); 4686 TypeParameterTypeImpl.getTypes(this.typeParameters);
4631 List<DartType> types = new List<DartType>(); 4687 List<DartType> types = new List<DartType>();
4632 for (ParameterElement parameter in parameters) { 4688 for (ParameterElement parameter in parameters) {
4633 if (parameter.parameterKind == ParameterKind.REQUIRED) { 4689 if (parameter.parameterKind == ParameterKind.REQUIRED) {
4634 DartType type = parameter.type; 4690 DartType type = parameter.type;
4635 if (typeArguments.length != 0 && 4691 if (typeArguments.length != 0 &&
4636 typeArguments.length == typeParameters.length) { 4692 typeArguments.length == typeParameters.length) {
4637 type = type.substitute2(typeArguments, typeParameters); 4693 type = type.substitute2(typeArguments, typeParameters);
4638 } 4694 }
4639 types.add(type); 4695 types.add(type);
4640 } 4696 }
4641 } 4697 }
4642 return types; 4698 return types;
4643 } 4699 }
4644 4700
4645 @override 4701 @override
4646 List<DartType> get optionalParameterTypes { 4702 List<DartType> get optionalParameterTypes {
4647 List<ParameterElement> parameters = baseParameters; 4703 List<ParameterElement> parameters = baseParameters;
4648 if (parameters.length == 0) { 4704 if (parameters.length == 0) {
4649 return TypeImpl.EMPTY_ARRAY; 4705 return DartType.EMPTY_LIST;
4650 } 4706 }
4651 List<DartType> typeParameters = 4707 List<DartType> typeParameters =
4652 TypeParameterTypeImpl.getTypes(this.typeParameters); 4708 TypeParameterTypeImpl.getTypes(this.typeParameters);
4653 List<DartType> types = new List<DartType>(); 4709 List<DartType> types = new List<DartType>();
4654 for (ParameterElement parameter in parameters) { 4710 for (ParameterElement parameter in parameters) {
4655 if (parameter.parameterKind == ParameterKind.POSITIONAL) { 4711 if (parameter.parameterKind == ParameterKind.POSITIONAL) {
4656 DartType type = parameter.type; 4712 DartType type = parameter.type;
4657 if (typeArguments.length != 0 && 4713 if (typeArguments.length != 0 &&
4658 typeArguments.length == typeParameters.length) { 4714 typeArguments.length == typeParameters.length) {
4659 type = type.substitute2(typeArguments, typeParameters); 4715 type = type.substitute2(typeArguments, typeParameters);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4703 List<TypeParameterElement> get typeParameters { 4759 List<TypeParameterElement> get typeParameters {
4704 Element element = this.element; 4760 Element element = this.element;
4705 if (element is FunctionTypeAliasElement) { 4761 if (element is FunctionTypeAliasElement) {
4706 return element.typeParameters; 4762 return element.typeParameters;
4707 } 4763 }
4708 ClassElement definingClass = 4764 ClassElement definingClass =
4709 element.getAncestor((element) => element is ClassElement); 4765 element.getAncestor((element) => element is ClassElement);
4710 if (definingClass != null) { 4766 if (definingClass != null) {
4711 return definingClass.typeParameters; 4767 return definingClass.typeParameters;
4712 } 4768 }
4713 return TypeParameterElementImpl.EMPTY_ARRAY; 4769 return TypeParameterElement.EMPTY_LIST;
4714 } 4770 }
4715 4771
4716 @override 4772 @override
4717 bool operator ==(Object object) => 4773 bool operator ==(Object object) =>
4718 internalEquals(object, new HashSet<ElementPair>()); 4774 internalEquals(object, new HashSet<ElementPair>());
4719 4775
4720 @override 4776 @override
4721 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) { 4777 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) {
4722 if (!visitedTypes.add(this)) { 4778 if (!visitedTypes.add(this)) {
4723 buffer.write(name == null ? '...' : name); 4779 buffer.write(name == null ? '...' : name);
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
5379 } 5435 }
5380 return buffer.toString(); 5436 return buffer.toString();
5381 } 5437 }
5382 } 5438 }
5383 5439
5384 /** 5440 /**
5385 * An HTML file. 5441 * An HTML file.
5386 */ 5442 */
5387 abstract class HtmlElement implements Element { 5443 abstract class HtmlElement implements Element {
5388 /** 5444 /**
5445 * An empty list of HTML file elements.
5446 */
5447 static const List<HtmlElement> EMPTY_LIST = const <HtmlElement>[];
5448
5449 /**
5389 * Return a list containing all of the script elements contained in the HTML 5450 * Return a list containing all of the script elements contained in the HTML
5390 * file. This includes scripts with libraries that are defined by the content 5451 * file. This includes scripts with libraries that are defined by the content
5391 * of a script tag as well as libraries that are referenced in the `source` 5452 * of a script tag as well as libraries that are referenced in the `source`
5392 * attribute of a script tag. 5453 * attribute of a script tag.
5393 */ 5454 */
5394 List<HtmlScriptElement> get scripts; 5455 List<HtmlScriptElement> get scripts;
5395 } 5456 }
5396 5457
5397 /** 5458 /**
5398 * A concrete implementation of an [HtmlElement]. 5459 * A concrete implementation of an [HtmlElement].
5399 */ 5460 */
5400 class HtmlElementImpl extends ElementImpl implements HtmlElement { 5461 class HtmlElementImpl extends ElementImpl implements HtmlElement {
5401 /** 5462 /**
5402 * An empty list of HTML file elements. 5463 * An empty list of HTML file elements.
5403 */ 5464 */
5465 @deprecated // Use HtmlElement.EMPTY_LIST
5404 static const List<HtmlElement> EMPTY_ARRAY = const <HtmlElement>[]; 5466 static const List<HtmlElement> EMPTY_ARRAY = const <HtmlElement>[];
5405 5467
5406 /** 5468 /**
5407 * The analysis context in which this library is defined. 5469 * The analysis context in which this library is defined.
5408 */ 5470 */
5409 final AnalysisContext context; 5471 final AnalysisContext context;
5410 5472
5411 /** 5473 /**
5412 * The scripts contained in or referenced from script tags in the HTML file. 5474 * The scripts contained in or referenced from script tags in the HTML file.
5413 */ 5475 */
5414 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY; 5476 List<HtmlScriptElement> _scripts = HtmlScriptElement.EMPTY_LIST;
5415 5477
5416 /** 5478 /**
5417 * The source that corresponds to this HTML file. 5479 * The source that corresponds to this HTML file.
5418 */ 5480 */
5419 Source source; 5481 Source source;
5420 5482
5421 /** 5483 /**
5422 * Initialize a newly created HTML element in the given [context] to have the 5484 * Initialize a newly created HTML element in the given [context] to have the
5423 * given [name]. 5485 * given [name].
5424 */ 5486 */
5425 HtmlElementImpl(this.context, String name) : super(name, -1); 5487 HtmlElementImpl(this.context, String name) : super(name, -1);
5426 5488
5427 @override 5489 @override
5428 int get hashCode => source.hashCode; 5490 int get hashCode => source.hashCode;
5429 5491
5430 @override 5492 @override
5431 String get identifier => source.encoding; 5493 String get identifier => source.encoding;
5432 5494
5433 @override 5495 @override
5434 ElementKind get kind => ElementKind.HTML; 5496 ElementKind get kind => ElementKind.HTML;
5435 5497
5436 @override 5498 @override
5437 List<HtmlScriptElement> get scripts => _scripts; 5499 List<HtmlScriptElement> get scripts => _scripts;
5438 5500
5439 /** 5501 /**
5440 * Set the scripts contained in the HTML file to the given [scripts]. 5502 * Set the scripts contained in the HTML file to the given [scripts].
5441 */ 5503 */
5442 void set scripts(List<HtmlScriptElement> scripts) { 5504 void set scripts(List<HtmlScriptElement> scripts) {
5443 if (scripts.length == 0) { 5505 if (scripts.length == 0) {
5444 this._scripts = HtmlScriptElementImpl.EMPTY_ARRAY; 5506 this._scripts = HtmlScriptElement.EMPTY_LIST;
5445 return; 5507 return;
5446 } 5508 }
5447 for (HtmlScriptElement script in scripts) { 5509 for (HtmlScriptElement script in scripts) {
5448 (script as HtmlScriptElementImpl).enclosingElement = this; 5510 (script as HtmlScriptElementImpl).enclosingElement = this;
5449 } 5511 }
5450 this._scripts = scripts; 5512 this._scripts = scripts;
5451 } 5513 }
5452 5514
5453 @override 5515 @override
5454 bool operator ==(Object object) { 5516 bool operator ==(Object object) {
(...skipping 20 matching lines...) Expand all
5475 super.visitChildren(visitor); 5537 super.visitChildren(visitor);
5476 safelyVisitChildren(_scripts, visitor); 5538 safelyVisitChildren(_scripts, visitor);
5477 } 5539 }
5478 } 5540 }
5479 5541
5480 /** 5542 /**
5481 * A script tag in an HTML file. 5543 * A script tag in an HTML file.
5482 * 5544 *
5483 * See [EmbeddedHtmlScriptElement], and [ExternalHtmlScriptElement]. 5545 * See [EmbeddedHtmlScriptElement], and [ExternalHtmlScriptElement].
5484 */ 5546 */
5485 abstract class HtmlScriptElement implements Element {} 5547 abstract class HtmlScriptElement implements Element {
5548 /**
5549 * An empty list of HTML script elements.
5550 */
5551 static const List<HtmlScriptElement> EMPTY_LIST = const <HtmlScriptElement>[];
5552 }
5486 5553
5487 /** 5554 /**
5488 * A concrete implementation of an [HtmlScriptElement]. 5555 * A concrete implementation of an [HtmlScriptElement].
5489 */ 5556 */
5490 abstract class HtmlScriptElementImpl extends ElementImpl 5557 abstract class HtmlScriptElementImpl extends ElementImpl
5491 implements HtmlScriptElement { 5558 implements HtmlScriptElement {
5492 /** 5559 /**
5493 * An empty list of HTML script elements. 5560 * An empty list of HTML script elements.
5494 */ 5561 */
5562 @deprecated // Use HtmlScriptElement.EMPTY_LIST
5495 static const List<HtmlScriptElement> EMPTY_ARRAY = 5563 static const List<HtmlScriptElement> EMPTY_ARRAY =
5496 const <HtmlScriptElement>[]; 5564 const <HtmlScriptElement>[];
5497 5565
5498 /** 5566 /**
5499 * Initialize a newly created script element corresponding to the given 5567 * Initialize a newly created script element corresponding to the given
5500 * [node]. 5568 * [node].
5501 */ 5569 */
5502 HtmlScriptElementImpl(XmlTagNode node) 5570 HtmlScriptElementImpl(XmlTagNode node)
5503 : super(node.tag, node.tagToken.offset); 5571 : super(node.tag, node.tagToken.offset);
5504 } 5572 }
5505 5573
5506 /** 5574 /**
5507 * A single import directive within a library. 5575 * A single import directive within a library.
5508 */ 5576 */
5509 abstract class ImportElement implements Element, UriReferencedElement { 5577 abstract class ImportElement implements Element, UriReferencedElement {
5510 /** 5578 /**
5511 * An empty list of import elements. 5579 * An empty list of import elements.
5512 */ 5580 */
5581 @deprecated // Use ImportElement.EMPTY_LIST
5513 static const List<ImportElement> EMPTY_ARRAY = const <ImportElement>[]; 5582 static const List<ImportElement> EMPTY_ARRAY = const <ImportElement>[];
5514 5583
5515 /** 5584 /**
5585 * An empty list of import elements.
5586 */
5587 static const List<ImportElement> EMPTY_LIST = const <ImportElement>[];
5588
5589 /**
5516 * Return a list containing the combinators that were specified as part of the 5590 * Return a list containing the combinators that were specified as part of the
5517 * import directive in the order in which they were specified. 5591 * import directive in the order in which they were specified.
5518 */ 5592 */
5519 List<NamespaceCombinator> get combinators; 5593 List<NamespaceCombinator> get combinators;
5520 5594
5521 /** 5595 /**
5522 * Return the library that is imported into this library by this import 5596 * Return the library that is imported into this library by this import
5523 * directive. 5597 * directive.
5524 */ 5598 */
5525 LibraryElement get importedLibrary; 5599 LibraryElement get importedLibrary;
(...skipping 30 matching lines...) Expand all
5556 5630
5557 /** 5631 /**
5558 * The library that is imported into this library by this import directive. 5632 * The library that is imported into this library by this import directive.
5559 */ 5633 */
5560 LibraryElement importedLibrary; 5634 LibraryElement importedLibrary;
5561 5635
5562 /** 5636 /**
5563 * The combinators that were specified as part of the import directive in the 5637 * The combinators that were specified as part of the import directive in the
5564 * order in which they were specified. 5638 * order in which they were specified.
5565 */ 5639 */
5566 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY; 5640 List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_LIST;
5567 5641
5568 /** 5642 /**
5569 * The prefix that was specified as part of the import directive, or `null` if 5643 * The prefix that was specified as part of the import directive, or `null` if
5570 * there was no prefix specified. 5644 * there was no prefix specified.
5571 */ 5645 */
5572 PrefixElement prefix; 5646 PrefixElement prefix;
5573 5647
5574 /** 5648 /**
5575 * Initialize a newly created import element at the given [offset]. 5649 * Initialize a newly created import element at the given [offset].
5576 * The offset may be `-1` if the import is synthetic. 5650 * The offset may be `-1` if the import is synthetic.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5611 } 5685 }
5612 5686
5613 /** 5687 /**
5614 * The type introduced by either a class or an interface, or a reference to such 5688 * The type introduced by either a class or an interface, or a reference to such
5615 * a type. 5689 * a type.
5616 */ 5690 */
5617 abstract class InterfaceType implements ParameterizedType { 5691 abstract class InterfaceType implements ParameterizedType {
5618 /** 5692 /**
5619 * An empty list of types. 5693 * An empty list of types.
5620 */ 5694 */
5695 @deprecated // Use InterfaceType.EMPTY_LIST
5621 static const List<InterfaceType> EMPTY_ARRAY = const <InterfaceType>[]; 5696 static const List<InterfaceType> EMPTY_ARRAY = const <InterfaceType>[];
5622 5697
5623 /** 5698 /**
5699 * An empty list of types.
5700 */
5701 static const List<InterfaceType> EMPTY_LIST = const <InterfaceType>[];
5702
5703 /**
5624 * Return a list containing all of the accessors (getters and setters) 5704 * Return a list containing all of the accessors (getters and setters)
5625 * declared in this type. 5705 * declared in this type.
5626 */ 5706 */
5627 List<PropertyAccessorElement> get accessors; 5707 List<PropertyAccessorElement> get accessors;
5628 5708
5629 @override 5709 @override
5630 ClassElement get element; 5710 ClassElement get element;
5631 5711
5632 /** 5712 /**
5633 * Return a list containing all of the interfaces that are implemented by this 5713 * Return a list containing all of the interfaces that are implemented by this
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
5938 } 6018 }
5939 } 6019 }
5940 6020
5941 /** 6021 /**
5942 * A concrete implementation of an [InterfaceType]. 6022 * A concrete implementation of an [InterfaceType].
5943 */ 6023 */
5944 class InterfaceTypeImpl extends TypeImpl implements InterfaceType { 6024 class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
5945 /** 6025 /**
5946 * A list containing the actual types of the type arguments. 6026 * A list containing the actual types of the type arguments.
5947 */ 6027 */
5948 List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY; 6028 List<DartType> typeArguments = DartType.EMPTY_LIST;
5949 6029
5950 /** 6030 /**
5951 * Initialize a newly created type to be declared by the given [element]. 6031 * Initialize a newly created type to be declared by the given [element].
5952 */ 6032 */
5953 InterfaceTypeImpl.con1(ClassElement element) 6033 InterfaceTypeImpl.con1(ClassElement element)
5954 : super(element, element.displayName); 6034 : super(element, element.displayName);
5955 6035
5956 /** 6036 /**
5957 * Initialize a newly created type to have the given [name]. This constructor 6037 * Initialize a newly created type to have the given [name]. This constructor
5958 * should only be used in cases where there is no declaration of the type. 6038 * should only be used in cases where there is no declaration of the type.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
6616 result.retainAll(second); 6696 result.retainAll(second);
6617 return new List.from(result); 6697 return new List.from(result);
6618 } 6698 }
6619 } 6699 }
6620 6700
6621 /** 6701 /**
6622 * A label associated with a statement. 6702 * A label associated with a statement.
6623 */ 6703 */
6624 abstract class LabelElement implements Element { 6704 abstract class LabelElement implements Element {
6625 /** 6705 /**
6706 * An empty list of label elements.
6707 */
6708 static const List<LabelElement> EMPTY_LIST = const <LabelElement>[];
6709
6710 /**
6626 * Return the executable element in which this label is defined. 6711 * Return the executable element in which this label is defined.
6627 */ 6712 */
6628 @override 6713 @override
6629 ExecutableElement get enclosingElement; 6714 ExecutableElement get enclosingElement;
6630 } 6715 }
6631 6716
6632 /** 6717 /**
6633 * A concrete implementation of a [LabelElement]. 6718 * A concrete implementation of a [LabelElement].
6634 */ 6719 */
6635 class LabelElementImpl extends ElementImpl implements LabelElement { 6720 class LabelElementImpl extends ElementImpl implements LabelElement {
6636 /** 6721 /**
6637 * An empty list of label elements. 6722 * An empty list of label elements.
6638 */ 6723 */
6724 @deprecated // Use LabelElement.EMPTY_LIST
6639 static const List<LabelElement> EMPTY_ARRAY = const <LabelElement>[]; 6725 static const List<LabelElement> EMPTY_ARRAY = const <LabelElement>[];
6640 6726
6641 /** 6727 /**
6642 * A flag indicating whether this label is associated with a `switch` 6728 * A flag indicating whether this label is associated with a `switch`
6643 * statement. 6729 * statement.
6644 */ 6730 */
6645 // TODO(brianwilkerson) Make this a modifier. 6731 // TODO(brianwilkerson) Make this a modifier.
6646 final bool _onSwitchStatement; 6732 final bool _onSwitchStatement;
6647 6733
6648 /** 6734 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
6682 6768
6683 @override 6769 @override
6684 accept(ElementVisitor visitor) => visitor.visitLabelElement(this); 6770 accept(ElementVisitor visitor) => visitor.visitLabelElement(this);
6685 } 6771 }
6686 6772
6687 /** 6773 /**
6688 * A library. 6774 * A library.
6689 */ 6775 */
6690 abstract class LibraryElement implements Element { 6776 abstract class LibraryElement implements Element {
6691 /** 6777 /**
6778 * An empty list of library elements.
6779 */
6780 static const List<LibraryElement> EMPTY_LIST = const <LibraryElement>[];
6781
6782 /**
6692 * Return the compilation unit that defines this library. 6783 * Return the compilation unit that defines this library.
6693 */ 6784 */
6694 CompilationUnitElement get definingCompilationUnit; 6785 CompilationUnitElement get definingCompilationUnit;
6695 6786
6696 /** 6787 /**
6697 * Return the entry point for this library, or `null` if this library does not 6788 * Return the entry point for this library, or `null` if this library does not
6698 * have an entry point. The entry point is defined to be a zero argument 6789 * have an entry point. The entry point is defined to be a zero argument
6699 * top-level function whose name is `main`. 6790 * top-level function whose name is `main`.
6700 */ 6791 */
6701 FunctionElement get entryPoint; 6792 FunctionElement get entryPoint;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
6817 bool isUpToDate(int timeStamp); 6908 bool isUpToDate(int timeStamp);
6818 } 6909 }
6819 6910
6820 /** 6911 /**
6821 * A concrete implementation of a [LibraryElement]. 6912 * A concrete implementation of a [LibraryElement].
6822 */ 6913 */
6823 class LibraryElementImpl extends ElementImpl implements LibraryElement { 6914 class LibraryElementImpl extends ElementImpl implements LibraryElement {
6824 /** 6915 /**
6825 * An empty list of library elements. 6916 * An empty list of library elements.
6826 */ 6917 */
6918 @deprecated // Use LibraryElement.EMPTY_LIST
6827 static const List<LibraryElement> EMPTY_ARRAY = const <LibraryElement>[]; 6919 static const List<LibraryElement> EMPTY_ARRAY = const <LibraryElement>[];
6828 6920
6829 /** 6921 /**
6830 * The analysis context in which this library is defined. 6922 * The analysis context in which this library is defined.
6831 */ 6923 */
6832 final AnalysisContext context; 6924 final AnalysisContext context;
6833 6925
6834 /** 6926 /**
6835 * The compilation unit that defines this library. 6927 * The compilation unit that defines this library.
6836 */ 6928 */
6837 CompilationUnitElement _definingCompilationUnit; 6929 CompilationUnitElement _definingCompilationUnit;
6838 6930
6839 /** 6931 /**
6840 * The entry point for this library, or `null` if this library does not have 6932 * The entry point for this library, or `null` if this library does not have
6841 * an entry point. 6933 * an entry point.
6842 */ 6934 */
6843 FunctionElement entryPoint; 6935 FunctionElement entryPoint;
6844 6936
6845 /** 6937 /**
6846 * A list containing specifications of all of the imports defined in this 6938 * A list containing specifications of all of the imports defined in this
6847 * library. 6939 * library.
6848 */ 6940 */
6849 List<ImportElement> _imports = ImportElement.EMPTY_ARRAY; 6941 List<ImportElement> _imports = ImportElement.EMPTY_LIST;
6850 6942
6851 /** 6943 /**
6852 * A list containing specifications of all of the exports defined in this 6944 * A list containing specifications of all of the exports defined in this
6853 * library. 6945 * library.
6854 */ 6946 */
6855 List<ExportElement> _exports = ExportElement.EMPTY_ARRAY; 6947 List<ExportElement> _exports = ExportElement.EMPTY_LIST;
6856 6948
6857 /** 6949 /**
6858 * A list containing all of the compilation units that are included in this 6950 * A list containing all of the compilation units that are included in this
6859 * library using a `part` directive. 6951 * library using a `part` directive.
6860 */ 6952 */
6861 List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY; 6953 List<CompilationUnitElement> _parts = CompilationUnitElement.EMPTY_LIST;
6862 6954
6863 /** 6955 /**
6864 * The element representing the synthetic function `loadLibrary` that is 6956 * The element representing the synthetic function `loadLibrary` that is
6865 * defined for this library, or `null` if the element has not yet been created . 6957 * defined for this library, or `null` if the element has not yet been created .
6866 */ 6958 */
6867 FunctionElement _loadLibraryFunction; 6959 FunctionElement _loadLibraryFunction;
6868 6960
6869 /** 6961 /**
6870 * The export [Namespace] of this library, `null` if it has not been 6962 * The export [Namespace] of this library, `null` if it has not been
6871 * computed yet. 6963 * computed yet.
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
7298 * potentially visible in multiple sources. 7390 * potentially visible in multiple sources.
7299 */ 7391 */
7300 SourceRange get visibleRange; 7392 SourceRange get visibleRange;
7301 } 7393 }
7302 7394
7303 /** 7395 /**
7304 * A local variable. 7396 * A local variable.
7305 */ 7397 */
7306 abstract class LocalVariableElement implements LocalElement, VariableElement { 7398 abstract class LocalVariableElement implements LocalElement, VariableElement {
7307 /** 7399 /**
7400 * An empty list of field elements.
7401 */
7402 static const List<LocalVariableElement> EMPTY_LIST =
7403 const <LocalVariableElement>[];
7404
7405 /**
7308 * Return the resolved [VariableDeclaration] node that declares this 7406 * Return the resolved [VariableDeclaration] node that declares this
7309 * [LocalVariableElement]. 7407 * [LocalVariableElement].
7310 * 7408 *
7311 * This method is expensive, because resolved AST might be evicted from cache, 7409 * This method is expensive, because resolved AST might be evicted from cache,
7312 * so parsing and resolving will be performed. 7410 * so parsing and resolving will be performed.
7313 */ 7411 */
7314 @override 7412 @override
7315 VariableDeclaration get node; 7413 VariableDeclaration get node;
7316 } 7414 }
7317 7415
7318 /** 7416 /**
7319 * A concrete implementation of a [LocalVariableElement]. 7417 * A concrete implementation of a [LocalVariableElement].
7320 */ 7418 */
7321 class LocalVariableElementImpl extends VariableElementImpl 7419 class LocalVariableElementImpl extends VariableElementImpl
7322 with PotentiallyConstVariableElement implements LocalVariableElement { 7420 with PotentiallyConstVariableElement implements LocalVariableElement {
7323 /** 7421 /**
7324 * An empty list of field elements. 7422 * An empty list of field elements.
7325 */ 7423 */
7424 @deprecated // Use LocalVariableElement.EMPTY_LIST
7326 static const List<LocalVariableElement> EMPTY_ARRAY = 7425 static const List<LocalVariableElement> EMPTY_ARRAY =
7327 const <LocalVariableElement>[]; 7426 const <LocalVariableElement>[];
7328 7427
7329 /** 7428 /**
7330 * The offset to the beginning of the visible range for this element. 7429 * The offset to the beginning of the visible range for this element.
7331 */ 7430 */
7332 int _visibleRangeOffset = 0; 7431 int _visibleRangeOffset = 0;
7333 7432
7334 /** 7433 /**
7335 * The length of the visible range for this element, or `-1` if this element 7434 * The length of the visible range for this element, or `-1` if this element
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
7563 void visitChildren(ElementVisitor visitor) { 7662 void visitChildren(ElementVisitor visitor) {
7564 // There are no children to visit 7663 // There are no children to visit
7565 } 7664 }
7566 } 7665 }
7567 7666
7568 /** 7667 /**
7569 * An element that represents a method defined within a type. 7668 * An element that represents a method defined within a type.
7570 */ 7669 */
7571 abstract class MethodElement implements ClassMemberElement, ExecutableElement { 7670 abstract class MethodElement implements ClassMemberElement, ExecutableElement {
7572 /** 7671 /**
7672 * An empty list of method elements.
7673 */
7674 static const List<MethodElement> EMPTY_LIST = const <MethodElement>[];
7675
7676 /**
7573 * Return the resolved [MethodDeclaration] node that declares this 7677 * Return the resolved [MethodDeclaration] node that declares this
7574 * [MethodElement]. 7678 * [MethodElement].
7575 * 7679 *
7576 * This method is expensive, because resolved AST might be evicted from cache, 7680 * This method is expensive, because resolved AST might be evicted from cache,
7577 * so parsing and resolving will be performed. 7681 * so parsing and resolving will be performed.
7578 */ 7682 */
7579 @override 7683 @override
7580 MethodDeclaration get node; 7684 MethodDeclaration get node;
7581 } 7685 }
7582 7686
7583 /** 7687 /**
7584 * A concrete implementation of a [MethodElement]. 7688 * A concrete implementation of a [MethodElement].
7585 */ 7689 */
7586 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { 7690 class MethodElementImpl extends ExecutableElementImpl implements MethodElement {
7587 /** 7691 /**
7588 * An empty list of method elements. 7692 * An empty list of method elements.
7589 */ 7693 */
7694 @deprecated // Use MethodElement.EMPTY_LIST
7590 static const List<MethodElement> EMPTY_ARRAY = const <MethodElement>[]; 7695 static const List<MethodElement> EMPTY_ARRAY = const <MethodElement>[];
7591 7696
7592 /** 7697 /**
7593 * Initialize a newly created method element to have the given [name] at the 7698 * Initialize a newly created method element to have the given [name] at the
7594 * given [offset]. 7699 * given [offset].
7595 */ 7700 */
7596 MethodElementImpl(String name, int offset) : super(name, offset); 7701 MethodElementImpl(String name, int offset) : super(name, offset);
7597 7702
7598 /** 7703 /**
7599 * Initialize a newly created method element to have the given [name]. 7704 * Initialize a newly created method element to have the given [name].
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
7967 @override 8072 @override
7968 ElementKind get kind => ElementKind.ERROR; 8073 ElementKind get kind => ElementKind.ERROR;
7969 8074
7970 @override 8075 @override
7971 LibraryElement get library => null; 8076 LibraryElement get library => null;
7972 8077
7973 @override 8078 @override
7974 ElementLocation get location => null; 8079 ElementLocation get location => null;
7975 8080
7976 @override 8081 @override
7977 List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY; 8082 List<ElementAnnotation> get metadata => ElementAnnotation.EMPTY_LIST;
7978 8083
7979 @override 8084 @override
7980 String get name => _name; 8085 String get name => _name;
7981 8086
7982 @override 8087 @override
7983 int get nameOffset => -1; 8088 int get nameOffset => -1;
7984 8089
7985 @override 8090 @override
7986 AstNode get node => null; 8091 AstNode get node => null;
7987 8092
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8104 /** 8209 /**
8105 * A [MethodElementImpl], with the additional information of a list of 8210 * A [MethodElementImpl], with the additional information of a list of
8106 * [ExecutableElement]s from which this element was composed. 8211 * [ExecutableElement]s from which this element was composed.
8107 */ 8212 */
8108 class MultiplyInheritedMethodElementImpl extends MethodElementImpl 8213 class MultiplyInheritedMethodElementImpl extends MethodElementImpl
8109 implements MultiplyInheritedExecutableElement { 8214 implements MultiplyInheritedExecutableElement {
8110 /** 8215 /**
8111 * A list the array of executable elements that were used to compose this 8216 * A list the array of executable elements that were used to compose this
8112 * element. 8217 * element.
8113 */ 8218 */
8114 List<ExecutableElement> _elements = MethodElementImpl.EMPTY_ARRAY; 8219 List<ExecutableElement> _elements = MethodElement.EMPTY_LIST;
8115 8220
8116 MultiplyInheritedMethodElementImpl(Identifier name) : super.forNode(name) { 8221 MultiplyInheritedMethodElementImpl(Identifier name) : super.forNode(name) {
8117 synthetic = true; 8222 synthetic = true;
8118 } 8223 }
8119 8224
8120 @override 8225 @override
8121 List<ExecutableElement> get inheritedElements => _elements; 8226 List<ExecutableElement> get inheritedElements => _elements;
8122 8227
8123 void set inheritedElements(List<ExecutableElement> elements) { 8228 void set inheritedElements(List<ExecutableElement> elements) {
8124 this._elements = elements; 8229 this._elements = elements;
8125 } 8230 }
8126 } 8231 }
8127 8232
8128 /** 8233 /**
8129 * A [PropertyAccessorElementImpl], with the additional information of a list of 8234 * A [PropertyAccessorElementImpl], with the additional information of a list of
8130 * [ExecutableElement]s from which this element was composed. 8235 * [ExecutableElement]s from which this element was composed.
8131 */ 8236 */
8132 class MultiplyInheritedPropertyAccessorElementImpl 8237 class MultiplyInheritedPropertyAccessorElementImpl
8133 extends PropertyAccessorElementImpl 8238 extends PropertyAccessorElementImpl
8134 implements MultiplyInheritedExecutableElement { 8239 implements MultiplyInheritedExecutableElement {
8135 /** 8240 /**
8136 * A list the array of executable elements that were used to compose this 8241 * A list the array of executable elements that were used to compose this
8137 * element. 8242 * element.
8138 */ 8243 */
8139 List<ExecutableElement> _elements = PropertyAccessorElementImpl.EMPTY_ARRAY; 8244 List<ExecutableElement> _elements = PropertyAccessorElement.EMPTY_LIST;
8140 8245
8141 MultiplyInheritedPropertyAccessorElementImpl(Identifier name) 8246 MultiplyInheritedPropertyAccessorElementImpl(Identifier name)
8142 : super.forNode(name) { 8247 : super.forNode(name) {
8143 synthetic = true; 8248 synthetic = true;
8144 } 8249 }
8145 8250
8146 @override 8251 @override
8147 List<ExecutableElement> get inheritedElements => _elements; 8252 List<ExecutableElement> get inheritedElements => _elements;
8148 8253
8149 void set inheritedElements(List<ExecutableElement> elements) { 8254 void set inheritedElements(List<ExecutableElement> elements) {
8150 this._elements = elements; 8255 this._elements = elements;
8151 } 8256 }
8152 } 8257 }
8153 8258
8154 /** 8259 /**
8155 * An object that controls how namespaces are combined. 8260 * An object that controls how namespaces are combined.
8156 */ 8261 */
8157 abstract class NamespaceCombinator { 8262 abstract class NamespaceCombinator {
8158 /** 8263 /**
8159 * An empty list of namespace combinators. 8264 * An empty list of namespace combinators.
8160 */ 8265 */
8266 @deprecated // Use NamespaceCombinator.EMPTY_LIST
8161 static const List<NamespaceCombinator> EMPTY_ARRAY = 8267 static const List<NamespaceCombinator> EMPTY_ARRAY =
8162 const <NamespaceCombinator>[]; 8268 const <NamespaceCombinator>[];
8269
8270 /**
8271 * An empty list of namespace combinators.
8272 */
8273 static const List<NamespaceCombinator> EMPTY_LIST =
8274 const <NamespaceCombinator>[];
8163 } 8275 }
8164 8276
8165 /** 8277 /**
8166 * A parameter defined within an executable element. 8278 * A parameter defined within an executable element.
8167 */ 8279 */
8168 abstract class ParameterElement implements LocalElement, VariableElement { 8280 abstract class ParameterElement implements LocalElement, VariableElement {
8169 /** 8281 /**
8282 * An empty list of parameter elements.
8283 */
8284 static const List<ParameterElement> EMPTY_LIST = const <ParameterElement>[];
8285
8286 /**
8170 * Return the Dart code of the default value, or `null` if no default value. 8287 * Return the Dart code of the default value, or `null` if no default value.
8171 */ 8288 */
8172 String get defaultValueCode; 8289 String get defaultValueCode;
8173 8290
8174 /** 8291 /**
8175 * Return `true` if this parameter is an initializing formal parameter. 8292 * Return `true` if this parameter is an initializing formal parameter.
8176 */ 8293 */
8177 bool get isInitializingFormal; 8294 bool get isInitializingFormal;
8178 8295
8179 @override 8296 @override
(...skipping 11 matching lines...) Expand all
8191 */ 8308 */
8192 List<ParameterElement> get parameters; 8309 List<ParameterElement> get parameters;
8193 } 8310 }
8194 8311
8195 /** 8312 /**
8196 * A concrete implementation of a [ParameterElement]. 8313 * A concrete implementation of a [ParameterElement].
8197 */ 8314 */
8198 class ParameterElementImpl extends VariableElementImpl 8315 class ParameterElementImpl extends VariableElementImpl
8199 implements ParameterElement { 8316 implements ParameterElement {
8200 /** 8317 /**
8201 * An empty list of field elements. 8318 * An empty list of parameter elements.
8202 */ 8319 */
8320 @deprecated // Use ParameterElement.EMPTY_LIST
8203 static const List<ParameterElement> EMPTY_ARRAY = const <ParameterElement>[]; 8321 static const List<ParameterElement> EMPTY_ARRAY = const <ParameterElement>[];
8204 8322
8205 /** 8323 /**
8206 * A list containing all of the parameters defined by this parameter element. 8324 * A list containing all of the parameters defined by this parameter element.
8207 * There will only be parameters if this parameter is a function typed 8325 * There will only be parameters if this parameter is a function typed
8208 * parameter. 8326 * parameter.
8209 */ 8327 */
8210 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; 8328 List<ParameterElement> _parameters = ParameterElement.EMPTY_LIST;
8211 8329
8212 /** 8330 /**
8213 * The kind of this parameter. 8331 * The kind of this parameter.
8214 */ 8332 */
8215 ParameterKind parameterKind; 8333 ParameterKind parameterKind;
8216 8334
8217 /** 8335 /**
8218 * The Dart code of the default value. 8336 * The Dart code of the default value.
8219 */ 8337 */
8220 String _defaultValueCode; 8338 String _defaultValueCode;
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
8541 * initializers. 8659 * initializers.
8542 */ 8660 */
8543 Expression get constantInitializer => null; 8661 Expression get constantInitializer => null;
8544 } 8662 }
8545 8663
8546 /** 8664 /**
8547 * A prefix used to import one or more libraries into another library. 8665 * A prefix used to import one or more libraries into another library.
8548 */ 8666 */
8549 abstract class PrefixElement implements Element { 8667 abstract class PrefixElement implements Element {
8550 /** 8668 /**
8669 * An empty list of prefix elements.
8670 */
8671 static const List<PrefixElement> EMPTY_LIST = const <PrefixElement>[];
8672
8673 /**
8551 * Return the library into which other libraries are imported using this 8674 * Return the library into which other libraries are imported using this
8552 * prefix. 8675 * prefix.
8553 */ 8676 */
8554 @override 8677 @override
8555 LibraryElement get enclosingElement; 8678 LibraryElement get enclosingElement;
8556 8679
8557 /** 8680 /**
8558 * Return a list containing all of the libraries that are imported using this 8681 * Return a list containing all of the libraries that are imported using this
8559 * prefix. 8682 * prefix.
8560 */ 8683 */
8561 List<LibraryElement> get importedLibraries; 8684 List<LibraryElement> get importedLibraries;
8562 } 8685 }
8563 8686
8564 /** 8687 /**
8565 * A concrete implementation of a [PrefixElement]. 8688 * A concrete implementation of a [PrefixElement].
8566 */ 8689 */
8567 class PrefixElementImpl extends ElementImpl implements PrefixElement { 8690 class PrefixElementImpl extends ElementImpl implements PrefixElement {
8568 /** 8691 /**
8569 * An empty list of prefix elements. 8692 * An empty list of prefix elements.
8570 */ 8693 */
8694 @deprecated // Use PrefixElement.EMPTY_LIST
8571 static const List<PrefixElement> EMPTY_ARRAY = const <PrefixElement>[]; 8695 static const List<PrefixElement> EMPTY_ARRAY = const <PrefixElement>[];
8572 8696
8573 /** 8697 /**
8574 * A list containing all of the libraries that are imported using this prefix. 8698 * A list containing all of the libraries that are imported using this prefix.
8575 */ 8699 */
8576 List<LibraryElement> _importedLibraries = LibraryElementImpl.EMPTY_ARRAY; 8700 List<LibraryElement> _importedLibraries = LibraryElement.EMPTY_LIST;
8577 8701
8578 /** 8702 /**
8579 * Initialize a newly created method element to have the given [name] and 8703 * Initialize a newly created method element to have the given [name] and
8580 * [offset]. 8704 * [offset].
8581 */ 8705 */
8582 PrefixElementImpl(String name, int nameOffset) : super(name, nameOffset); 8706 PrefixElementImpl(String name, int nameOffset) : super(name, nameOffset);
8583 8707
8584 /** 8708 /**
8585 * Initialize a newly created prefix element to have the given [name]. 8709 * Initialize a newly created prefix element to have the given [name].
8586 */ 8710 */
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
8628 * * Every explicit field is represented by a non-synthetic [FieldElement]. 8752 * * Every explicit field is represented by a non-synthetic [FieldElement].
8629 * * Every explicit field induces a getter and possibly a setter, both of which 8753 * * Every explicit field induces a getter and possibly a setter, both of which
8630 * are represented by synthetic [PropertyAccessorElement]s. 8754 * are represented by synthetic [PropertyAccessorElement]s.
8631 * * Every explicit getter or setter is represented by a non-synthetic 8755 * * Every explicit getter or setter is represented by a non-synthetic
8632 * [PropertyAccessorElement]. 8756 * [PropertyAccessorElement].
8633 * * Every explicit getter or setter (or pair thereof if they have the same 8757 * * Every explicit getter or setter (or pair thereof if they have the same
8634 * name) induces a field that is represented by a synthetic [FieldElement]. 8758 * name) induces a field that is represented by a synthetic [FieldElement].
8635 */ 8759 */
8636 abstract class PropertyAccessorElement implements ExecutableElement { 8760 abstract class PropertyAccessorElement implements ExecutableElement {
8637 /** 8761 /**
8762 * An empty list of property accessor elements.
8763 */
8764 static const List<PropertyAccessorElement> EMPTY_LIST =
8765 const <PropertyAccessorElement>[];
8766
8767 /**
8638 * Return the accessor representing the getter that corresponds to (has the 8768 * Return the accessor representing the getter that corresponds to (has the
8639 * same name as) this setter, or `null` if this accessor is not a setter or if 8769 * same name as) this setter, or `null` if this accessor is not a setter or if
8640 * there is no corresponding getter. 8770 * there is no corresponding getter.
8641 */ 8771 */
8642 PropertyAccessorElement get correspondingGetter; 8772 PropertyAccessorElement get correspondingGetter;
8643 8773
8644 /** 8774 /**
8645 * Return the accessor representing the setter that corresponds to (has the 8775 * Return the accessor representing the setter that corresponds to (has the
8646 * same name as) this getter, or `null` if this accessor is not a getter or if 8776 * same name as) this getter, or `null` if this accessor is not a getter or if
8647 * there is no corresponding setter. 8777 * there is no corresponding setter.
(...skipping 19 matching lines...) Expand all
8667 } 8797 }
8668 8798
8669 /** 8799 /**
8670 * A concrete implementation of a [PropertyAccessorElement]. 8800 * A concrete implementation of a [PropertyAccessorElement].
8671 */ 8801 */
8672 class PropertyAccessorElementImpl extends ExecutableElementImpl 8802 class PropertyAccessorElementImpl extends ExecutableElementImpl
8673 implements PropertyAccessorElement { 8803 implements PropertyAccessorElement {
8674 /** 8804 /**
8675 * An empty list of property accessor elements. 8805 * An empty list of property accessor elements.
8676 */ 8806 */
8807 @deprecated // Use PropertyAccessorElement.EMPTY_LIST
8677 static const List<PropertyAccessorElement> EMPTY_ARRAY = 8808 static const List<PropertyAccessorElement> EMPTY_ARRAY =
8678 const <PropertyAccessorElement>[]; 8809 const <PropertyAccessorElement>[];
8679 8810
8680 /** 8811 /**
8681 * The variable associated with this accessor. 8812 * The variable associated with this accessor.
8682 */ 8813 */
8683 PropertyInducingElement variable; 8814 PropertyInducingElement variable;
8684 8815
8685 /** 8816 /**
8686 * Initialize a newly created property accessor element to have the given 8817 * Initialize a newly created property accessor element to have the given
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
8957 * * Every explicit variable induces a getter and possibly a setter, both of 9088 * * Every explicit variable induces a getter and possibly a setter, both of
8958 * which are represented by synthetic [PropertyAccessorElement]s. 9089 * which are represented by synthetic [PropertyAccessorElement]s.
8959 * * Every explicit getter or setter is represented by a non-synthetic 9090 * * Every explicit getter or setter is represented by a non-synthetic
8960 * [PropertyAccessorElement]. 9091 * [PropertyAccessorElement].
8961 * * Every explicit getter or setter (or pair thereof if they have the same 9092 * * Every explicit getter or setter (or pair thereof if they have the same
8962 * name) induces a variable that is represented by a synthetic 9093 * name) induces a variable that is represented by a synthetic
8963 * [PropertyInducingElement]. 9094 * [PropertyInducingElement].
8964 */ 9095 */
8965 abstract class PropertyInducingElement implements VariableElement { 9096 abstract class PropertyInducingElement implements VariableElement {
8966 /** 9097 /**
9098 * An empty list of elements.
9099 */
9100 static const List<PropertyInducingElement> EMPTY_LIST =
9101 const <PropertyInducingElement>[];
9102
9103 /**
8967 * Return the getter associated with this variable. If this variable was 9104 * Return the getter associated with this variable. If this variable was
8968 * explicitly defined (is not synthetic) then the getter associated with it 9105 * explicitly defined (is not synthetic) then the getter associated with it
8969 * will be synthetic. 9106 * will be synthetic.
8970 */ 9107 */
8971 PropertyAccessorElement get getter; 9108 PropertyAccessorElement get getter;
8972 9109
8973 /** 9110 /**
8974 * Return `true` if this element is a static element. A static element is an 9111 * Return `true` if this element is a static element. A static element is an
8975 * element that is not associated with a particular instance, but rather with 9112 * element that is not associated with a particular instance, but rather with
8976 * an entire library or class. 9113 * an entire library or class.
(...skipping 19 matching lines...) Expand all
8996 } 9133 }
8997 9134
8998 /** 9135 /**
8999 * A concrete implementation of a [PropertyInducingElement]. 9136 * A concrete implementation of a [PropertyInducingElement].
9000 */ 9137 */
9001 abstract class PropertyInducingElementImpl extends VariableElementImpl 9138 abstract class PropertyInducingElementImpl extends VariableElementImpl
9002 implements PropertyInducingElement { 9139 implements PropertyInducingElement {
9003 /** 9140 /**
9004 * An empty list of elements. 9141 * An empty list of elements.
9005 */ 9142 */
9143 @deprecated // Use PropertyInducingElement.EMPTY_LIST
9006 static const List<PropertyInducingElement> EMPTY_ARRAY = 9144 static const List<PropertyInducingElement> EMPTY_ARRAY =
9007 const <PropertyInducingElement>[]; 9145 const <PropertyInducingElement>[];
9008 9146
9009 /** 9147 /**
9010 * The getter associated with this element. 9148 * The getter associated with this element.
9011 */ 9149 */
9012 PropertyAccessorElement getter; 9150 PropertyAccessorElement getter;
9013 9151
9014 /** 9152 /**
9015 * The setter associated with this element, or `null` if the element is 9153 * The setter associated with this element, or `null` if the element is
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
9312 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; 9450 R visitTopLevelVariableElement(TopLevelVariableElement element) => null;
9313 9451
9314 @override 9452 @override
9315 R visitTypeParameterElement(TypeParameterElement element) => null; 9453 R visitTypeParameterElement(TypeParameterElement element) => null;
9316 } 9454 }
9317 9455
9318 /** 9456 /**
9319 * A top-level variable. 9457 * A top-level variable.
9320 */ 9458 */
9321 abstract class TopLevelVariableElement implements PropertyInducingElement { 9459 abstract class TopLevelVariableElement implements PropertyInducingElement {
9460 /**
9461 * An empty list of top-level variable elements.
9462 */
9463 static const List<TopLevelVariableElement> EMPTY_LIST =
9464 const <TopLevelVariableElement>[];
9465
9322 @override 9466 @override
9323 VariableDeclaration get node; 9467 VariableDeclaration get node;
9324 } 9468 }
9325 9469
9326 /** 9470 /**
9327 * A concrete implementation of a [TopLevelVariableElement]. 9471 * A concrete implementation of a [TopLevelVariableElement].
9328 */ 9472 */
9329 class TopLevelVariableElementImpl extends PropertyInducingElementImpl 9473 class TopLevelVariableElementImpl extends PropertyInducingElementImpl
9330 with PotentiallyConstVariableElement implements TopLevelVariableElement { 9474 with PotentiallyConstVariableElement implements TopLevelVariableElement {
9331 /** 9475 /**
9332 * An empty list of top-level variable elements. 9476 * An empty list of top-level variable elements.
9333 */ 9477 */
9478 @deprecated // Use TopLevelVariableElement.EMPTY_LIST
9334 static const List<TopLevelVariableElement> EMPTY_ARRAY = 9479 static const List<TopLevelVariableElement> EMPTY_ARRAY =
9335 const <TopLevelVariableElement>[]; 9480 const <TopLevelVariableElement>[];
9336 9481
9337 /** 9482 /**
9338 * Initialize a newly created synthetic top-level variable element to have the 9483 * Initialize a newly created synthetic top-level variable element to have the
9339 * given [name] and [offset]. 9484 * given [name] and [offset].
9340 */ 9485 */
9341 TopLevelVariableElementImpl(String name, int offset) : super(name, offset); 9486 TopLevelVariableElementImpl(String name, int offset) : super(name, offset);
9342 9487
9343 /** 9488 /**
(...skipping 17 matching lines...) Expand all
9361 } 9506 }
9362 9507
9363 /** 9508 /**
9364 * The abstract class `TypeImpl` implements the behavior common to objects 9509 * The abstract class `TypeImpl` implements the behavior common to objects
9365 * representing the declared type of elements in the element model. 9510 * representing the declared type of elements in the element model.
9366 */ 9511 */
9367 abstract class TypeImpl implements DartType { 9512 abstract class TypeImpl implements DartType {
9368 /** 9513 /**
9369 * An empty list of types. 9514 * An empty list of types.
9370 */ 9515 */
9516 @deprecated // Use DartType.EMPTY_LIST
9371 static const List<DartType> EMPTY_ARRAY = const <DartType>[]; 9517 static const List<DartType> EMPTY_ARRAY = const <DartType>[];
9372 9518
9373 /** 9519 /**
9374 * The element representing the declaration of this type, or `null` if the 9520 * The element representing the declaration of this type, or `null` if the
9375 * type has not, or cannot, be associated with an element. 9521 * type has not, or cannot, be associated with an element.
9376 */ 9522 */
9377 final Element _element; 9523 final Element _element;
9378 9524
9379 /** 9525 /**
9380 * The name of this type, or `null` if the type does not have a name. 9526 * The name of this type, or `null` if the type does not have a name.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
9552 } 9698 }
9553 return newTypes; 9699 return newTypes;
9554 } 9700 }
9555 } 9701 }
9556 9702
9557 /** 9703 /**
9558 * A type parameter. 9704 * A type parameter.
9559 */ 9705 */
9560 abstract class TypeParameterElement implements Element { 9706 abstract class TypeParameterElement implements Element {
9561 /** 9707 /**
9708 * An empty list of type parameter elements.
9709 */
9710 static const List<TypeParameterElement> EMPTY_LIST =
9711 const <TypeParameterElement>[];
9712
9713 /**
9562 * Return the type representing the bound associated with this parameter, or 9714 * Return the type representing the bound associated with this parameter, or
9563 * `null` if this parameter does not have an explicit bound. 9715 * `null` if this parameter does not have an explicit bound.
9564 */ 9716 */
9565 DartType get bound; 9717 DartType get bound;
9566 9718
9567 /** 9719 /**
9568 * Return the type defined by this type parameter. 9720 * Return the type defined by this type parameter.
9569 */ 9721 */
9570 TypeParameterType get type; 9722 TypeParameterType get type;
9571 } 9723 }
9572 9724
9573 /** 9725 /**
9574 * A concrete implementation of a [TypeParameterElement]. 9726 * A concrete implementation of a [TypeParameterElement].
9575 */ 9727 */
9576 class TypeParameterElementImpl extends ElementImpl 9728 class TypeParameterElementImpl extends ElementImpl
9577 implements TypeParameterElement { 9729 implements TypeParameterElement {
9578 /** 9730 /**
9579 * An empty list of type parameter elements. 9731 * An empty list of type parameter elements.
9580 */ 9732 */
9733 @deprecated // Use TypeParameterElement.EMPTY_LIST
9581 static const List<TypeParameterElement> EMPTY_ARRAY = 9734 static const List<TypeParameterElement> EMPTY_ARRAY =
9582 const <TypeParameterElement>[]; 9735 const <TypeParameterElement>[];
9583 9736
9584 /** 9737 /**
9585 * The type defined by this type parameter. 9738 * The type defined by this type parameter.
9586 */ 9739 */
9587 TypeParameterType type; 9740 TypeParameterType type;
9588 9741
9589 /** 9742 /**
9590 * The type representing the bound associated with this parameter, or `null` 9743 * The type representing the bound associated with this parameter, or `null`
(...skipping 25 matching lines...) Expand all
9616 buffer.write(" extends "); 9769 buffer.write(" extends ");
9617 buffer.write(bound); 9770 buffer.write(bound);
9618 } 9771 }
9619 } 9772 }
9620 } 9773 }
9621 9774
9622 /** 9775 /**
9623 * The type introduced by a type parameter. 9776 * The type introduced by a type parameter.
9624 */ 9777 */
9625 abstract class TypeParameterType implements DartType { 9778 abstract class TypeParameterType implements DartType {
9779 /**
9780 * An empty list of type parameter types.
9781 */
9782 static const List<TypeParameterType> EMPTY_LIST = const <TypeParameterType>[];
9783
9626 @override 9784 @override
9627 TypeParameterElement get element; 9785 TypeParameterElement get element;
9628 } 9786 }
9629 9787
9630 /** 9788 /**
9631 * A concrete implementation of a [TypeParameterType]. 9789 * A concrete implementation of a [TypeParameterType].
9632 */ 9790 */
9633 class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType { 9791 class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType {
9634 /** 9792 /**
9635 * An empty list of type parameter types. 9793 * An empty list of type parameter types.
9636 */ 9794 */
9795 @deprecated // Use TypeParameterType.EMPTY_LIST
9637 static const List<TypeParameterType> EMPTY_ARRAY = 9796 static const List<TypeParameterType> EMPTY_ARRAY =
9638 const <TypeParameterType>[]; 9797 const <TypeParameterType>[];
9639 9798
9640 /** 9799 /**
9641 * Initialize a newly created type parameter type to be declared by the given 9800 * Initialize a newly created type parameter type to be declared by the given
9642 * [element] and to have the given name. 9801 * [element] and to have the given name.
9643 */ 9802 */
9644 TypeParameterTypeImpl(TypeParameterElement element) 9803 TypeParameterTypeImpl(TypeParameterElement element)
9645 : super(element, element.name); 9804 : super(element, element.name);
9646 9805
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
9735 } 9894 }
9736 9895
9737 /** 9896 /**
9738 * Return a list containing the type parameter types defined by the given 9897 * Return a list containing the type parameter types defined by the given
9739 * array of type parameter elements ([typeParameters]). 9898 * array of type parameter elements ([typeParameters]).
9740 */ 9899 */
9741 static List<TypeParameterType> getTypes( 9900 static List<TypeParameterType> getTypes(
9742 List<TypeParameterElement> typeParameters) { 9901 List<TypeParameterElement> typeParameters) {
9743 int count = typeParameters.length; 9902 int count = typeParameters.length;
9744 if (count == 0) { 9903 if (count == 0) {
9745 return EMPTY_ARRAY; 9904 return TypeParameterType.EMPTY_LIST;
9746 } 9905 }
9747 List<TypeParameterType> types = new List<TypeParameterType>(count); 9906 List<TypeParameterType> types = new List<TypeParameterType>(count);
9748 for (int i = 0; i < count; i++) { 9907 for (int i = 0; i < count; i++) {
9749 types[i] = typeParameters[i].type; 9908 types[i] = typeParameters[i].type;
9750 } 9909 }
9751 return types; 9910 return types;
9752 } 9911 }
9753 } 9912 }
9754 9913
9755 /** 9914 /**
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
9884 * [offset]. The offset may be `-1` if the element is synthetic. 10043 * [offset]. The offset may be `-1` if the element is synthetic.
9885 */ 10044 */
9886 UriReferencedElementImpl(String name, int offset) : super(name, offset); 10045 UriReferencedElementImpl(String name, int offset) : super(name, offset);
9887 } 10046 }
9888 10047
9889 /** 10048 /**
9890 * A variable. There are concrete subclasses for different kinds of variables. 10049 * A variable. There are concrete subclasses for different kinds of variables.
9891 */ 10050 */
9892 abstract class VariableElement implements Element { 10051 abstract class VariableElement implements Element {
9893 /** 10052 /**
10053 * An empty list of variable elements.
10054 */
10055 static const List<VariableElement> EMPTY_LIST = const <VariableElement>[];
10056
10057 /**
9894 * Return a synthetic function representing this variable's initializer, or 10058 * Return a synthetic function representing this variable's initializer, or
9895 * `null` if this variable does not have an initializer. The function will 10059 * `null` if this variable does not have an initializer. The function will
9896 * have no parameters. The return type of the function will be the 10060 * have no parameters. The return type of the function will be the
9897 * compile-time type of the initialization expression. 10061 * compile-time type of the initialization expression.
9898 */ 10062 */
9899 FunctionElement get initializer; 10063 FunctionElement get initializer;
9900 10064
9901 /** 10065 /**
9902 * Return `true` if this variable was declared with the 'const' modifier. 10066 * Return `true` if this variable was declared with the 'const' modifier.
9903 */ 10067 */
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
9935 } 10099 }
9936 10100
9937 /** 10101 /**
9938 * A concrete implementation of a [VariableElement]. 10102 * A concrete implementation of a [VariableElement].
9939 */ 10103 */
9940 abstract class VariableElementImpl extends ElementImpl 10104 abstract class VariableElementImpl extends ElementImpl
9941 implements VariableElement { 10105 implements VariableElement {
9942 /** 10106 /**
9943 * An empty list of variable elements. 10107 * An empty list of variable elements.
9944 */ 10108 */
10109 @deprecated // Use VariableElement.EMPTY_LIST
9945 static const List<VariableElement> EMPTY_ARRAY = const <VariableElement>[]; 10110 static const List<VariableElement> EMPTY_ARRAY = const <VariableElement>[];
9946 10111
9947 /** 10112 /**
9948 * The declared type of this variable. 10113 * The declared type of this variable.
9949 */ 10114 */
9950 DartType type; 10115 DartType type;
9951 10116
9952 /** 10117 /**
9953 * A synthetic function representing this variable's initializer, or `null` if 10118 * A synthetic function representing this variable's initializer, or `null` if
9954 * this variable does not have an initializer. 10119 * this variable does not have an initializer.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
10162 10327
10163 @override 10328 @override
10164 void visitElement(Element element) { 10329 void visitElement(Element element) {
10165 int offset = element.nameOffset; 10330 int offset = element.nameOffset;
10166 if (offset != -1) { 10331 if (offset != -1) {
10167 map[offset] = element; 10332 map[offset] = element;
10168 } 10333 }
10169 super.visitElement(element); 10334 super.visitElement(element);
10170 } 10335 }
10171 } 10336 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698