| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.element; | 3 library engine.element; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'source.dart'; | 7 import 'source.dart'; |
| 8 import 'scanner.dart' show Keyword; | 8 import 'scanner.dart' show Keyword; |
| 9 import 'ast.dart' show Identifier, LibraryIdentifier; | 9 import 'ast.dart' show Identifier, LibraryIdentifier; |
| 10 import 'sdk.dart' show DartSdk; | 10 import 'sdk.dart' show DartSdk; |
| 11 import 'html.dart' show XmlTagNode; | 11 import 'html.dart' show XmlTagNode; |
| 12 import 'engine.dart' show AnalysisContext; | 12 import 'engine.dart' show AnalysisContext; |
| 13 import 'constant.dart' show EvaluationResultImpl; | 13 import 'constant.dart' show EvaluationResultImpl; |
| 14 import 'utilities_dart.dart'; | 14 import 'utilities_dart.dart'; |
| 15 /** | 15 /** |
| 16 * The interface {@code Annotation} defines the behavior of objects representing
a single annotation | |
| 17 * associated with an element. | |
| 18 * @coverage dart.engine.element | |
| 19 */ | |
| 20 abstract class Annotation { | |
| 21 | |
| 22 /** | |
| 23 * Return the element representing the field, variable, or const constructor b
eing used as an | |
| 24 * annotation. | |
| 25 * @return the field, variable, or constructor being used as an annotation | |
| 26 */ | |
| 27 Element get element; | |
| 28 } | |
| 29 /** | |
| 30 * The interface {@code ClassElement} defines the behavior of elements that repr
esent a class. | 16 * The interface {@code ClassElement} defines the behavior of elements that repr
esent a class. |
| 31 * @coverage dart.engine.element | 17 * @coverage dart.engine.element |
| 32 */ | 18 */ |
| 33 abstract class ClassElement implements Element { | 19 abstract class ClassElement implements Element { |
| 34 | 20 |
| 35 /** | 21 /** |
| 36 * Return an array containing all of the accessors (getters and setters) decla
red in this class. | 22 * Return an array containing all of the accessors (getters and setters) decla
red in this class. |
| 37 * @return the accessors declared in this class | 23 * @return the accessors declared in this class |
| 38 */ | 24 */ |
| 39 List<PropertyAccessorElement> get accessors; | 25 List<PropertyAccessorElement> get accessors; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 */ | 237 */ |
| 252 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); | 238 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
); |
| 253 } | 239 } |
| 254 /** | 240 /** |
| 255 * The interface {@code ClassMemberElement} defines the behavior of elements tha
t are contained | 241 * The interface {@code ClassMemberElement} defines the behavior of elements tha
t are contained |
| 256 * within a {@link ClassElement}. | 242 * within a {@link ClassElement}. |
| 257 */ | 243 */ |
| 258 abstract class ClassMemberElement implements Element { | 244 abstract class ClassMemberElement implements Element { |
| 259 | 245 |
| 260 /** | 246 /** |
| 261 * Return the type in which this constructor is defined. | 247 * Return the type in which this member is defined. |
| 262 * @return the type in which this constructor is defined | 248 * @return the type in which this member is defined |
| 263 */ | 249 */ |
| 264 ClassElement get enclosingElement; | 250 ClassElement get enclosingElement; |
| 265 } | 251 } |
| 266 /** | 252 /** |
| 267 * The interface {@code CompilationUnitElement} defines the behavior of elements
representing a | 253 * The interface {@code CompilationUnitElement} defines the behavior of elements
representing a |
| 268 * compilation unit. | 254 * compilation unit. |
| 269 * @coverage dart.engine.element | 255 * @coverage dart.engine.element |
| 270 */ | 256 */ |
| 271 abstract class CompilationUnitElement implements Element, UriReferencedElement { | 257 abstract class CompilationUnitElement implements Element, UriReferencedElement { |
| 272 | 258 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 * Return an object representing the location of this element in the element m
odel. The object can | 420 * Return an object representing the location of this element in the element m
odel. The object can |
| 435 * be used to locate this element at a later time. | 421 * be used to locate this element at a later time. |
| 436 * @return the location of this element in the element model | 422 * @return the location of this element in the element model |
| 437 */ | 423 */ |
| 438 ElementLocation get location; | 424 ElementLocation get location; |
| 439 | 425 |
| 440 /** | 426 /** |
| 441 * Return an array containing all of the metadata associated with this element
. | 427 * Return an array containing all of the metadata associated with this element
. |
| 442 * @return the metadata associated with this element | 428 * @return the metadata associated with this element |
| 443 */ | 429 */ |
| 444 List<Annotation> get metadata; | 430 List<ElementAnnotation> get metadata; |
| 445 | 431 |
| 446 /** | 432 /** |
| 447 * Return the name of this element, or {@code null} if this element does not h
ave a name. | 433 * Return the name of this element, or {@code null} if this element does not h
ave a name. |
| 448 * @return the name of this element | 434 * @return the name of this element |
| 449 */ | 435 */ |
| 450 String get name; | 436 String get name; |
| 451 | 437 |
| 452 /** | 438 /** |
| 453 * Return the offset of the name of this element in the file that contains the
declaration of this | 439 * Return the offset of the name of this element in the file that contains the
declaration of this |
| 454 * element, or {@code -1} if this element is synthetic, does not have a name,
or otherwise does | 440 * element, or {@code -1} if this element is synthetic, does not have a name,
or otherwise does |
| (...skipping 28 matching lines...) Expand all Loading... |
| 483 bool isSynthetic(); | 469 bool isSynthetic(); |
| 484 | 470 |
| 485 /** | 471 /** |
| 486 * Use the given visitor to visit all of the children of this element. There i
s no guarantee of | 472 * Use the given visitor to visit all of the children of this element. There i
s no guarantee of |
| 487 * the order in which the children will be visited. | 473 * the order in which the children will be visited. |
| 488 * @param visitor the visitor that will be used to visit the children of this
element | 474 * @param visitor the visitor that will be used to visit the children of this
element |
| 489 */ | 475 */ |
| 490 void visitChildren(ElementVisitor<Object> visitor); | 476 void visitChildren(ElementVisitor<Object> visitor); |
| 491 } | 477 } |
| 492 /** | 478 /** |
| 479 * The interface {@code ElementAnnotation} defines the behavior of objects repre
senting a single |
| 480 * annotation associated with an element. |
| 481 * @coverage dart.engine.element |
| 482 */ |
| 483 abstract class ElementAnnotation { |
| 484 |
| 485 /** |
| 486 * Return the element representing the field, variable, or const constructor b
eing used as an |
| 487 * annotation. |
| 488 * @return the field, variable, or constructor being used as an annotation |
| 489 */ |
| 490 Element get element; |
| 491 } |
| 492 /** |
| 493 * The enumeration {@code ElementKind} defines the various kinds of elements in
the element model. | 493 * The enumeration {@code ElementKind} defines the various kinds of elements in
the element model. |
| 494 * @coverage dart.engine.element | 494 * @coverage dart.engine.element |
| 495 */ | 495 */ |
| 496 class ElementKind implements Comparable<ElementKind> { | 496 class ElementKind implements Comparable<ElementKind> { |
| 497 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); | 497 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); |
| 498 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT'
, 1, "compilation unit"); | 498 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT'
, 1, "compilation unit"); |
| 499 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons
tructor"); | 499 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons
tructor"); |
| 500 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); | 500 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); |
| 501 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML
_SCRIPT', 4, "embedded html script"); | 501 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML
_SCRIPT', 4, "embedded html script"); |
| 502 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); | 502 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombina
tor>(0); | 1012 static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombina
tor>(0); |
| 1013 } | 1013 } |
| 1014 /** | 1014 /** |
| 1015 * The interface {@code ParameterElement} defines the behavior of elements repre
senting a parameter | 1015 * The interface {@code ParameterElement} defines the behavior of elements repre
senting a parameter |
| 1016 * defined within an executable element. | 1016 * defined within an executable element. |
| 1017 * @coverage dart.engine.element | 1017 * @coverage dart.engine.element |
| 1018 */ | 1018 */ |
| 1019 abstract class ParameterElement implements LocalElement, VariableElement { | 1019 abstract class ParameterElement implements LocalElement, VariableElement { |
| 1020 | 1020 |
| 1021 /** | 1021 /** |
| 1022 * Return a source range that covers the portion of the source in which the de
fault value for this |
| 1023 * parameter is specified, or {@code null} if there is no default value. |
| 1024 * @return the range of characters in which the default value of this paramete
r is specified |
| 1025 */ |
| 1026 SourceRange get defaultValueRange; |
| 1027 |
| 1028 /** |
| 1022 * Return the kind of this parameter. | 1029 * Return the kind of this parameter. |
| 1023 * @return the kind of this parameter | 1030 * @return the kind of this parameter |
| 1024 */ | 1031 */ |
| 1025 ParameterKind get parameterKind; | 1032 ParameterKind get parameterKind; |
| 1026 | 1033 |
| 1027 /** | 1034 /** |
| 1028 * Return an array containing all of the parameters defined by this parameter.
A parameter will | 1035 * Return an array containing all of the parameters defined by this parameter.
A parameter will |
| 1029 * only define other parameters if it is a function typed parameter. | 1036 * only define other parameters if it is a function typed parameter. |
| 1030 * @return the parameters defined by this parameter element | 1037 * @return the parameters defined by this parameter element |
| 1031 */ | 1038 */ |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 R visitLocalVariableElement(LocalVariableElement element) => null; | 1481 R visitLocalVariableElement(LocalVariableElement element) => null; |
| 1475 R visitMethodElement(MethodElement element) => null; | 1482 R visitMethodElement(MethodElement element) => null; |
| 1476 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; | 1483 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; |
| 1477 R visitParameterElement(ParameterElement element) => null; | 1484 R visitParameterElement(ParameterElement element) => null; |
| 1478 R visitPrefixElement(PrefixElement element) => null; | 1485 R visitPrefixElement(PrefixElement element) => null; |
| 1479 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; | 1486 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; |
| 1480 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; | 1487 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; |
| 1481 R visitTypeVariableElement(TypeVariableElement element) => null; | 1488 R visitTypeVariableElement(TypeVariableElement element) => null; |
| 1482 } | 1489 } |
| 1483 /** | 1490 /** |
| 1484 * Instances of the class {@code AnnotationImpl} implement an {@link Annotation}
. | |
| 1485 * @coverage dart.engine.element | |
| 1486 */ | |
| 1487 class AnnotationImpl implements Annotation { | |
| 1488 | |
| 1489 /** | |
| 1490 * The element representing the field, variable, or constructor being used as
an annotation. | |
| 1491 */ | |
| 1492 Element _element; | |
| 1493 | |
| 1494 /** | |
| 1495 * An empty array of annotations. | |
| 1496 */ | |
| 1497 static List<AnnotationImpl> EMPTY_ARRAY = new List<AnnotationImpl>(0); | |
| 1498 | |
| 1499 /** | |
| 1500 * Initialize a newly created annotation. | |
| 1501 * @param element the element representing the field, variable, or constructor
being used as an | |
| 1502 * annotation | |
| 1503 */ | |
| 1504 AnnotationImpl(Element element) { | |
| 1505 this._element = element; | |
| 1506 } | |
| 1507 Element get element => _element; | |
| 1508 String toString() => "@${_element.toString()}"; | |
| 1509 } | |
| 1510 /** | |
| 1511 * Instances of the class {@code ClassElementImpl} implement a {@code ClassEleme
nt}. | 1491 * Instances of the class {@code ClassElementImpl} implement a {@code ClassEleme
nt}. |
| 1512 * @coverage dart.engine.element | 1492 * @coverage dart.engine.element |
| 1513 */ | 1493 */ |
| 1514 class ClassElementImpl extends ElementImpl implements ClassElement { | 1494 class ClassElementImpl extends ElementImpl implements ClassElement { |
| 1515 | 1495 |
| 1516 /** | 1496 /** |
| 1517 * An array containing all of the accessors (getters and setters) contained in
this class. | 1497 * An array containing all of the accessors (getters and setters) contained in
this class. |
| 1518 */ | 1498 */ |
| 1519 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; | 1499 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A
RRAY; |
| 1520 | 1500 |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2338 | 2318 |
| 2339 /** | 2319 /** |
| 2340 * Set the type defined by this element to the given type. | 2320 * Set the type defined by this element to the given type. |
| 2341 * @param type the type defined by this element | 2321 * @param type the type defined by this element |
| 2342 */ | 2322 */ |
| 2343 void set type(DynamicTypeImpl type2) { | 2323 void set type(DynamicTypeImpl type2) { |
| 2344 this._type = type2; | 2324 this._type = type2; |
| 2345 } | 2325 } |
| 2346 } | 2326 } |
| 2347 /** | 2327 /** |
| 2328 * Instances of the class {@code ElementAnnotationImpl} implement an {@link Elem
entAnnotation}. |
| 2329 * @coverage dart.engine.element |
| 2330 */ |
| 2331 class ElementAnnotationImpl implements ElementAnnotation { |
| 2332 |
| 2333 /** |
| 2334 * The element representing the field, variable, or constructor being used as
an annotation. |
| 2335 */ |
| 2336 Element _element; |
| 2337 |
| 2338 /** |
| 2339 * An empty array of annotations. |
| 2340 */ |
| 2341 static List<ElementAnnotationImpl> EMPTY_ARRAY = new List<ElementAnnotationImp
l>(0); |
| 2342 |
| 2343 /** |
| 2344 * Initialize a newly created annotation. |
| 2345 * @param element the element representing the field, variable, or constructor
being used as an |
| 2346 * annotation |
| 2347 */ |
| 2348 ElementAnnotationImpl(Element element) { |
| 2349 this._element = element; |
| 2350 } |
| 2351 Element get element => _element; |
| 2352 String toString() => "@${_element.toString()}"; |
| 2353 } |
| 2354 /** |
| 2348 * The abstract class {@code ElementImpl} implements the behavior common to obje
cts that implement | 2355 * The abstract class {@code ElementImpl} implements the behavior common to obje
cts that implement |
| 2349 * an {@link Element}. | 2356 * an {@link Element}. |
| 2350 * @coverage dart.engine.element | 2357 * @coverage dart.engine.element |
| 2351 */ | 2358 */ |
| 2352 abstract class ElementImpl implements Element { | 2359 abstract class ElementImpl implements Element { |
| 2353 | 2360 |
| 2354 /** | 2361 /** |
| 2355 * The enclosing element of this element, or {@code null} if this element is a
t the root of the | 2362 * The enclosing element of this element, or {@code null} if this element is a
t the root of the |
| 2356 * element structure. | 2363 * element structure. |
| 2357 */ | 2364 */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2369 int _nameOffset = 0; | 2376 int _nameOffset = 0; |
| 2370 | 2377 |
| 2371 /** | 2378 /** |
| 2372 * A bit-encoded form of the modifiers associated with this element. | 2379 * A bit-encoded form of the modifiers associated with this element. |
| 2373 */ | 2380 */ |
| 2374 Set<Modifier> _modifiers; | 2381 Set<Modifier> _modifiers; |
| 2375 | 2382 |
| 2376 /** | 2383 /** |
| 2377 * An array containing all of the metadata associated with this element. | 2384 * An array containing all of the metadata associated with this element. |
| 2378 */ | 2385 */ |
| 2379 List<Annotation> _metadata = AnnotationImpl.EMPTY_ARRAY; | 2386 List<ElementAnnotation> _metadata = ElementAnnotationImpl.EMPTY_ARRAY; |
| 2380 | 2387 |
| 2381 /** | 2388 /** |
| 2382 * A cached copy of the calculated hashCode for this element. | 2389 * A cached copy of the calculated hashCode for this element. |
| 2383 */ | 2390 */ |
| 2384 int _cachedHashCode = 0; | 2391 int _cachedHashCode = 0; |
| 2385 | 2392 |
| 2386 /** | 2393 /** |
| 2387 * Initialize a newly created element to have the given name. | 2394 * Initialize a newly created element to have the given name. |
| 2388 * @param name the name of this element | 2395 * @param name the name of this element |
| 2389 */ | 2396 */ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 AnalysisContext get context { | 2439 AnalysisContext get context { |
| 2433 if (_enclosingElement == null) { | 2440 if (_enclosingElement == null) { |
| 2434 return null; | 2441 return null; |
| 2435 } | 2442 } |
| 2436 return _enclosingElement.context; | 2443 return _enclosingElement.context; |
| 2437 } | 2444 } |
| 2438 String get displayName => _name; | 2445 String get displayName => _name; |
| 2439 Element get enclosingElement => _enclosingElement; | 2446 Element get enclosingElement => _enclosingElement; |
| 2440 LibraryElement get library => getAncestor(LibraryElement); | 2447 LibraryElement get library => getAncestor(LibraryElement); |
| 2441 ElementLocation get location => new ElementLocationImpl.con1(this); | 2448 ElementLocation get location => new ElementLocationImpl.con1(this); |
| 2442 List<Annotation> get metadata => _metadata; | 2449 List<ElementAnnotation> get metadata => _metadata; |
| 2443 String get name => _name; | 2450 String get name => _name; |
| 2444 int get nameOffset => _nameOffset; | 2451 int get nameOffset => _nameOffset; |
| 2445 Source get source { | 2452 Source get source { |
| 2446 if (_enclosingElement == null) { | 2453 if (_enclosingElement == null) { |
| 2447 return null; | 2454 return null; |
| 2448 } | 2455 } |
| 2449 return _enclosingElement.source; | 2456 return _enclosingElement.source; |
| 2450 } | 2457 } |
| 2451 int get hashCode { | 2458 int get hashCode { |
| 2452 if (_cachedHashCode == 0) { | 2459 if (_cachedHashCode == 0) { |
| 2453 _cachedHashCode = location.hashCode; | 2460 _cachedHashCode = location.hashCode; |
| 2454 } | 2461 } |
| 2455 return _cachedHashCode; | 2462 return _cachedHashCode; |
| 2456 } | 2463 } |
| 2457 bool isAccessibleIn(LibraryElement library2) { | 2464 bool isAccessibleIn(LibraryElement library2) { |
| 2458 if (Identifier.isPrivateName(_name)) { | 2465 if (Identifier.isPrivateName(_name)) { |
| 2459 return library2 == library; | 2466 return library2 == library; |
| 2460 } | 2467 } |
| 2461 return true; | 2468 return true; |
| 2462 } | 2469 } |
| 2463 bool isSynthetic() => hasModifier(Modifier.SYNTHETIC); | 2470 bool isSynthetic() => hasModifier(Modifier.SYNTHETIC); |
| 2464 | 2471 |
| 2465 /** | 2472 /** |
| 2466 * Set the metadata associate with this element to the given array of annotati
ons. | 2473 * Set the metadata associate with this element to the given array of annotati
ons. |
| 2467 * @param metadata the metadata to be associated with this element | 2474 * @param metadata the metadata to be associated with this element |
| 2468 */ | 2475 */ |
| 2469 void set metadata(List<Annotation> metadata2) { | 2476 void set metadata(List<ElementAnnotation> metadata2) { |
| 2470 this._metadata = metadata2; | 2477 this._metadata = metadata2; |
| 2471 } | 2478 } |
| 2472 | 2479 |
| 2473 /** | 2480 /** |
| 2474 * Set the offset of the name of this element in the file that contains the de
claration of this | 2481 * Set the offset of the name of this element in the file that contains the de
claration of this |
| 2475 * element to the given value. This is normally done via the constructor, but
this method is | 2482 * element to the given value. This is normally done via the constructor, but
this method is |
| 2476 * provided to support unnamed constructors. | 2483 * provided to support unnamed constructors. |
| 2477 * @param nameOffset the offset to the beginning of the name | 2484 * @param nameOffset the offset to the beginning of the name |
| 2478 */ | 2485 */ |
| 2479 void set nameOffset(int nameOffset2) { | 2486 void set nameOffset(int nameOffset2) { |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3965 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); | 3972 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); |
| 3966 String computeDocumentationComment() => null; | 3973 String computeDocumentationComment() => null; |
| 3967 Element getAncestor(Type elementClass) => null; | 3974 Element getAncestor(Type elementClass) => null; |
| 3968 List<Element> get conflictingElements => _conflictingElements; | 3975 List<Element> get conflictingElements => _conflictingElements; |
| 3969 AnalysisContext get context => _context; | 3976 AnalysisContext get context => _context; |
| 3970 String get displayName => _name; | 3977 String get displayName => _name; |
| 3971 Element get enclosingElement => null; | 3978 Element get enclosingElement => null; |
| 3972 ElementKind get kind => ElementKind.ERROR; | 3979 ElementKind get kind => ElementKind.ERROR; |
| 3973 LibraryElement get library => null; | 3980 LibraryElement get library => null; |
| 3974 ElementLocation get location => null; | 3981 ElementLocation get location => null; |
| 3975 List<Annotation> get metadata => AnnotationImpl.EMPTY_ARRAY; | 3982 List<ElementAnnotation> get metadata => ElementAnnotationImpl.EMPTY_ARRAY; |
| 3976 String get name => _name; | 3983 String get name => _name; |
| 3977 int get nameOffset => -1; | 3984 int get nameOffset => -1; |
| 3978 Source get source => null; | 3985 Source get source => null; |
| 3979 bool isAccessibleIn(LibraryElement library) { | 3986 bool isAccessibleIn(LibraryElement library) { |
| 3980 for (Element element in _conflictingElements) { | 3987 for (Element element in _conflictingElements) { |
| 3981 if (element.isAccessibleIn(library)) { | 3988 if (element.isAccessibleIn(library)) { |
| 3982 return true; | 3989 return true; |
| 3983 } | 3990 } |
| 3984 } | 3991 } |
| 3985 return false; | 3992 return false; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4043 * parameters if this parameter is a function typed parameter. | 4050 * parameters if this parameter is a function typed parameter. |
| 4044 */ | 4051 */ |
| 4045 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; | 4052 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY; |
| 4046 | 4053 |
| 4047 /** | 4054 /** |
| 4048 * The kind of this parameter. | 4055 * The kind of this parameter. |
| 4049 */ | 4056 */ |
| 4050 ParameterKind _parameterKind; | 4057 ParameterKind _parameterKind; |
| 4051 | 4058 |
| 4052 /** | 4059 /** |
| 4060 * The offset to the beginning of the default value range for this element. |
| 4061 */ |
| 4062 int _defaultValueRangeOffset = 0; |
| 4063 |
| 4064 /** |
| 4065 * The length of the default value range for this element, or {@code -1} if th
is element does not |
| 4066 * have a default value. |
| 4067 */ |
| 4068 int _defaultValueRangeLength = -1; |
| 4069 |
| 4070 /** |
| 4053 * The offset to the beginning of the visible range for this element. | 4071 * The offset to the beginning of the visible range for this element. |
| 4054 */ | 4072 */ |
| 4055 int _visibleRangeOffset = 0; | 4073 int _visibleRangeOffset = 0; |
| 4056 | 4074 |
| 4057 /** | 4075 /** |
| 4058 * The length of the visible range for this element, or {@code -1} if this ele
ment does not have a | 4076 * The length of the visible range for this element, or {@code -1} if this ele
ment does not have a |
| 4059 * visible range. | 4077 * visible range. |
| 4060 */ | 4078 */ |
| 4061 int _visibleRangeLength = -1; | 4079 int _visibleRangeLength = -1; |
| 4062 | 4080 |
| 4063 /** | 4081 /** |
| 4064 * An empty array of field elements. | 4082 * An empty array of field elements. |
| 4065 */ | 4083 */ |
| 4066 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0); | 4084 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0); |
| 4067 | 4085 |
| 4068 /** | 4086 /** |
| 4069 * Initialize a newly created parameter element to have the given name. | 4087 * Initialize a newly created parameter element to have the given name. |
| 4070 * @param name the name of this element | 4088 * @param name the name of this element |
| 4071 */ | 4089 */ |
| 4072 ParameterElementImpl(Identifier name) : super.con1(name) { | 4090 ParameterElementImpl(Identifier name) : super.con1(name) { |
| 4073 } | 4091 } |
| 4074 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); | 4092 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); |
| 4093 SourceRange get defaultValueRange { |
| 4094 if (_defaultValueRangeLength < 0) { |
| 4095 return null; |
| 4096 } |
| 4097 return new SourceRange(_defaultValueRangeOffset, _defaultValueRangeLength); |
| 4098 } |
| 4075 ElementKind get kind => ElementKind.PARAMETER; | 4099 ElementKind get kind => ElementKind.PARAMETER; |
| 4076 ParameterKind get parameterKind => _parameterKind; | 4100 ParameterKind get parameterKind => _parameterKind; |
| 4077 List<ParameterElement> get parameters => _parameters; | 4101 List<ParameterElement> get parameters => _parameters; |
| 4078 SourceRange get visibleRange { | 4102 SourceRange get visibleRange { |
| 4079 if (_visibleRangeLength < 0) { | 4103 if (_visibleRangeLength < 0) { |
| 4080 return null; | 4104 return null; |
| 4081 } | 4105 } |
| 4082 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); | 4106 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); |
| 4083 } | 4107 } |
| 4084 bool isInitializingFormal() => false; | 4108 bool isInitializingFormal() => false; |
| 4085 | 4109 |
| 4086 /** | 4110 /** |
| 4111 * Set the range of the default value for this parameter to the range starting
at the given offset |
| 4112 * with the given length. |
| 4113 * @param offset the offset to the beginning of the default value range for th
is element |
| 4114 * @param length the length of the default value range for this element, or {@
code -1} if this |
| 4115 * element does not have a default value |
| 4116 */ |
| 4117 void setDefaultValueRange(int offset, int length) { |
| 4118 _defaultValueRangeOffset = offset; |
| 4119 _defaultValueRangeLength = length; |
| 4120 } |
| 4121 |
| 4122 /** |
| 4087 * Set the kind of this parameter to the given kind. | 4123 * Set the kind of this parameter to the given kind. |
| 4088 * @param parameterKind the new kind of this parameter | 4124 * @param parameterKind the new kind of this parameter |
| 4089 */ | 4125 */ |
| 4090 void set parameterKind(ParameterKind parameterKind2) { | 4126 void set parameterKind(ParameterKind parameterKind2) { |
| 4091 this._parameterKind = parameterKind2; | 4127 this._parameterKind = parameterKind2; |
| 4092 } | 4128 } |
| 4093 | 4129 |
| 4094 /** | 4130 /** |
| 4095 * Set the parameters defined by this executable element to the given paramete
rs. | 4131 * Set the parameters defined by this executable element to the given paramete
rs. |
| 4096 * @param parameters the parameters defined by this executable element | 4132 * @param parameters the parameters defined by this executable element |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4783 /** | 4819 /** |
| 4784 * Return the element on which the parameterized element was created. | 4820 * Return the element on which the parameterized element was created. |
| 4785 * @return the element on which the parameterized element was created | 4821 * @return the element on which the parameterized element was created |
| 4786 */ | 4822 */ |
| 4787 Element get baseElement => _baseElement; | 4823 Element get baseElement => _baseElement; |
| 4788 AnalysisContext get context => _baseElement.context; | 4824 AnalysisContext get context => _baseElement.context; |
| 4789 String get displayName => _baseElement.displayName; | 4825 String get displayName => _baseElement.displayName; |
| 4790 ElementKind get kind => _baseElement.kind; | 4826 ElementKind get kind => _baseElement.kind; |
| 4791 LibraryElement get library => _baseElement.library; | 4827 LibraryElement get library => _baseElement.library; |
| 4792 ElementLocation get location => _baseElement.location; | 4828 ElementLocation get location => _baseElement.location; |
| 4793 List<Annotation> get metadata => _baseElement.metadata; | 4829 List<ElementAnnotation> get metadata => _baseElement.metadata; |
| 4794 String get name => _baseElement.name; | 4830 String get name => _baseElement.name; |
| 4795 int get nameOffset => _baseElement.nameOffset; | 4831 int get nameOffset => _baseElement.nameOffset; |
| 4796 Source get source => _baseElement.source; | 4832 Source get source => _baseElement.source; |
| 4797 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); | 4833 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib
rary); |
| 4798 bool isSynthetic() => _baseElement.isSynthetic(); | 4834 bool isSynthetic() => _baseElement.isSynthetic(); |
| 4799 void visitChildren(ElementVisitor<Object> visitor) { | 4835 void visitChildren(ElementVisitor<Object> visitor) { |
| 4800 } | 4836 } |
| 4801 | 4837 |
| 4802 /** | 4838 /** |
| 4803 * Return the type in which the element is defined. | 4839 * Return the type in which the element is defined. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4968 return ConstructorMember.from((element as ConstructorElement), definingI
nterfaceType) as Element; | 5004 return ConstructorMember.from((element as ConstructorElement), definingI
nterfaceType) as Element; |
| 4969 } else if (element is MethodElement) { | 5005 } else if (element is MethodElement) { |
| 4970 return MethodMember.from((element as MethodElement), definingInterfaceTy
pe) as Element; | 5006 return MethodMember.from((element as MethodElement), definingInterfaceTy
pe) as Element; |
| 4971 } else if (element is PropertyAccessorElement) { | 5007 } else if (element is PropertyAccessorElement) { |
| 4972 return PropertyAccessorMember.from((element as PropertyAccessorElement),
definingInterfaceType) as Element; | 5008 return PropertyAccessorMember.from((element as PropertyAccessorElement),
definingInterfaceType) as Element; |
| 4973 } | 5009 } |
| 4974 } | 5010 } |
| 4975 return element; | 5011 return element; |
| 4976 } | 5012 } |
| 4977 ParameterElement get baseElement => super.baseElement as ParameterElement; | 5013 ParameterElement get baseElement => super.baseElement as ParameterElement; |
| 5014 SourceRange get defaultValueRange => baseElement.defaultValueRange; |
| 4978 Element get enclosingElement => baseElement.enclosingElement; | 5015 Element get enclosingElement => baseElement.enclosingElement; |
| 4979 ParameterKind get parameterKind => baseElement.parameterKind; | 5016 ParameterKind get parameterKind => baseElement.parameterKind; |
| 4980 List<ParameterElement> get parameters { | 5017 List<ParameterElement> get parameters { |
| 4981 List<ParameterElement> baseParameters = baseElement.parameters; | 5018 List<ParameterElement> baseParameters = baseElement.parameters; |
| 4982 int parameterCount = baseParameters.length; | 5019 int parameterCount = baseParameters.length; |
| 4983 if (parameterCount == 0) { | 5020 if (parameterCount == 0) { |
| 4984 return baseParameters; | 5021 return baseParameters; |
| 4985 } | 5022 } |
| 4986 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 5023 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
| 4987 for (int i = 0; i < parameterCount; i++) { | 5024 for (int i = 0; i < parameterCount; i++) { |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5897 } | 5934 } |
| 5898 bool isMoreSpecificThan(Type2 type) { | 5935 bool isMoreSpecificThan(Type2 type) { |
| 5899 if (identical(type, DynamicTypeImpl.instance)) { | 5936 if (identical(type, DynamicTypeImpl.instance)) { |
| 5900 return true; | 5937 return true; |
| 5901 } else if (type is! InterfaceType) { | 5938 } else if (type is! InterfaceType) { |
| 5902 return false; | 5939 return false; |
| 5903 } | 5940 } |
| 5904 return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>())
; | 5941 return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>())
; |
| 5905 } | 5942 } |
| 5906 bool isObject() => element.supertype == null; | 5943 bool isObject() => element.supertype == null; |
| 5907 bool isSubtypeOf(Type2 type) { | 5944 bool isSubtypeOf(Type2 type2) { |
| 5908 if (identical(type, DynamicTypeImpl.instance)) { | 5945 if (identical(type2, DynamicTypeImpl.instance)) { |
| 5909 return true; | 5946 return true; |
| 5910 } else if (type is TypeVariableType) { | 5947 } else if (type2 is TypeVariableType) { |
| 5911 return true; | 5948 return true; |
| 5912 } else if (type is! InterfaceType) { | 5949 } else if (type2 is FunctionType) { |
| 5950 ClassElement element = this.element; |
| 5951 MethodElement callMethod = element.lookUpMethod("call", element.library); |
| 5952 if (callMethod != null) { |
| 5953 return callMethod.type.isSubtypeOf(type2); |
| 5954 } |
| 5913 return false; | 5955 return false; |
| 5914 } else if (this == type) { | 5956 } else if (type2 is! InterfaceType) { |
| 5957 return false; |
| 5958 } else if (this == type2) { |
| 5915 return true; | 5959 return true; |
| 5916 } | 5960 } |
| 5917 return isSubtypeOf2((type as InterfaceType), new Set<ClassElement>()); | 5961 return isSubtypeOf2((type2 as InterfaceType), new Set<ClassElement>()); |
| 5918 } | 5962 } |
| 5919 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary) { | 5963 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li
brary) { |
| 5920 ConstructorElement constructorElement; | 5964 ConstructorElement constructorElement; |
| 5921 if (constructorName == null) { | 5965 if (constructorName == null) { |
| 5922 constructorElement = element.unnamedConstructor; | 5966 constructorElement = element.unnamedConstructor; |
| 5923 } else { | 5967 } else { |
| 5924 constructorElement = element.getNamedConstructor(constructorName); | 5968 constructorElement = element.getNamedConstructor(constructorName); |
| 5925 } | 5969 } |
| 5926 if (constructorElement == null || !constructorElement.isAccessibleIn(library
)) { | 5970 if (constructorElement == null || !constructorElement.isAccessibleIn(library
)) { |
| 5927 return null; | 5971 return null; |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6843 abstract class TypeVariableType implements Type2 { | 6887 abstract class TypeVariableType implements Type2 { |
| 6844 TypeVariableElement get element; | 6888 TypeVariableElement get element; |
| 6845 } | 6889 } |
| 6846 /** | 6890 /** |
| 6847 * The interface {@code VoidType} defines the behavior of the unique object repr
esenting the type{@code void}. | 6891 * The interface {@code VoidType} defines the behavior of the unique object repr
esenting the type{@code void}. |
| 6848 * @coverage dart.engine.type | 6892 * @coverage dart.engine.type |
| 6849 */ | 6893 */ |
| 6850 abstract class VoidType implements Type2 { | 6894 abstract class VoidType implements Type2 { |
| 6851 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 6895 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
| 6852 } | 6896 } |
| OLD | NEW |