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

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

Issue 14308011: New Analysis Engine snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
OLDNEW
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 3
4 library engine.element; 4 library engine.element;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'scanner.dart' show Keyword; 10 import 'scanner.dart' show Keyword;
11 import 'ast.dart' show Identifier, LibraryIdentifier; 11 import 'ast.dart' show Identifier, LibraryIdentifier;
12 import 'sdk.dart' show DartSdk;
12 import 'html.dart' show XmlTagNode; 13 import 'html.dart' show XmlTagNode;
13 import 'engine.dart' show AnalysisContext; 14 import 'engine.dart' show AnalysisContext;
14 import 'constant.dart' show EvaluationResultImpl; 15 import 'constant.dart' show EvaluationResultImpl;
15 import 'utilities_dart.dart'; 16 import 'utilities_dart.dart';
16 17
17 /** 18 /**
18 * The interface {@code Annotation} defines the behavior of objects representing a single annotation 19 * The interface {@code Annotation} defines the behavior of objects representing a single annotation
19 * associated with an element. 20 * associated with an element.
20 * @coverage dart.engine.element 21 * @coverage dart.engine.element
21 */ 22 */
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 * Return the library in which this compilation unit is defined. 198 * Return the library in which this compilation unit is defined.
198 * @return the library in which this compilation unit is defined 199 * @return the library in which this compilation unit is defined
199 */ 200 */
200 LibraryElement get enclosingElement; 201 LibraryElement get enclosingElement;
201 /** 202 /**
202 * Return an array containing all of the top-level functions contained in this compilation unit. 203 * Return an array containing all of the top-level functions contained in this compilation unit.
203 * @return the top-level functions contained in this compilation unit 204 * @return the top-level functions contained in this compilation unit
204 */ 205 */
205 List<FunctionElement> get functions; 206 List<FunctionElement> get functions;
206 /** 207 /**
208 * Return an array containing all of the function type aliases contained in th is compilation unit.
209 * @return the function type aliases contained in this compilation unit
210 */
211 List<FunctionTypeAliasElement> get functionTypeAliases;
212 /**
207 * Return an array containing all of the top-level variables contained in this compilation unit. 213 * Return an array containing all of the top-level variables contained in this compilation unit.
208 * @return the top-level variables contained in this compilation unit 214 * @return the top-level variables contained in this compilation unit
209 */ 215 */
210 List<TopLevelVariableElement> get topLevelVariables; 216 List<TopLevelVariableElement> get topLevelVariables;
211 /** 217 /**
212 * Return an array containing all of the function type aliases contained in th is compilation unit. 218 * Return the class defined in this compilation unit that has the given name, or {@code null} if
213 * @return the function type aliases contained in this compilation unit 219 * this compilation unit does not define a class with the given name.
220 * @param className the name of the class to be returned
221 * @return the class with the given name that is defined in this compilation u nit
214 */ 222 */
215 List<FunctionTypeAliasElement> get functionTypeAliases; 223 ClassElement getType(String className);
216 /** 224 /**
217 * Return an array containing all of the classes contained in this compilation unit. 225 * Return an array containing all of the classes contained in this compilation unit.
218 * @return the classes contained in this compilation unit 226 * @return the classes contained in this compilation unit
219 */ 227 */
220 List<ClassElement> get types; 228 List<ClassElement> get types;
221 } 229 }
222 /** 230 /**
223 * The interface {@code ConstructorElement} defines the behavior of elements rep resenting a 231 * The interface {@code ConstructorElement} defines the behavior of elements rep resenting a
224 * constructor or a factory method defined within a type. 232 * constructor or a factory method defined within a type.
225 * @coverage dart.engine.element 233 * @coverage dart.engine.element
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 * model. 298 * model.
291 * @return the element that encloses this element 299 * @return the element that encloses this element
292 */ 300 */
293 Element get enclosingElement; 301 Element get enclosingElement;
294 /** 302 /**
295 * Return the kind of element that this is. 303 * Return the kind of element that this is.
296 * @return the kind of this element 304 * @return the kind of this element
297 */ 305 */
298 ElementKind get kind; 306 ElementKind get kind;
299 /** 307 /**
300 * Return the library that contains this element. This will be {@code null} if this element is a 308 * Return the library that contains this element. This will be the element its elf if it is a
301 * library or HTML file because libraries and HTML files are not contained in other libraries. 309 * library element. This will be {@code null} if this element is an HTML file because HTML files
310 * are not contained in libraries.
302 * @return the library that contains this element 311 * @return the library that contains this element
303 */ 312 */
304 LibraryElement get library; 313 LibraryElement get library;
305 /** 314 /**
306 * Return an object representing the location of this element in the element m odel. The object can 315 * Return an object representing the location of this element in the element m odel. The object can
307 * be used to locate this element at a later time. 316 * be used to locate this element at a later time.
308 * @return the location of this element in the element model 317 * @return the location of this element in the element model
309 */ 318 */
310 ElementLocation get location; 319 ElementLocation get location;
311 /** 320 /**
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 * Use the given visitor to visit all of the children of this element. There i s no guarantee of 360 * Use the given visitor to visit all of the children of this element. There i s no guarantee of
352 * the order in which the children will be visited. 361 * the order in which the children will be visited.
353 * @param visitor the visitor that will be used to visit the children of this element 362 * @param visitor the visitor that will be used to visit the children of this element
354 */ 363 */
355 void visitChildren(ElementVisitor<Object> visitor); 364 void visitChildren(ElementVisitor<Object> visitor);
356 } 365 }
357 /** 366 /**
358 * The enumeration {@code ElementKind} defines the various kinds of elements in the element model. 367 * The enumeration {@code ElementKind} defines the various kinds of elements in the element model.
359 * @coverage dart.engine.element 368 * @coverage dart.engine.element
360 */ 369 */
361 class ElementKind { 370 class ElementKind implements Comparable<ElementKind> {
362 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); 371 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class");
363 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT' , 1, "compilation unit"); 372 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT' , 1, "compilation unit");
364 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons tructor"); 373 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons tructor");
365 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); 374 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>");
366 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML _SCRIPT', 4, "embedded html script"); 375 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML _SCRIPT', 4, "embedded html script");
367 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); 376 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>");
368 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi ve"); 377 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi ve");
369 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML _SCRIPT', 7, "external html script"); 378 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML _SCRIPT', 7, "external html script");
370 static final ElementKind FIELD = new ElementKind('FIELD', 8, "field"); 379 static final ElementKind FIELD = new ElementKind('FIELD', 8, "field");
371 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 9, "function") ; 380 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 9, "function") ;
(...skipping 17 matching lines...) Expand all
389 final int __ordinal; 398 final int __ordinal;
390 int get ordinal => __ordinal; 399 int get ordinal => __ordinal;
391 String _displayName; 400 String _displayName;
392 ElementKind(this.__name, this.__ordinal, String displayName) { 401 ElementKind(this.__name, this.__ordinal, String displayName) {
393 this._displayName = displayName; 402 this._displayName = displayName;
394 } 403 }
395 /** 404 /**
396 * @return the name of this {@link ElementKind} to display in UI. 405 * @return the name of this {@link ElementKind} to display in UI.
397 */ 406 */
398 String get displayName => _displayName; 407 String get displayName => _displayName;
408 int compareTo(ElementKind other) => __ordinal - other.__ordinal;
399 String toString() => __name; 409 String toString() => __name;
400 } 410 }
401 /** 411 /**
402 * The interface {@code ElementLocation} defines the behavior of objects that re present the location 412 * The interface {@code ElementLocation} defines the behavior of objects that re present the location
403 * of an element within the element model. 413 * of an element within the element model.
404 * @coverage dart.engine.element 414 * @coverage dart.engine.element
405 */ 415 */
406 abstract class ElementLocation { 416 abstract class ElementLocation {
407 /** 417 /**
408 * Return an encoded representation of this location that can be used to creat e a location that is 418 * Return an encoded representation of this location that can be used to creat e a location that is
409 * equal to this location. 419 * equal to this location.
410 * @return an encoded representation of this location 420 * @return an encoded representation of this location
411 */ 421 */
412 String get encoding; 422 String get encoding;
413 } 423 }
414 /** 424 /**
415 * The interface {@code ElementVisitor} defines the behavior of objects that can be used to visit an 425 * The interface {@code ElementVisitor} defines the behavior of objects that can be used to visit an
416 * element structure. 426 * element structure.
417 * @coverage dart.engine.element 427 * @coverage dart.engine.element
418 */ 428 */
419 abstract class ElementVisitor<R> { 429 abstract class ElementVisitor<R> {
420 R visitClassElement(ClassElement element); 430 R visitClassElement(ClassElement element);
421 R visitCompilationUnitElement(CompilationUnitElement element); 431 R visitCompilationUnitElement(CompilationUnitElement element);
422 R visitConstructorElement(ConstructorElement element); 432 R visitConstructorElement(ConstructorElement element);
423 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element); 433 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element);
424 R visitExportElement(ExportElement element); 434 R visitExportElement(ExportElement element);
425 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element); 435 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element);
426 R visitFieldElement(FieldElement element); 436 R visitFieldElement(FieldElement element);
437 R visitFieldFormalParameterElement(FieldFormalParameterElement element);
427 R visitFunctionElement(FunctionElement element); 438 R visitFunctionElement(FunctionElement element);
439 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
428 R visitHtmlElement(HtmlElement element); 440 R visitHtmlElement(HtmlElement element);
429 R visitImportElement(ImportElement element); 441 R visitImportElement(ImportElement element);
430 R visitLabelElement(LabelElement element); 442 R visitLabelElement(LabelElement element);
431 R visitLibraryElement(LibraryElement element); 443 R visitLibraryElement(LibraryElement element);
432 R visitLocalVariableElement(LocalVariableElement element); 444 R visitLocalVariableElement(LocalVariableElement element);
433 R visitMethodElement(MethodElement element); 445 R visitMethodElement(MethodElement element);
434 R visitMultiplyDefinedElement(MultiplyDefinedElement element); 446 R visitMultiplyDefinedElement(MultiplyDefinedElement element);
435 R visitParameterElement(ParameterElement element); 447 R visitParameterElement(ParameterElement element);
436 R visitPrefixElement(PrefixElement element); 448 R visitPrefixElement(PrefixElement element);
437 R visitPropertyAccessorElement(PropertyAccessorElement element); 449 R visitPropertyAccessorElement(PropertyAccessorElement element);
438 R visitTopLevelVariableElement(TopLevelVariableElement element); 450 R visitTopLevelVariableElement(TopLevelVariableElement element);
439 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
440 R visitTypeVariableElement(TypeVariableElement element); 451 R visitTypeVariableElement(TypeVariableElement element);
441 } 452 }
442 /** 453 /**
443 * The interface {@code EmbeddedHtmlScriptElement} defines the behavior of eleme nts representing a 454 * The interface {@code EmbeddedHtmlScriptElement} defines the behavior of eleme nts representing a
444 * script tag in an HTML file having content that defines a Dart library. 455 * script tag in an HTML file having content that defines a Dart library.
445 * @coverage dart.engine.element 456 * @coverage dart.engine.element
446 */ 457 */
447 abstract class EmbeddedHtmlScriptElement implements HtmlScriptElement { 458 abstract class EmbeddedHtmlScriptElement implements HtmlScriptElement {
448 /** 459 /**
449 * Return the library element defined by the content of the script tag. 460 * Return the library element defined by the content of the script tag.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 * @coverage dart.engine.element 549 * @coverage dart.engine.element
539 */ 550 */
540 abstract class FieldElement implements PropertyInducingElement { 551 abstract class FieldElement implements PropertyInducingElement {
541 /** 552 /**
542 * Return the type in which this field is defined. 553 * Return the type in which this field is defined.
543 * @return the type in which this field is defined 554 * @return the type in which this field is defined
544 */ 555 */
545 ClassElement get enclosingElement; 556 ClassElement get enclosingElement;
546 } 557 }
547 /** 558 /**
559 * The interface {@code FieldFormalParameterElement} defines the behavior of ele ments representing a
560 * field formal parameter defined within a constructor element.
561 */
562 abstract class FieldFormalParameterElement implements ParameterElement {
563 /**
564 * Return the field element associated with this field formal parameter, or {@ code null} if the
565 * parameter references a field that doesn't exist.
566 * @return the field element associated with this field formal parameter
567 */
568 FieldElement get field;
569 }
570 /**
548 * The interface {@code FunctionElement} defines the behavior of elements repres enting a function. 571 * The interface {@code FunctionElement} defines the behavior of elements repres enting a function.
549 * @coverage dart.engine.element 572 * @coverage dart.engine.element
550 */ 573 */
551 abstract class FunctionElement implements ExecutableElement, LocalElement { 574 abstract class FunctionElement implements ExecutableElement, LocalElement {
552 } 575 }
553 /** 576 /**
554 * The interface {@code FunctionTypeAliasElement} defines the behavior of elemen ts representing a 577 * The interface {@code FunctionTypeAliasElement} defines the behavior of elemen ts representing a
555 * function type alias ({@code typedef}). 578 * function type alias ({@code typedef}).
556 * @coverage dart.engine.element 579 * @coverage dart.engine.element
557 */ 580 */
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 * @return the compilation units that are included in this library 719 * @return the compilation units that are included in this library
697 */ 720 */
698 List<CompilationUnitElement> get parts; 721 List<CompilationUnitElement> get parts;
699 /** 722 /**
700 * Return an array containing elements for each of the prefixes used to {@code import} libraries 723 * Return an array containing elements for each of the prefixes used to {@code import} libraries
701 * into this library. Each prefix can be used in more than one {@code import} directive. 724 * into this library. Each prefix can be used in more than one {@code import} directive.
702 * @return the prefixes used to {@code import} libraries into this library 725 * @return the prefixes used to {@code import} libraries into this library
703 */ 726 */
704 List<PrefixElement> get prefixes; 727 List<PrefixElement> get prefixes;
705 /** 728 /**
729 * Return the class defined in this library that has the given name, or {@code null} if this
730 * library does not define a class with the given name.
731 * @param className the name of the class to be returned
732 * @return the class with the given name that is defined in this library
733 */
734 ClassElement getType(String className);
735 /**
706 * Answer {@code true} if this library is an application that can be run in th e browser. 736 * Answer {@code true} if this library is an application that can be run in th e browser.
707 * @return {@code true} if this library is an application that can be run in t he browser 737 * @return {@code true} if this library is an application that can be run in t he browser
708 */ 738 */
709 bool isBrowserApplication(); 739 bool isBrowserApplication();
710 /** 740 /**
711 * Return {@code true} if this library is the dart:core library. 741 * Return {@code true} if this library is the dart:core library.
712 * @return {@code true} if this library is the dart:core library 742 * @return {@code true} if this library is the dart:core library
713 */ 743 */
714 bool isDartCore(); 744 bool isDartCore();
715 /** 745 /**
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 * defined within an executable element. 831 * defined within an executable element.
802 * @coverage dart.engine.element 832 * @coverage dart.engine.element
803 */ 833 */
804 abstract class ParameterElement implements LocalElement, VariableElement { 834 abstract class ParameterElement implements LocalElement, VariableElement {
805 /** 835 /**
806 * Return the kind of this parameter. 836 * Return the kind of this parameter.
807 * @return the kind of this parameter 837 * @return the kind of this parameter
808 */ 838 */
809 ParameterKind get parameterKind; 839 ParameterKind get parameterKind;
810 /** 840 /**
841 * Return an array containing all of the parameters defined by this parameter. A parameter will
842 * only define other parameters if it is a function typed parameter.
843 * @return the parameters defined by this parameter element
844 */
845 List<ParameterElement> get parameters;
846 /**
811 * Return {@code true} if this parameter is an initializing formal parameter. 847 * Return {@code true} if this parameter is an initializing formal parameter.
812 * @return {@code true} if this parameter is an initializing formal parameter 848 * @return {@code true} if this parameter is an initializing formal parameter
813 */ 849 */
814 bool isInitializingFormal(); 850 bool isInitializingFormal();
815 } 851 }
816 /** 852 /**
817 * The interface {@code PrefixElement} defines the behavior common to elements t hat represent a 853 * The interface {@code PrefixElement} defines the behavior common to elements t hat represent a
818 * prefix used to import one or more libraries into another library. 854 * prefix used to import one or more libraries into another library.
819 * @coverage dart.engine.element 855 * @coverage dart.engine.element
820 */ 856 */
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 * TypeAliasElement 1051 * TypeAliasElement
1016 * TypeVariableElement 1052 * TypeVariableElement
1017 * UndefinedElement 1053 * UndefinedElement
1018 * VariableElement 1054 * VariableElement
1019 * PropertyInducingElement 1055 * PropertyInducingElement
1020 * FieldElement 1056 * FieldElement
1021 * TopLevelVariableElement 1057 * TopLevelVariableElement
1022 * LocalElement 1058 * LocalElement
1023 * LocalVariableElement 1059 * LocalVariableElement
1024 * ParameterElement 1060 * ParameterElement
1061 * FieldFormalParameterElement
1025 * </pre> 1062 * </pre>
1026 * <p> 1063 * <p>
1027 * Subclasses that override a visit method must either invoke the overridden vis it method or 1064 * Subclasses that override a visit method must either invoke the overridden vis it method or
1028 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods 1065 * explicitly invoke the more general visit method. Failure to do so will cause the visit methods
1029 * for superclasses of the element to not be invoked and will cause the children of the visited node 1066 * for superclasses of the element to not be invoked and will cause the children of the visited node
1030 * to not be visited. 1067 * to not be visited.
1031 * @coverage dart.engine.element 1068 * @coverage dart.engine.element
1032 */ 1069 */
1033 class GeneralizingElementVisitor<R> implements ElementVisitor<R> { 1070 class GeneralizingElementVisitor<R> implements ElementVisitor<R> {
1034 R visitClassElement(ClassElement element) => visitElement(element); 1071 R visitClassElement(ClassElement element) => visitElement(element);
1035 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement( element); 1072 R visitCompilationUnitElement(CompilationUnitElement element) => visitElement( element);
1036 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen t(element); 1073 R visitConstructorElement(ConstructorElement element) => visitExecutableElemen t(element);
1037 R visitElement(Element element) { 1074 R visitElement(Element element) {
1038 element.visitChildren(this); 1075 element.visitChildren(this);
1039 return null; 1076 return null;
1040 } 1077 }
1041 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => visitHt mlScriptElement(element); 1078 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => visitHt mlScriptElement(element);
1042 R visitExecutableElement(ExecutableElement element) => visitElement(element); 1079 R visitExecutableElement(ExecutableElement element) => visitElement(element);
1043 R visitExportElement(ExportElement element) => visitElement(element); 1080 R visitExportElement(ExportElement element) => visitElement(element);
1044 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHt mlScriptElement(element); 1081 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => visitHt mlScriptElement(element);
1045 R visitFieldElement(FieldElement element) => visitPropertyInducingElement(elem ent); 1082 R visitFieldElement(FieldElement element) => visitPropertyInducingElement(elem ent);
1083 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => vis itParameterElement(element);
1046 R visitFunctionElement(FunctionElement element) => visitLocalElement(element); 1084 R visitFunctionElement(FunctionElement element) => visitLocalElement(element);
1085 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem ent(element);
1047 R visitHtmlElement(HtmlElement element) => visitElement(element); 1086 R visitHtmlElement(HtmlElement element) => visitElement(element);
1048 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element); 1087 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element);
1049 R visitImportElement(ImportElement element) => visitElement(element); 1088 R visitImportElement(ImportElement element) => visitElement(element);
1050 R visitLabelElement(LabelElement element) => visitElement(element); 1089 R visitLabelElement(LabelElement element) => visitElement(element);
1051 R visitLibraryElement(LibraryElement element) => visitElement(element); 1090 R visitLibraryElement(LibraryElement element) => visitElement(element);
1052 R visitLocalElement(LocalElement element) { 1091 R visitLocalElement(LocalElement element) {
1053 if (element is LocalVariableElement) { 1092 if (element is LocalVariableElement) {
1054 return visitVariableElement((element as LocalVariableElement)); 1093 return visitVariableElement((element as LocalVariableElement));
1055 } else if (element is ParameterElement) { 1094 } else if (element is ParameterElement) {
1056 return visitVariableElement((element as ParameterElement)); 1095 return visitVariableElement((element as ParameterElement));
1057 } else if (element is FunctionElement) { 1096 } else if (element is FunctionElement) {
1058 return visitExecutableElement((element as FunctionElement)); 1097 return visitExecutableElement((element as FunctionElement));
1059 } 1098 }
1060 return null; 1099 return null;
1061 } 1100 }
1062 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement (element); 1101 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement (element);
1063 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ; 1102 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ;
1064 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element); 1103 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element);
1065 R visitParameterElement(ParameterElement element) => visitLocalElement(element ); 1104 R visitParameterElement(ParameterElement element) => visitLocalElement(element );
1066 R visitPrefixElement(PrefixElement element) => visitElement(element); 1105 R visitPrefixElement(PrefixElement element) => visitElement(element);
1067 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element); 1106 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element);
1068 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element); 1107 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element);
1069 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper tyInducingElement(element); 1108 R visitTopLevelVariableElement(TopLevelVariableElement element) => visitProper tyInducingElement(element);
1070 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem ent(element);
1071 R visitTypeVariableElement(TypeVariableElement element) => visitElement(elemen t); 1109 R visitTypeVariableElement(TypeVariableElement element) => visitElement(elemen t);
1072 R visitVariableElement(VariableElement element) => visitElement(element); 1110 R visitVariableElement(VariableElement element) => visitElement(element);
1073 } 1111 }
1074 /** 1112 /**
1075 * Instances of the class {@code RecursiveElementVisitor} implement an element v isitor that will 1113 * Instances of the class {@code RecursiveElementVisitor} implement an element v isitor that will
1076 * recursively visit all of the element in an element model. For example, using an instance of this 1114 * recursively visit all of the element in an element model. For example, using an instance of this
1077 * class to visit a {@link CompilationUnitElement} will also cause all of the ty pes in the 1115 * class to visit a {@link CompilationUnitElement} will also cause all of the ty pes in the
1078 * compilation unit to be visited. 1116 * compilation unit to be visited.
1079 * <p> 1117 * <p>
1080 * Subclasses that override a visit method must either invoke the overridden vis it method or must 1118 * Subclasses that override a visit method must either invoke the overridden vis it method or must
(...skipping 23 matching lines...) Expand all
1104 return null; 1142 return null;
1105 } 1143 }
1106 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) { 1144 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) {
1107 element.visitChildren(this); 1145 element.visitChildren(this);
1108 return null; 1146 return null;
1109 } 1147 }
1110 R visitFieldElement(FieldElement element) { 1148 R visitFieldElement(FieldElement element) {
1111 element.visitChildren(this); 1149 element.visitChildren(this);
1112 return null; 1150 return null;
1113 } 1151 }
1152 R visitFieldFormalParameterElement(FieldFormalParameterElement element) {
1153 element.visitChildren(this);
1154 return null;
1155 }
1114 R visitFunctionElement(FunctionElement element) { 1156 R visitFunctionElement(FunctionElement element) {
1115 element.visitChildren(this); 1157 element.visitChildren(this);
1116 return null; 1158 return null;
1117 } 1159 }
1160 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
1161 element.visitChildren(this);
1162 return null;
1163 }
1118 R visitHtmlElement(HtmlElement element) { 1164 R visitHtmlElement(HtmlElement element) {
1119 element.visitChildren(this); 1165 element.visitChildren(this);
1120 return null; 1166 return null;
1121 } 1167 }
1122 R visitImportElement(ImportElement element) { 1168 R visitImportElement(ImportElement element) {
1123 element.visitChildren(this); 1169 element.visitChildren(this);
1124 return null; 1170 return null;
1125 } 1171 }
1126 R visitLabelElement(LabelElement element) { 1172 R visitLabelElement(LabelElement element) {
1127 element.visitChildren(this); 1173 element.visitChildren(this);
(...skipping 24 matching lines...) Expand all
1152 return null; 1198 return null;
1153 } 1199 }
1154 R visitPropertyAccessorElement(PropertyAccessorElement element) { 1200 R visitPropertyAccessorElement(PropertyAccessorElement element) {
1155 element.visitChildren(this); 1201 element.visitChildren(this);
1156 return null; 1202 return null;
1157 } 1203 }
1158 R visitTopLevelVariableElement(TopLevelVariableElement element) { 1204 R visitTopLevelVariableElement(TopLevelVariableElement element) {
1159 element.visitChildren(this); 1205 element.visitChildren(this);
1160 return null; 1206 return null;
1161 } 1207 }
1162 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
1163 element.visitChildren(this);
1164 return null;
1165 }
1166 R visitTypeVariableElement(TypeVariableElement element) { 1208 R visitTypeVariableElement(TypeVariableElement element) {
1167 element.visitChildren(this); 1209 element.visitChildren(this);
1168 return null; 1210 return null;
1169 } 1211 }
1170 } 1212 }
1171 /** 1213 /**
1172 * Instances of the class {@code SimpleElementVisitor} implement an element visi tor that will do 1214 * Instances of the class {@code SimpleElementVisitor} implement an element visi tor that will do
1173 * nothing when visiting an element. It is intended to be a superclass for class es that use the 1215 * nothing when visiting an element. It is intended to be a superclass for class es that use the
1174 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re cursively visit a 1216 * visitor pattern primarily as a dispatch mechanism (and hence don't need to re cursively visit a
1175 * whole structure) and that only need to visit a small number of element types. 1217 * whole structure) and that only need to visit a small number of element types.
1176 * @coverage dart.engine.element 1218 * @coverage dart.engine.element
1177 */ 1219 */
1178 class SimpleElementVisitor<R> implements ElementVisitor<R> { 1220 class SimpleElementVisitor<R> implements ElementVisitor<R> {
1179 R visitClassElement(ClassElement element) => null; 1221 R visitClassElement(ClassElement element) => null;
1180 R visitCompilationUnitElement(CompilationUnitElement element) => null; 1222 R visitCompilationUnitElement(CompilationUnitElement element) => null;
1181 R visitConstructorElement(ConstructorElement element) => null; 1223 R visitConstructorElement(ConstructorElement element) => null;
1182 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null; 1224 R visitEmbeddedHtmlScriptElement(EmbeddedHtmlScriptElement element) => null;
1183 R visitExportElement(ExportElement element) => null; 1225 R visitExportElement(ExportElement element) => null;
1184 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => null; 1226 R visitExternalHtmlScriptElement(ExternalHtmlScriptElement element) => null;
1185 R visitFieldElement(FieldElement element) => null; 1227 R visitFieldElement(FieldElement element) => null;
1228 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => nul l;
1186 R visitFunctionElement(FunctionElement element) => null; 1229 R visitFunctionElement(FunctionElement element) => null;
1230 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null;
1187 R visitHtmlElement(HtmlElement element) => null; 1231 R visitHtmlElement(HtmlElement element) => null;
1188 R visitImportElement(ImportElement element) => null; 1232 R visitImportElement(ImportElement element) => null;
1189 R visitLabelElement(LabelElement element) => null; 1233 R visitLabelElement(LabelElement element) => null;
1190 R visitLibraryElement(LibraryElement element) => null; 1234 R visitLibraryElement(LibraryElement element) => null;
1191 R visitLocalVariableElement(LocalVariableElement element) => null; 1235 R visitLocalVariableElement(LocalVariableElement element) => null;
1192 R visitMethodElement(MethodElement element) => null; 1236 R visitMethodElement(MethodElement element) => null;
1193 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; 1237 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null;
1194 R visitParameterElement(ParameterElement element) => null; 1238 R visitParameterElement(ParameterElement element) => null;
1195 R visitPrefixElement(PrefixElement element) => null; 1239 R visitPrefixElement(PrefixElement element) => null;
1196 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; 1240 R visitPropertyAccessorElement(PropertyAccessorElement element) => null;
1197 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; 1241 R visitTopLevelVariableElement(TopLevelVariableElement element) => null;
1198 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null;
1199 R visitTypeVariableElement(TypeVariableElement element) => null; 1242 R visitTypeVariableElement(TypeVariableElement element) => null;
1200 } 1243 }
1201 /** 1244 /**
1202 * Instances of the class {@code AnnotationImpl} implement an {@link Annotation} . 1245 * Instances of the class {@code AnnotationImpl} implement an {@link Annotation} .
1203 * @coverage dart.engine.element 1246 * @coverage dart.engine.element
1204 */ 1247 */
1205 class AnnotationImpl implements Annotation { 1248 class AnnotationImpl implements Annotation {
1206 /** 1249 /**
1207 * The element representing the field, variable, or constructor being used as an annotation. 1250 * The element representing the field, variable, or constructor being used as an annotation.
1208 */ 1251 */
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 static List<ClassElement> EMPTY_ARRAY = new List<ClassElement>(0); 1313 static List<ClassElement> EMPTY_ARRAY = new List<ClassElement>(0);
1271 /** 1314 /**
1272 * Initialize a newly created class element to have the given name. 1315 * Initialize a newly created class element to have the given name.
1273 * @param name the name of this element 1316 * @param name the name of this element
1274 */ 1317 */
1275 ClassElementImpl(Identifier name) : super.con1(name) { 1318 ClassElementImpl(Identifier name) : super.con1(name) {
1276 } 1319 }
1277 accept(ElementVisitor visitor) => visitor.visitClassElement(this); 1320 accept(ElementVisitor visitor) => visitor.visitClassElement(this);
1278 List<PropertyAccessorElement> get accessors => _accessors; 1321 List<PropertyAccessorElement> get accessors => _accessors;
1279 List<InterfaceType> get allSupertypes { 1322 List<InterfaceType> get allSupertypes {
1280 Set<InterfaceType> set = new Set<InterfaceType>(); 1323 Set<InterfaceType> list = new Set<InterfaceType>();
1281 collectAllSupertypes(set); 1324 collectAllSupertypes(list);
1282 return set.toList(); 1325 return new List.from(list);
1283 } 1326 }
1284 ElementImpl getChild(String identifier25) { 1327 ElementImpl getChild(String identifier27) {
1285 for (PropertyAccessorElement accessor in _accessors) { 1328 for (PropertyAccessorElement accessor in _accessors) {
1286 if (((accessor as PropertyAccessorElementImpl)).identifier == identifier25 ) { 1329 if (((accessor as PropertyAccessorElementImpl)).identifier == identifier27 ) {
1287 return accessor as PropertyAccessorElementImpl; 1330 return accessor as PropertyAccessorElementImpl;
1288 } 1331 }
1289 } 1332 }
1290 for (ConstructorElement constructor in _constructors) { 1333 for (ConstructorElement constructor in _constructors) {
1291 if (((constructor as ConstructorElementImpl)).identifier == identifier25) { 1334 if (((constructor as ConstructorElementImpl)).identifier == identifier27) {
1292 return constructor as ConstructorElementImpl; 1335 return constructor as ConstructorElementImpl;
1293 } 1336 }
1294 } 1337 }
1295 for (FieldElement field in _fields) { 1338 for (FieldElement field in _fields) {
1296 if (((field as FieldElementImpl)).identifier == identifier25) { 1339 if (((field as FieldElementImpl)).identifier == identifier27) {
1297 return field as FieldElementImpl; 1340 return field as FieldElementImpl;
1298 } 1341 }
1299 } 1342 }
1300 for (MethodElement method in _methods) { 1343 for (MethodElement method in _methods) {
1301 if (((method as MethodElementImpl)).identifier == identifier25) { 1344 if (((method as MethodElementImpl)).identifier == identifier27) {
1302 return method as MethodElementImpl; 1345 return method as MethodElementImpl;
1303 } 1346 }
1304 } 1347 }
1305 for (TypeVariableElement typeVariable in _typeVariables) { 1348 for (TypeVariableElement typeVariable in _typeVariables) {
1306 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier25 ) { 1349 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier27 ) {
1307 return typeVariable as TypeVariableElementImpl; 1350 return typeVariable as TypeVariableElementImpl;
1308 } 1351 }
1309 } 1352 }
1310 return null; 1353 return null;
1311 } 1354 }
1312 List<ConstructorElement> get constructors => _constructors; 1355 List<ConstructorElement> get constructors => _constructors;
1356 /**
1357 * Given some name, this returns the {@link FieldElement} with the matching na me, if there is no
1358 * such field, then {@code null} is returned.
1359 * @param name some name to lookup a field element with
1360 * @return the matching field element, or {@code null} if no such element was found
1361 */
1362 FieldElement getField(String name27) {
1363 for (FieldElement fieldElement in _fields) {
1364 if (name27 == fieldElement.name) {
1365 return fieldElement;
1366 }
1367 }
1368 return null;
1369 }
1313 List<FieldElement> get fields => _fields; 1370 List<FieldElement> get fields => _fields;
1371 /**
1372 * Return the element representing the getter with the given name that is decl ared in this class,
1373 * or {@code null} if this class does not declare a getter with the given name .
1374 * @param getterName the name of the getter to be returned
1375 * @return the getter declared in this class with the given name
1376 */
1377 PropertyAccessorElement getGetter(String getterName) {
1378 for (PropertyAccessorElement accessor in _accessors) {
1379 if (accessor.isGetter() && accessor.name == getterName) {
1380 return accessor;
1381 }
1382 }
1383 return null;
1384 }
1314 List<InterfaceType> get interfaces => _interfaces; 1385 List<InterfaceType> get interfaces => _interfaces;
1315 ElementKind get kind => ElementKind.CLASS; 1386 ElementKind get kind => ElementKind.CLASS;
1387 /**
1388 * Return the element representing the method with the given name that is decl ared in this class,
1389 * or {@code null} if this class does not declare a method with the given name .
1390 * @param methodName the name of the method to be returned
1391 * @return the method declared in this class with the given name
1392 */
1393 MethodElement getMethod(String methodName) {
1394 for (MethodElement method in _methods) {
1395 if (method.name == methodName) {
1396 return method;
1397 }
1398 }
1399 return null;
1400 }
1316 List<MethodElement> get methods => _methods; 1401 List<MethodElement> get methods => _methods;
1317 List<InterfaceType> get mixins => _mixins; 1402 List<InterfaceType> get mixins => _mixins;
1318 ConstructorElement getNamedConstructor(String name24) { 1403 ConstructorElement getNamedConstructor(String name28) {
1319 for (ConstructorElement element in constructors) { 1404 for (ConstructorElement element in constructors) {
1320 String elementName = element.name; 1405 String elementName = element.name;
1321 if (elementName != null && elementName == name24) { 1406 if (elementName != null && elementName == name28) {
1322 return element; 1407 return element;
1323 } 1408 }
1324 } 1409 }
1325 return null; 1410 return null;
1326 } 1411 }
1412 /**
1413 * Return the element representing the setter with the given name that is decl ared in this class,
1414 * or {@code null} if this class does not declare a setter with the given name .
1415 * @param setterName the name of the getter to be returned
1416 * @return the setter declared in this class with the given name
1417 */
1418 PropertyAccessorElement getSetter(String setterName) {
1419 for (PropertyAccessorElement accessor in _accessors) {
1420 if (accessor.isSetter() && accessor.name == setterName) {
1421 return accessor;
1422 }
1423 }
1424 return null;
1425 }
1327 InterfaceType get supertype => _supertype; 1426 InterfaceType get supertype => _supertype;
1328 InterfaceType get type => _type; 1427 InterfaceType get type => _type;
1329 List<TypeVariableElement> get typeVariables => _typeVariables; 1428 List<TypeVariableElement> get typeVariables => _typeVariables;
1330 ConstructorElement get unnamedConstructor { 1429 ConstructorElement get unnamedConstructor {
1331 for (ConstructorElement element in constructors) { 1430 for (ConstructorElement element in constructors) {
1332 String name10 = element.name; 1431 String name12 = element.name;
1333 if (name10 == null || name10.isEmpty) { 1432 if (name12 == null || name12.isEmpty) {
1334 return element; 1433 return element;
1335 } 1434 }
1336 } 1435 }
1337 return null; 1436 return null;
1338 } 1437 }
1339 bool isAbstract() => hasModifier(Modifier.ABSTRACT); 1438 bool isAbstract() => hasModifier(Modifier.ABSTRACT);
1340 bool isTypedef() => hasModifier(Modifier.TYPEDEF); 1439 bool isTypedef() => hasModifier(Modifier.TYPEDEF);
1341 bool isValidMixin() => hasModifier(Modifier.MIXIN); 1440 bool isValidMixin() => hasModifier(Modifier.MIXIN);
1342 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ) { 1441 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ) {
1343 PropertyAccessorElement element = getGetter(getterName); 1442 PropertyAccessorElement element = getGetter(getterName);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 } 1615 }
1517 void visitChildren(ElementVisitor<Object> visitor) { 1616 void visitChildren(ElementVisitor<Object> visitor) {
1518 super.visitChildren(visitor); 1617 super.visitChildren(visitor);
1519 safelyVisitChildren(_accessors, visitor); 1618 safelyVisitChildren(_accessors, visitor);
1520 safelyVisitChildren(_constructors, visitor); 1619 safelyVisitChildren(_constructors, visitor);
1521 safelyVisitChildren(_fields, visitor); 1620 safelyVisitChildren(_fields, visitor);
1522 safelyVisitChildren(_methods, visitor); 1621 safelyVisitChildren(_methods, visitor);
1523 safelyVisitChildren(_typeVariables, visitor); 1622 safelyVisitChildren(_typeVariables, visitor);
1524 } 1623 }
1525 void appendTo(JavaStringBuilder builder) { 1624 void appendTo(JavaStringBuilder builder) {
1526 String name11 = name; 1625 String name13 = name;
1527 if (name11 == null) { 1626 if (name13 == null) {
1528 builder.append("{unnamed class}"); 1627 builder.append("{unnamed class}");
1529 } else { 1628 } else {
1530 builder.append(name11); 1629 builder.append(name13);
1531 } 1630 }
1532 int variableCount = _typeVariables.length; 1631 int variableCount = _typeVariables.length;
1533 if (variableCount > 0) { 1632 if (variableCount > 0) {
1534 builder.append("<"); 1633 builder.append("<");
1535 for (int i = 0; i < variableCount; i++) { 1634 for (int i = 0; i < variableCount; i++) {
1536 if (i > 0) { 1635 if (i > 0) {
1537 builder.append(", "); 1636 builder.append(", ");
1538 } 1637 }
1539 ((_typeVariables[i] as TypeVariableElementImpl)).appendTo(builder); 1638 ((_typeVariables[i] as TypeVariableElementImpl)).appendTo(builder);
1540 } 1639 }
1541 builder.append(">"); 1640 builder.append(">");
1542 } 1641 }
1543 } 1642 }
1544 void collectAllSupertypes(var list) { 1643 void collectAllSupertypes(Set<InterfaceType> list) {
1545 if (_supertype == null || list.contains(_supertype)) { 1644 if (_supertype == null || list.contains(_supertype)) {
1546 return; 1645 return;
1547 } 1646 }
1548 list.add(_supertype); 1647 javaSetAdd(list, _supertype);
1549 ((_supertype.element as ClassElementImpl)).collectAllSupertypes(list); 1648 ((_supertype.element as ClassElementImpl)).collectAllSupertypes(list);
1550 for (InterfaceType type in interfaces) { 1649 for (InterfaceType type in interfaces) {
1551 if (!list.contains(type)) { 1650 if (!list.contains(type)) {
1552 list.add(type); 1651 javaSetAdd(list, type);
1553 ((type.element as ClassElementImpl)).collectAllSupertypes(list); 1652 ((type.element as ClassElementImpl)).collectAllSupertypes(list);
1554 } 1653 }
1555 } 1654 }
1556 for (InterfaceType type in mixins) { 1655 for (InterfaceType type in mixins) {
1557 if (!list.contains(type)) { 1656 if (!list.contains(type)) {
1558 list.add(type); 1657 javaSetAdd(list, type);
1559 } 1658 }
1560 } 1659 }
1561 } 1660 }
1562 /**
1563 * Return the element representing the getter with the given name that is decl ared in this class,
1564 * or {@code null} if this class does not declare a getter with the given name .
1565 * @param getterName the name of the getter to be returned
1566 * @return the getter declared in this class with the given name
1567 */
1568 PropertyAccessorElement getGetter(String getterName) {
1569 for (PropertyAccessorElement accessor in _accessors) {
1570 if (accessor.isGetter() && accessor.name == getterName) {
1571 return accessor;
1572 }
1573 }
1574 return null;
1575 }
1576 /**
1577 * Return the element representing the method with the given name that is decl ared in this class,
1578 * or {@code null} if this class does not declare a method with the given name .
1579 * @param methodName the name of the method to be returned
1580 * @return the method declared in this class with the given name
1581 */
1582 MethodElement getMethod(String methodName) {
1583 for (MethodElement method in _methods) {
1584 if (method.name == methodName) {
1585 return method;
1586 }
1587 }
1588 return null;
1589 }
1590 /**
1591 * Return the element representing the setter with the given name that is decl ared in this class,
1592 * or {@code null} if this class does not declare a setter with the given name .
1593 * @param setterName the name of the getter to be returned
1594 * @return the getter declared in this class with the given name
1595 */
1596 PropertyAccessorElement getSetter(String setterName) {
1597 for (PropertyAccessorElement accessor in _accessors) {
1598 if (accessor.isSetter() && accessor.name == setterName) {
1599 return accessor;
1600 }
1601 }
1602 return null;
1603 }
1604 } 1661 }
1605 /** 1662 /**
1606 * Instances of the class {@code CompilationUnitElementImpl} implement a{@link C ompilationUnitElement}. 1663 * Instances of the class {@code CompilationUnitElementImpl} implement a{@link C ompilationUnitElement}.
1607 * @coverage dart.engine.element 1664 * @coverage dart.engine.element
1608 */ 1665 */
1609 class CompilationUnitElementImpl extends ElementImpl implements CompilationUnitE lement { 1666 class CompilationUnitElementImpl extends ElementImpl implements CompilationUnitE lement {
1610 /** 1667 /**
1611 * An array containing all of the top-level accessors (getters and setters) co ntained in this 1668 * An array containing all of the top-level accessors (getters and setters) co ntained in this
1612 * compilation unit. 1669 * compilation unit.
1613 */ 1670 */
(...skipping 24 matching lines...) Expand all
1638 static List<CompilationUnitElement> EMPTY_ARRAY = new List<CompilationUnitElem ent>(0); 1695 static List<CompilationUnitElement> EMPTY_ARRAY = new List<CompilationUnitElem ent>(0);
1639 /** 1696 /**
1640 * Initialize a newly created compilation unit element to have the given name. 1697 * Initialize a newly created compilation unit element to have the given name.
1641 * @param name the name of this element 1698 * @param name the name of this element
1642 */ 1699 */
1643 CompilationUnitElementImpl(String name) : super.con2(name, -1) { 1700 CompilationUnitElementImpl(String name) : super.con2(name, -1) {
1644 } 1701 }
1645 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this); 1702 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
1646 bool operator ==(Object object) => object != null && identical(runtimeType, ob ject.runtimeType) && _source == ((object as CompilationUnitElementImpl)).source; 1703 bool operator ==(Object object) => object != null && identical(runtimeType, ob ject.runtimeType) && _source == ((object as CompilationUnitElementImpl)).source;
1647 List<PropertyAccessorElement> get accessors => _accessors; 1704 List<PropertyAccessorElement> get accessors => _accessors;
1648 ElementImpl getChild(String identifier26) { 1705 ElementImpl getChild(String identifier28) {
1649 for (PropertyAccessorElement accessor in _accessors) { 1706 for (PropertyAccessorElement accessor in _accessors) {
1650 if (((accessor as PropertyAccessorElementImpl)).identifier == identifier26 ) { 1707 if (((accessor as PropertyAccessorElementImpl)).identifier == identifier28 ) {
1651 return accessor as PropertyAccessorElementImpl; 1708 return accessor as PropertyAccessorElementImpl;
1652 } 1709 }
1653 } 1710 }
1654 for (VariableElement variable in _variables) { 1711 for (VariableElement variable in _variables) {
1655 if (((variable as VariableElementImpl)).identifier == identifier26) { 1712 if (((variable as VariableElementImpl)).identifier == identifier28) {
1656 return variable as VariableElementImpl; 1713 return variable as VariableElementImpl;
1657 } 1714 }
1658 } 1715 }
1659 for (ExecutableElement function in _functions) { 1716 for (ExecutableElement function in _functions) {
1660 if (((function as ExecutableElementImpl)).identifier == identifier26) { 1717 if (((function as ExecutableElementImpl)).identifier == identifier28) {
1661 return function as ExecutableElementImpl; 1718 return function as ExecutableElementImpl;
1662 } 1719 }
1663 } 1720 }
1664 for (FunctionTypeAliasElement typeAlias in _typeAliases) { 1721 for (FunctionTypeAliasElement typeAlias in _typeAliases) {
1665 if (((typeAlias as FunctionTypeAliasElementImpl)).identifier == identifier 26) { 1722 if (((typeAlias as FunctionTypeAliasElementImpl)).identifier == identifier 28) {
1666 return typeAlias as FunctionTypeAliasElementImpl; 1723 return typeAlias as FunctionTypeAliasElementImpl;
1667 } 1724 }
1668 } 1725 }
1669 for (ClassElement type in _types) { 1726 for (ClassElement type in _types) {
1670 if (((type as ClassElementImpl)).identifier == identifier26) { 1727 if (((type as ClassElementImpl)).identifier == identifier28) {
1671 return type as ClassElementImpl; 1728 return type as ClassElementImpl;
1672 } 1729 }
1673 } 1730 }
1674 return null; 1731 return null;
1675 } 1732 }
1676 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen t; 1733 LibraryElement get enclosingElement => super.enclosingElement as LibraryElemen t;
1677 List<FunctionElement> get functions => _functions; 1734 List<FunctionElement> get functions => _functions;
1678 List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases; 1735 List<FunctionTypeAliasElement> get functionTypeAliases => _typeAliases;
1679 String get identifier => source.encoding; 1736 String get identifier => source.encoding;
1680 ElementKind get kind => ElementKind.COMPILATION_UNIT; 1737 ElementKind get kind => ElementKind.COMPILATION_UNIT;
1681 Source get source => _source; 1738 Source get source => _source;
1682 List<TopLevelVariableElement> get topLevelVariables => _variables; 1739 List<TopLevelVariableElement> get topLevelVariables => _variables;
1740 ClassElement getType(String className) {
1741 for (ClassElement type in _types) {
1742 if (type.name == className) {
1743 return type;
1744 }
1745 }
1746 return null;
1747 }
1683 List<ClassElement> get types => _types; 1748 List<ClassElement> get types => _types;
1684 int get hashCode => _source.hashCode; 1749 int get hashCode => _source.hashCode;
1685 /** 1750 /**
1686 * Set the top-level accessors (getters and setters) contained in this compila tion unit to the 1751 * Set the top-level accessors (getters and setters) contained in this compila tion unit to the
1687 * given accessors. 1752 * given accessors.
1688 * @param the top-level accessors (getters and setters) contained in this comp ilation unit 1753 * @param the top-level accessors (getters and setters) contained in this comp ilation unit
1689 */ 1754 */
1690 void set accessors(List<PropertyAccessorElement> accessors3) { 1755 void set accessors(List<PropertyAccessorElement> accessors3) {
1691 for (PropertyAccessorElement accessor in accessors3) { 1756 for (PropertyAccessorElement accessor in accessors3) {
1692 ((accessor as PropertyAccessorElementImpl)).enclosingElement = this; 1757 ((accessor as PropertyAccessorElementImpl)).enclosingElement = this;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 } 1931 }
1867 /** 1932 /**
1868 * Set whether this constructor represents a factory method to the given value . 1933 * Set whether this constructor represents a factory method to the given value .
1869 * @param isFactory {@code true} if this constructor represents a factory meth od 1934 * @param isFactory {@code true} if this constructor represents a factory meth od
1870 */ 1935 */
1871 void set factory(bool isFactory) { 1936 void set factory(bool isFactory) {
1872 setModifier(Modifier.FACTORY, isFactory); 1937 setModifier(Modifier.FACTORY, isFactory);
1873 } 1938 }
1874 void appendTo(JavaStringBuilder builder) { 1939 void appendTo(JavaStringBuilder builder) {
1875 builder.append(enclosingElement.name); 1940 builder.append(enclosingElement.name);
1876 String name12 = name; 1941 String name14 = name;
1877 if (name12 != null && !name12.isEmpty) { 1942 if (name14 != null && !name14.isEmpty) {
1878 builder.append("."); 1943 builder.append(".");
1879 builder.append(name12); 1944 builder.append(name14);
1880 } 1945 }
1881 super.appendTo(builder); 1946 super.appendTo(builder);
1882 } 1947 }
1883 } 1948 }
1884 /** 1949 /**
1885 * Instances of the class {@code DynamicElementImpl} represent the synthetic ele ment representing 1950 * Instances of the class {@code DynamicElementImpl} represent the synthetic ele ment representing
1886 * the declaration of the type {@code dynamic}. 1951 * the declaration of the type {@code dynamic}.
1887 * @coverage dart.engine.element 1952 * @coverage dart.engine.element
1888 */ 1953 */
1889 class DynamicElementImpl extends ElementImpl { 1954 class DynamicElementImpl extends ElementImpl {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 int _nameOffset = 0; 2006 int _nameOffset = 0;
1942 /** 2007 /**
1943 * A bit-encoded form of the modifiers associated with this element. 2008 * A bit-encoded form of the modifiers associated with this element.
1944 */ 2009 */
1945 Set<Modifier> _modifiers; 2010 Set<Modifier> _modifiers;
1946 /** 2011 /**
1947 * An array containing all of the metadata associated with this element. 2012 * An array containing all of the metadata associated with this element.
1948 */ 2013 */
1949 List<Annotation> _metadata = AnnotationImpl.EMPTY_ARRAY; 2014 List<Annotation> _metadata = AnnotationImpl.EMPTY_ARRAY;
1950 /** 2015 /**
2016 * A cached copy of the calculated hashCode for this element.
2017 */
2018 int _cachedHashCode = 0;
2019 /**
1951 * Initialize a newly created element to have the given name. 2020 * Initialize a newly created element to have the given name.
1952 * @param name the name of this element 2021 * @param name the name of this element
1953 */ 2022 */
1954 ElementImpl.con1(Identifier name25) { 2023 ElementImpl.con1(Identifier name29) {
1955 _jtd_constructor_178_impl(name25); 2024 _jtd_constructor_188_impl(name29);
1956 } 2025 }
1957 _jtd_constructor_178_impl(Identifier name25) { 2026 _jtd_constructor_188_impl(Identifier name29) {
1958 _jtd_constructor_179_impl(name25 == null ? "" : name25.name, name25 == null ? -1 : name25.offset); 2027 _jtd_constructor_189_impl(name29 == null ? "" : name29.name, name29 == null ? -1 : name29.offset);
1959 } 2028 }
1960 /** 2029 /**
1961 * Initialize a newly created element to have the given name. 2030 * Initialize a newly created element to have the given name.
1962 * @param name the name of this element 2031 * @param name the name of this element
1963 * @param nameOffset the offset of the name of this element in the file that c ontains the 2032 * @param nameOffset the offset of the name of this element in the file that c ontains the
1964 * declaration of this element 2033 * declaration of this element
1965 */ 2034 */
1966 ElementImpl.con2(String name8, int nameOffset2) { 2035 ElementImpl.con2(String name9, int nameOffset2) {
1967 _jtd_constructor_179_impl(name8, nameOffset2); 2036 _jtd_constructor_189_impl(name9, nameOffset2);
1968 } 2037 }
1969 _jtd_constructor_179_impl(String name8, int nameOffset2) { 2038 _jtd_constructor_189_impl(String name9, int nameOffset2) {
1970 this._name = name8; 2039 this._name = StringUtilities.intern(name9);
1971 this._nameOffset = nameOffset2; 2040 this._nameOffset = nameOffset2;
1972 this._modifiers = new Set();
1973 } 2041 }
1974 bool operator ==(Object object) => object != null && identical(object.runtimeT ype, runtimeType) && ((object as Element)).location == location; 2042 bool operator ==(Object object) => object != null && identical(object.runtimeT ype, runtimeType) && ((object as Element)).location == location;
1975 Element getAncestor(Type elementClass) { 2043 Element getAncestor(Type elementClass) {
1976 Element ancestor = _enclosingElement; 2044 Element ancestor = _enclosingElement;
1977 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) { 2045 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) {
1978 ancestor = ancestor.enclosingElement; 2046 ancestor = ancestor.enclosingElement;
1979 } 2047 }
1980 return ancestor as Element; 2048 return ancestor as Element;
1981 } 2049 }
1982 /** 2050 /**
(...skipping 13 matching lines...) Expand all
1996 ElementLocation get location => new ElementLocationImpl.con1(this); 2064 ElementLocation get location => new ElementLocationImpl.con1(this);
1997 List<Annotation> get metadata => _metadata; 2065 List<Annotation> get metadata => _metadata;
1998 String get name => _name; 2066 String get name => _name;
1999 int get nameOffset => _nameOffset; 2067 int get nameOffset => _nameOffset;
2000 Source get source { 2068 Source get source {
2001 if (_enclosingElement == null) { 2069 if (_enclosingElement == null) {
2002 return null; 2070 return null;
2003 } 2071 }
2004 return _enclosingElement.source; 2072 return _enclosingElement.source;
2005 } 2073 }
2006 int get hashCode => location.hashCode; 2074 int get hashCode {
2007 bool isAccessibleIn(LibraryElement library21) { 2075 if (_cachedHashCode == 0) {
2076 _cachedHashCode = location.hashCode;
2077 }
2078 return _cachedHashCode;
2079 }
2080 bool isAccessibleIn(LibraryElement library35) {
2008 if (Identifier.isPrivateName(_name)) { 2081 if (Identifier.isPrivateName(_name)) {
2009 return library21 == library; 2082 return library35 == library;
2010 } 2083 }
2011 return true; 2084 return true;
2012 } 2085 }
2013 bool isSynthetic() => hasModifier(Modifier.SYNTHETIC); 2086 bool isSynthetic() => hasModifier(Modifier.SYNTHETIC);
2014 /** 2087 /**
2015 * Set the metadata associate with this element to the given array of annotati ons. 2088 * Set the metadata associate with this element to the given array of annotati ons.
2016 * @param metadata the metadata to be associated with this element 2089 * @param metadata the metadata to be associated with this element
2017 */ 2090 */
2018 void set metadata(List<Annotation> metadata3) { 2091 void set metadata(List<Annotation> metadata3) {
2019 this._metadata = metadata3; 2092 this._metadata = metadata3;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 * Return an identifier that uniquely identifies this element among the childr en of this element's 2131 * Return an identifier that uniquely identifies this element among the childr en of this element's
2059 * parent. 2132 * parent.
2060 * @return an identifier that uniquely identifies this element relative to its parent 2133 * @return an identifier that uniquely identifies this element relative to its parent
2061 */ 2134 */
2062 String get identifier => name; 2135 String get identifier => name;
2063 /** 2136 /**
2064 * Return {@code true} if this element has the given modifier associated with it. 2137 * Return {@code true} if this element has the given modifier associated with it.
2065 * @param modifier the modifier being tested for 2138 * @param modifier the modifier being tested for
2066 * @return {@code true} if this element has the given modifier associated with it 2139 * @return {@code true} if this element has the given modifier associated with it
2067 */ 2140 */
2068 bool hasModifier(Modifier modifier) => _modifiers.contains(modifier); 2141 bool hasModifier(Modifier modifier) => _modifiers != null && _modifiers.contai ns(modifier);
2069 /** 2142 /**
2070 * If the given child is not {@code null}, use the given visitor to visit it. 2143 * If the given child is not {@code null}, use the given visitor to visit it.
2071 * @param child the child to be visited 2144 * @param child the child to be visited
2072 * @param visitor the visitor to be used to visit the child 2145 * @param visitor the visitor to be used to visit the child
2073 */ 2146 */
2074 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { 2147 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) {
2075 if (child != null) { 2148 if (child != null) {
2076 child.accept(visitor); 2149 child.accept(visitor);
2077 } 2150 }
2078 } 2151 }
(...skipping 17 matching lines...) Expand all
2096 _enclosingElement = element; 2169 _enclosingElement = element;
2097 } 2170 }
2098 /** 2171 /**
2099 * Set whether the given modifier is associated with this element to correspon d to the given 2172 * Set whether the given modifier is associated with this element to correspon d to the given
2100 * value. 2173 * value.
2101 * @param modifier the modifier to be set 2174 * @param modifier the modifier to be set
2102 * @param value {@code true} if the modifier is to be associated with this ele ment 2175 * @param value {@code true} if the modifier is to be associated with this ele ment
2103 */ 2176 */
2104 void setModifier(Modifier modifier, bool value) { 2177 void setModifier(Modifier modifier, bool value) {
2105 if (value) { 2178 if (value) {
2179 if (_modifiers == null) {
2180 _modifiers = new Set();
2181 }
2106 _modifiers.add(modifier); 2182 _modifiers.add(modifier);
2107 } else { 2183 } else {
2108 _modifiers.remove(modifier); 2184 if (_modifiers != null) {
2185 _modifiers.remove(modifier);
2186 if (_modifiers.isEmpty) {
2187 _modifiers = null;
2188 }
2189 }
2109 } 2190 }
2110 } 2191 }
2111 } 2192 }
2112 /** 2193 /**
2113 * Instances of the class {@code ElementLocationImpl} implement an {@link Elemen tLocation}. 2194 * Instances of the class {@code ElementLocationImpl} implement an {@link Elemen tLocation}.
2114 * @coverage dart.engine.element 2195 * @coverage dart.engine.element
2115 */ 2196 */
2116 class ElementLocationImpl implements ElementLocation { 2197 class ElementLocationImpl implements ElementLocation {
2117 /** 2198 /**
2118 * The path to the element whose location is represented by this object. 2199 * The path to the element whose location is represented by this object.
2119 */ 2200 */
2120 List<String> _components; 2201 List<String> _components;
2121 /** 2202 /**
2122 * The character used to separate components in the encoded form. 2203 * The character used to separate components in the encoded form.
2123 */ 2204 */
2124 static int _SEPARATOR_CHAR = 0x3B; 2205 static int _SEPARATOR_CHAR = 0x3B;
2125 /** 2206 /**
2126 * Initialize a newly created location to represent the given element. 2207 * Initialize a newly created location to represent the given element.
2127 * @param element the element whose location is being represented 2208 * @param element the element whose location is being represented
2128 */ 2209 */
2129 ElementLocationImpl.con1(Element element) { 2210 ElementLocationImpl.con1(Element element) {
2130 _jtd_constructor_180_impl(element); 2211 _jtd_constructor_190_impl(element);
2131 } 2212 }
2132 _jtd_constructor_180_impl(Element element) { 2213 _jtd_constructor_190_impl(Element element) {
2133 List<String> components = new List<String>(); 2214 List<String> components = new List<String>();
2134 Element ancestor = element; 2215 Element ancestor = element;
2135 while (ancestor != null) { 2216 while (ancestor != null) {
2136 components.insert(0, ((ancestor as ElementImpl)).identifier); 2217 components.insert(0, ((ancestor as ElementImpl)).identifier);
2137 ancestor = ancestor.enclosingElement; 2218 ancestor = ancestor.enclosingElement;
2138 } 2219 }
2139 this._components = new List.from(components); 2220 this._components = new List.from(components);
2140 } 2221 }
2141 /** 2222 /**
2142 * Initialize a newly created location from the given encoded form. 2223 * Initialize a newly created location from the given encoded form.
2143 * @param encoding the encoded form of a location 2224 * @param encoding the encoded form of a location
2144 */ 2225 */
2145 ElementLocationImpl.con2(String encoding) { 2226 ElementLocationImpl.con2(String encoding) {
2146 _jtd_constructor_181_impl(encoding); 2227 _jtd_constructor_191_impl(encoding);
2147 } 2228 }
2148 _jtd_constructor_181_impl(String encoding) { 2229 _jtd_constructor_191_impl(String encoding) {
2149 this._components = decode(encoding); 2230 this._components = decode(encoding);
2150 } 2231 }
2151 bool operator ==(Object object) { 2232 bool operator ==(Object object) {
2152 if (object is! ElementLocationImpl) { 2233 if (object is! ElementLocationImpl) {
2153 return false; 2234 return false;
2154 } 2235 }
2155 ElementLocationImpl location = object as ElementLocationImpl; 2236 ElementLocationImpl location = object as ElementLocationImpl;
2156 return JavaArrays.equals(_components, location._components); 2237 return JavaArrays.equals(_components, location._components);
2157 } 2238 }
2158 /** 2239 /**
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 FunctionType _type; 2358 FunctionType _type;
2278 /** 2359 /**
2279 * An empty array of executable elements. 2360 * An empty array of executable elements.
2280 */ 2361 */
2281 static List<ExecutableElement> EMPTY_ARRAY = new List<ExecutableElement>(0); 2362 static List<ExecutableElement> EMPTY_ARRAY = new List<ExecutableElement>(0);
2282 /** 2363 /**
2283 * Initialize a newly created executable element to have the given name. 2364 * Initialize a newly created executable element to have the given name.
2284 * @param name the name of this element 2365 * @param name the name of this element
2285 */ 2366 */
2286 ExecutableElementImpl.con1(Identifier name) : super.con1(name) { 2367 ExecutableElementImpl.con1(Identifier name) : super.con1(name) {
2287 _jtd_constructor_183_impl(name); 2368 _jtd_constructor_193_impl(name);
2288 } 2369 }
2289 _jtd_constructor_183_impl(Identifier name) { 2370 _jtd_constructor_193_impl(Identifier name) {
2290 } 2371 }
2291 /** 2372 /**
2292 * Initialize a newly created executable element to have the given name. 2373 * Initialize a newly created executable element to have the given name.
2293 * @param name the name of this element 2374 * @param name the name of this element
2294 * @param nameOffset the offset of the name of this element in the file that c ontains the 2375 * @param nameOffset the offset of the name of this element in the file that c ontains the
2295 * declaration of this element 2376 * declaration of this element
2296 */ 2377 */
2297 ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nam eOffset) { 2378 ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nam eOffset) {
2298 _jtd_constructor_184_impl(name, nameOffset); 2379 _jtd_constructor_194_impl(name, nameOffset);
2299 } 2380 }
2300 _jtd_constructor_184_impl(String name, int nameOffset) { 2381 _jtd_constructor_194_impl(String name, int nameOffset) {
2301 } 2382 }
2302 ElementImpl getChild(String identifier27) { 2383 ElementImpl getChild(String identifier29) {
2303 for (ExecutableElement function in _functions) { 2384 for (ExecutableElement function in _functions) {
2304 if (((function as ExecutableElementImpl)).identifier == identifier27) { 2385 if (((function as ExecutableElementImpl)).identifier == identifier29) {
2305 return function as ExecutableElementImpl; 2386 return function as ExecutableElementImpl;
2306 } 2387 }
2307 } 2388 }
2308 for (LabelElement label in _labels) { 2389 for (LabelElement label in _labels) {
2309 if (((label as LabelElementImpl)).identifier == identifier27) { 2390 if (((label as LabelElementImpl)).identifier == identifier29) {
2310 return label as LabelElementImpl; 2391 return label as LabelElementImpl;
2311 } 2392 }
2312 } 2393 }
2313 for (VariableElement variable in _localVariables) { 2394 for (VariableElement variable in _localVariables) {
2314 if (((variable as VariableElementImpl)).identifier == identifier27) { 2395 if (((variable as VariableElementImpl)).identifier == identifier29) {
2315 return variable as VariableElementImpl; 2396 return variable as VariableElementImpl;
2316 } 2397 }
2317 } 2398 }
2318 for (ParameterElement parameter in _parameters) { 2399 for (ParameterElement parameter in _parameters) {
2319 if (((parameter as ParameterElementImpl)).identifier == identifier27) { 2400 if (((parameter as ParameterElementImpl)).identifier == identifier29) {
2320 return parameter as ParameterElementImpl; 2401 return parameter as ParameterElementImpl;
2321 } 2402 }
2322 } 2403 }
2323 return null; 2404 return null;
2324 } 2405 }
2325 List<FunctionElement> get functions => _functions; 2406 List<FunctionElement> get functions => _functions;
2326 List<LabelElement> get labels => _labels; 2407 List<LabelElement> get labels => _labels;
2327 List<LocalVariableElement> get localVariables => _localVariables; 2408 List<LocalVariableElement> get localVariables => _localVariables;
2328 List<ParameterElement> get parameters => _parameters; 2409 List<ParameterElement> get parameters => _parameters;
2329 FunctionType get type => _type; 2410 FunctionType get type => _type;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme nt { 2556 class FieldElementImpl extends PropertyInducingElementImpl implements FieldEleme nt {
2476 /** 2557 /**
2477 * An empty array of field elements. 2558 * An empty array of field elements.
2478 */ 2559 */
2479 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0); 2560 static List<FieldElement> EMPTY_ARRAY = new List<FieldElement>(0);
2480 /** 2561 /**
2481 * Initialize a newly created field element to have the given name. 2562 * Initialize a newly created field element to have the given name.
2482 * @param name the name of this element 2563 * @param name the name of this element
2483 */ 2564 */
2484 FieldElementImpl.con1(Identifier name) : super.con1(name) { 2565 FieldElementImpl.con1(Identifier name) : super.con1(name) {
2485 _jtd_constructor_187_impl(name); 2566 _jtd_constructor_197_impl(name);
2486 } 2567 }
2487 _jtd_constructor_187_impl(Identifier name) { 2568 _jtd_constructor_197_impl(Identifier name) {
2488 } 2569 }
2489 /** 2570 /**
2490 * Initialize a newly created synthetic field element to have the given name. 2571 * Initialize a newly created synthetic field element to have the given name.
2491 * @param name the name of this element 2572 * @param name the name of this element
2492 */ 2573 */
2493 FieldElementImpl.con2(String name) : super.con2(name) { 2574 FieldElementImpl.con2(String name) : super.con2(name) {
2494 _jtd_constructor_188_impl(name); 2575 _jtd_constructor_198_impl(name);
2495 } 2576 }
2496 _jtd_constructor_188_impl(String name) { 2577 _jtd_constructor_198_impl(String name) {
2497 } 2578 }
2498 accept(ElementVisitor visitor) => visitor.visitFieldElement(this); 2579 accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
2499 ClassElement get enclosingElement => super.enclosingElement as ClassElement; 2580 ClassElement get enclosingElement => super.enclosingElement as ClassElement;
2500 ElementKind get kind => ElementKind.FIELD; 2581 ElementKind get kind => ElementKind.FIELD;
2501 bool isStatic() => hasModifier(Modifier.STATIC); 2582 bool isStatic() => hasModifier(Modifier.STATIC);
2502 /** 2583 /**
2503 * Set whether this field is static to correspond to the given value. 2584 * Set whether this field is static to correspond to the given value.
2504 * @param isStatic {@code true} if the field is static 2585 * @param isStatic {@code true} if the field is static
2505 */ 2586 */
2506 void set static(bool isStatic) { 2587 void set static(bool isStatic) {
2507 setModifier(Modifier.STATIC, isStatic); 2588 setModifier(Modifier.STATIC, isStatic);
2508 } 2589 }
2509 } 2590 }
2510 /** 2591 /**
2592 * Instances of the class {@code FieldFormalParameterElementImpl} extend{@link P arameterElementImpl} to provide the additional information of the {@link FieldEl ement}associated with the parameter.
2593 * @coverage dart.engine.element
2594 */
2595 class FieldFormalParameterElementImpl extends ParameterElementImpl implements Fi eldFormalParameterElement {
2596 /**
2597 * The field associated with this field formal parameter.
2598 */
2599 FieldElement _field;
2600 /**
2601 * Initialize a newly created parameter element to have the given name.
2602 * @param name the name of this element
2603 */
2604 FieldFormalParameterElementImpl(Identifier name) : super(name) {
2605 }
2606 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi s);
2607 FieldElement get field => _field;
2608 /**
2609 * Set the field element associated with this field formal parameter to the gi ven element.
2610 * @param field the new field element
2611 */
2612 void set field(FieldElement field2) {
2613 this._field = field2;
2614 }
2615 }
2616 /**
2511 * Instances of the class {@code FunctionElementImpl} implement a {@code Functio nElement}. 2617 * Instances of the class {@code FunctionElementImpl} implement a {@code Functio nElement}.
2512 * @coverage dart.engine.element 2618 * @coverage dart.engine.element
2513 */ 2619 */
2514 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme nt { 2620 class FunctionElementImpl extends ExecutableElementImpl implements FunctionEleme nt {
2515 /** 2621 /**
2516 * The offset to the beginning of the visible range for this element. 2622 * The offset to the beginning of the visible range for this element.
2517 */ 2623 */
2518 int _visibleRangeOffset = 0; 2624 int _visibleRangeOffset = 0;
2519 /** 2625 /**
2520 * The length of the visible range for this element, or {@code -1} if this ele ment does not have a 2626 * The length of the visible range for this element, or {@code -1} if this ele ment does not have a
2521 * visible range. 2627 * visible range.
2522 */ 2628 */
2523 int _visibleRangeLength = -1; 2629 int _visibleRangeLength = -1;
2524 /** 2630 /**
2525 * An empty array of function elements. 2631 * An empty array of function elements.
2526 */ 2632 */
2527 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0); 2633 static List<FunctionElement> EMPTY_ARRAY = new List<FunctionElement>(0);
2528 /** 2634 /**
2529 * Initialize a newly created synthetic function element. 2635 * Initialize a newly created synthetic function element.
2530 */ 2636 */
2531 FunctionElementImpl() : super.con2("", -1) { 2637 FunctionElementImpl() : super.con2("", -1) {
2532 _jtd_constructor_189_impl(); 2638 _jtd_constructor_200_impl();
2533 } 2639 }
2534 _jtd_constructor_189_impl() { 2640 _jtd_constructor_200_impl() {
2535 synthetic = true; 2641 synthetic = true;
2536 } 2642 }
2537 /** 2643 /**
2538 * Initialize a newly created function element to have the given name. 2644 * Initialize a newly created function element to have the given name.
2539 * @param name the name of this element 2645 * @param name the name of this element
2540 */ 2646 */
2541 FunctionElementImpl.con1(Identifier name) : super.con1(name) { 2647 FunctionElementImpl.con1(Identifier name) : super.con1(name) {
2542 _jtd_constructor_190_impl(name); 2648 _jtd_constructor_201_impl(name);
2543 } 2649 }
2544 _jtd_constructor_190_impl(Identifier name) { 2650 _jtd_constructor_201_impl(Identifier name) {
2651 }
2652 /**
2653 * Initialize a newly created function element to have no name and the given o ffset. This is used
2654 * for function expressions, which have no name.
2655 * @param nameOffset the offset of the name of this element in the file that c ontains the
2656 * declaration of this element
2657 */
2658 FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) {
2659 _jtd_constructor_202_impl(nameOffset);
2660 }
2661 _jtd_constructor_202_impl(int nameOffset) {
2545 } 2662 }
2546 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this); 2663 accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
2547 String get identifier => name; 2664 String get identifier => name;
2548 ElementKind get kind => ElementKind.FUNCTION; 2665 ElementKind get kind => ElementKind.FUNCTION;
2549 SourceRange get visibleRange { 2666 SourceRange get visibleRange {
2550 if (_visibleRangeLength < 0) { 2667 if (_visibleRangeLength < 0) {
2551 return null; 2668 return null;
2552 } 2669 }
2553 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); 2670 return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
2554 } 2671 }
2555 bool isStatic() => enclosingElement is CompilationUnitElement; 2672 bool isStatic() => enclosingElement is CompilationUnitElement;
2556 /** 2673 /**
2557 * Set the visible range for this element to the range starting at the given o ffset with the given 2674 * Set the visible range for this element to the range starting at the given o ffset with the given
2558 * length. 2675 * length.
2559 * @param offset the offset to the beginning of the visible range for this ele ment 2676 * @param offset the offset to the beginning of the visible range for this ele ment
2560 * @param length the length of the visible range for this element, or {@code - 1} if this element 2677 * @param length the length of the visible range for this element, or {@code - 1} if this element
2561 * does not have a visible range 2678 * does not have a visible range
2562 */ 2679 */
2563 void setVisibleRange(int offset, int length) { 2680 void setVisibleRange(int offset, int length) {
2564 _visibleRangeOffset = offset; 2681 _visibleRangeOffset = offset;
2565 _visibleRangeLength = length; 2682 _visibleRangeLength = length;
2566 } 2683 }
2567 void appendTo(JavaStringBuilder builder) { 2684 void appendTo(JavaStringBuilder builder) {
2568 String name13 = name; 2685 String name15 = name;
2569 if (name13 != null) { 2686 if (name15 != null) {
2570 builder.append(name13); 2687 builder.append(name15);
2571 } 2688 }
2572 super.appendTo(builder); 2689 super.appendTo(builder);
2573 } 2690 }
2574 } 2691 }
2575 /** 2692 /**
2576 * Instances of the class {@code FunctionTypeAliasElementImpl} implement a{@code FunctionTypeAliasElement}. 2693 * Instances of the class {@code FunctionTypeAliasElementImpl} implement a{@code FunctionTypeAliasElement}.
2577 * @coverage dart.engine.element 2694 * @coverage dart.engine.element
2578 */ 2695 */
2579 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl iasElement { 2696 class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAl iasElement {
2580 /** 2697 /**
(...skipping 12 matching lines...) Expand all
2593 * An empty array of type alias elements. 2710 * An empty array of type alias elements.
2594 */ 2711 */
2595 static List<FunctionTypeAliasElement> EMPTY_ARRAY = new List<FunctionTypeAlias Element>(0); 2712 static List<FunctionTypeAliasElement> EMPTY_ARRAY = new List<FunctionTypeAlias Element>(0);
2596 /** 2713 /**
2597 * Initialize a newly created type alias element to have the given name. 2714 * Initialize a newly created type alias element to have the given name.
2598 * @param name the name of this element 2715 * @param name the name of this element
2599 */ 2716 */
2600 FunctionTypeAliasElementImpl(Identifier name) : super.con1(name) { 2717 FunctionTypeAliasElementImpl(Identifier name) : super.con1(name) {
2601 } 2718 }
2602 accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this); 2719 accept(ElementVisitor visitor) => visitor.visitFunctionTypeAliasElement(this);
2603 ElementImpl getChild(String identifier28) { 2720 ElementImpl getChild(String identifier30) {
2604 for (VariableElement parameter in _parameters) { 2721 for (VariableElement parameter in _parameters) {
2605 if (((parameter as VariableElementImpl)).identifier == identifier28) { 2722 if (((parameter as VariableElementImpl)).identifier == identifier30) {
2606 return parameter as VariableElementImpl; 2723 return parameter as VariableElementImpl;
2607 } 2724 }
2608 } 2725 }
2609 for (TypeVariableElement typeVariable in _typeVariables) { 2726 for (TypeVariableElement typeVariable in _typeVariables) {
2610 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier28 ) { 2727 if (((typeVariable as TypeVariableElementImpl)).identifier == identifier30 ) {
2611 return typeVariable as TypeVariableElementImpl; 2728 return typeVariable as TypeVariableElementImpl;
2612 } 2729 }
2613 } 2730 }
2614 return null; 2731 return null;
2615 } 2732 }
2616 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi lationUnitElement; 2733 CompilationUnitElement get enclosingElement => super.enclosingElement as Compi lationUnitElement;
2617 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS; 2734 ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
2618 List<ParameterElement> get parameters => _parameters; 2735 List<ParameterElement> get parameters => _parameters;
2619 FunctionType get type => _type; 2736 FunctionType get type => _type;
2620 List<TypeVariableElement> get typeVariables => _typeVariables; 2737 List<TypeVariableElement> get typeVariables => _typeVariables;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 AnalysisContext get context => _context; 2869 AnalysisContext get context => _context;
2753 ElementKind get kind => ElementKind.HTML; 2870 ElementKind get kind => ElementKind.HTML;
2754 List<HtmlScriptElement> get scripts => _scripts; 2871 List<HtmlScriptElement> get scripts => _scripts;
2755 Source get source => _source; 2872 Source get source => _source;
2756 int get hashCode => _source.hashCode; 2873 int get hashCode => _source.hashCode;
2757 /** 2874 /**
2758 * Set the scripts contained in the HTML file to the given scripts. 2875 * Set the scripts contained in the HTML file to the given scripts.
2759 * @param scripts the scripts 2876 * @param scripts the scripts
2760 */ 2877 */
2761 void set scripts(List<HtmlScriptElement> scripts2) { 2878 void set scripts(List<HtmlScriptElement> scripts2) {
2879 if (scripts2.length == 0) {
2880 scripts2 = HtmlScriptElementImpl.EMPTY_ARRAY;
2881 }
2762 for (HtmlScriptElement script in scripts2) { 2882 for (HtmlScriptElement script in scripts2) {
2763 ((script as HtmlScriptElementImpl)).enclosingElement = this; 2883 ((script as HtmlScriptElementImpl)).enclosingElement = this;
2764 } 2884 }
2765 this._scripts = scripts2; 2885 this._scripts = scripts2;
2766 } 2886 }
2767 /** 2887 /**
2768 * Set the source that corresponds to this HTML file to the given source. 2888 * Set the source that corresponds to this HTML file to the given source.
2769 * @param source the source that corresponds to this HTML file 2889 * @param source the source that corresponds to this HTML file
2770 */ 2890 */
2771 void set source(Source source6) { 2891 void set source(Source source6) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 /** 3087 /**
2968 * Initialize a newly created library element to have the given name. 3088 * Initialize a newly created library element to have the given name.
2969 * @param context the analysis context in which the library is defined 3089 * @param context the analysis context in which the library is defined
2970 * @param name the name of this element 3090 * @param name the name of this element
2971 */ 3091 */
2972 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.co n1(name) { 3092 LibraryElementImpl(AnalysisContext context, LibraryIdentifier name) : super.co n1(name) {
2973 this._context = context; 3093 this._context = context;
2974 } 3094 }
2975 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); 3095 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
2976 bool operator ==(Object object) => object != null && identical(runtimeType, ob ject.runtimeType) && _definingCompilationUnit == ((object as LibraryElementImpl) ).definingCompilationUnit; 3096 bool operator ==(Object object) => object != null && identical(runtimeType, ob ject.runtimeType) && _definingCompilationUnit == ((object as LibraryElementImpl) ).definingCompilationUnit;
2977 ElementImpl getChild(String identifier29) { 3097 ElementImpl getChild(String identifier31) {
2978 if (((_definingCompilationUnit as CompilationUnitElementImpl)).identifier == identifier29) { 3098 if (((_definingCompilationUnit as CompilationUnitElementImpl)).identifier == identifier31) {
2979 return _definingCompilationUnit as CompilationUnitElementImpl; 3099 return _definingCompilationUnit as CompilationUnitElementImpl;
2980 } 3100 }
2981 for (CompilationUnitElement part in _parts) { 3101 for (CompilationUnitElement part in _parts) {
2982 if (((part as CompilationUnitElementImpl)).identifier == identifier29) { 3102 if (((part as CompilationUnitElementImpl)).identifier == identifier31) {
2983 return part as CompilationUnitElementImpl; 3103 return part as CompilationUnitElementImpl;
2984 } 3104 }
2985 } 3105 }
2986 return null; 3106 return null;
2987 } 3107 }
2988 AnalysisContext get context => _context; 3108 AnalysisContext get context => _context;
2989 CompilationUnitElement get definingCompilationUnit => _definingCompilationUnit ; 3109 CompilationUnitElement get definingCompilationUnit => _definingCompilationUnit ;
2990 FunctionElement get entryPoint => _entryPoint; 3110 FunctionElement get entryPoint => _entryPoint;
2991 List<LibraryElement> get exportedLibraries { 3111 List<LibraryElement> get exportedLibraries {
2992 Set<LibraryElement> libraries = new Set<LibraryElement>(); 3112 Set<LibraryElement> libraries = new Set<LibraryElement>();
(...skipping 12 matching lines...) Expand all
3005 for (ImportElement element in _imports) { 3125 for (ImportElement element in _imports) {
3006 LibraryElement library = element.importedLibrary; 3126 LibraryElement library = element.importedLibrary;
3007 if (library != null) { 3127 if (library != null) {
3008 javaSetAdd(libraries, library); 3128 javaSetAdd(libraries, library);
3009 } 3129 }
3010 } 3130 }
3011 return new List.from(libraries); 3131 return new List.from(libraries);
3012 } 3132 }
3013 List<ImportElement> get imports => _imports; 3133 List<ImportElement> get imports => _imports;
3014 ElementKind get kind => ElementKind.LIBRARY; 3134 ElementKind get kind => ElementKind.LIBRARY;
3135 LibraryElement get library => this;
3015 List<CompilationUnitElement> get parts => _parts; 3136 List<CompilationUnitElement> get parts => _parts;
3016 List<PrefixElement> get prefixes { 3137 List<PrefixElement> get prefixes {
3017 Set<PrefixElement> prefixes = new Set<PrefixElement>(); 3138 Set<PrefixElement> prefixes = new Set<PrefixElement>();
3018 for (ImportElement element in _imports) { 3139 for (ImportElement element in _imports) {
3019 PrefixElement prefix4 = element.prefix; 3140 PrefixElement prefix4 = element.prefix;
3020 if (prefix4 != null) { 3141 if (prefix4 != null) {
3021 javaSetAdd(prefixes, prefix4); 3142 javaSetAdd(prefixes, prefix4);
3022 } 3143 }
3023 } 3144 }
3024 return new List.from(prefixes); 3145 return new List.from(prefixes);
3025 } 3146 }
3026 Source get source { 3147 Source get source {
3027 if (_definingCompilationUnit == null) { 3148 if (_definingCompilationUnit == null) {
3028 return null; 3149 return null;
3029 } 3150 }
3030 return _definingCompilationUnit.source; 3151 return _definingCompilationUnit.source;
3031 } 3152 }
3153 ClassElement getType(String className) {
3154 ClassElement type = _definingCompilationUnit.getType(className);
3155 if (type != null) {
3156 return type;
3157 }
3158 for (CompilationUnitElement part in _parts) {
3159 type = part.getType(className);
3160 if (type != null) {
3161 return type;
3162 }
3163 }
3164 return null;
3165 }
3032 int get hashCode => _definingCompilationUnit.hashCode; 3166 int get hashCode => _definingCompilationUnit.hashCode;
3033 bool isBrowserApplication() => _entryPoint != null && isOrImportsBrowserLibrar y(); 3167 bool isBrowserApplication() => _entryPoint != null && isOrImportsBrowserLibrar y();
3034 bool isDartCore() => name == "dart.core"; 3168 bool isDartCore() => name == "dart.core";
3035 bool isUpToDate2(int timeStamp) { 3169 bool isUpToDate2(int timeStamp) {
3036 Set<LibraryElement> visitedLibraries = new Set(); 3170 Set<LibraryElement> visitedLibraries = new Set();
3037 return isUpToDate(this, timeStamp, visitedLibraries); 3171 return isUpToDate(this, timeStamp, visitedLibraries);
3038 } 3172 }
3039 /** 3173 /**
3040 * Set the compilation unit that defines this library to the given compilation unit. 3174 * Set the compilation unit that defines this library to the given compilation unit.
3041 * @param definingCompilationUnit the compilation unit that defines this libra ry 3175 * @param definingCompilationUnit the compilation unit that defines this libra ry
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 safelyVisitChildren(_exports, visitor); 3225 safelyVisitChildren(_exports, visitor);
3092 safelyVisitChildren(_imports, visitor); 3226 safelyVisitChildren(_imports, visitor);
3093 safelyVisitChildren(_parts, visitor); 3227 safelyVisitChildren(_parts, visitor);
3094 } 3228 }
3095 /** 3229 /**
3096 * Answer {@code true} if the receiver directly or indirectly imports the dart :html libraries. 3230 * Answer {@code true} if the receiver directly or indirectly imports the dart :html libraries.
3097 * @return {@code true} if the receiver directly or indirectly imports the dar t:html libraries 3231 * @return {@code true} if the receiver directly or indirectly imports the dar t:html libraries
3098 */ 3232 */
3099 bool isOrImportsBrowserLibrary() { 3233 bool isOrImportsBrowserLibrary() {
3100 List<LibraryElement> visited = new List<LibraryElement>(); 3234 List<LibraryElement> visited = new List<LibraryElement>();
3101 Source htmlLibSource = definingCompilationUnit.source.resolve("dart:html"); 3235 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML);
3102 visited.add(this); 3236 visited.add(this);
3103 for (int index = 0; index < visited.length; index++) { 3237 for (int index = 0; index < visited.length; index++) {
3104 LibraryElement library = visited[index]; 3238 LibraryElement library = visited[index];
3105 Source source10 = library.definingCompilationUnit.source; 3239 Source source14 = library.definingCompilationUnit.source;
3106 if (source10 == htmlLibSource) { 3240 if (source14 == htmlLibSource) {
3107 return true; 3241 return true;
3108 } 3242 }
3109 for (LibraryElement importedLibrary in library.importedLibraries) { 3243 for (LibraryElement importedLibrary in library.importedLibraries) {
3110 if (!visited.contains(importedLibrary)) { 3244 if (!visited.contains(importedLibrary)) {
3111 visited.add(importedLibrary); 3245 visited.add(importedLibrary);
3112 } 3246 }
3113 } 3247 }
3114 for (LibraryElement exportedLibrary in library.exportedLibraries) { 3248 for (LibraryElement exportedLibrary in library.exportedLibraries) {
3115 if (!visited.contains(exportedLibrary)) { 3249 if (!visited.contains(exportedLibrary)) {
3116 visited.add(exportedLibrary); 3250 visited.add(exportedLibrary);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 class MethodElementImpl extends ExecutableElementImpl implements MethodElement { 3310 class MethodElementImpl extends ExecutableElementImpl implements MethodElement {
3177 /** 3311 /**
3178 * An empty array of method elements. 3312 * An empty array of method elements.
3179 */ 3313 */
3180 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0); 3314 static List<MethodElement> EMPTY_ARRAY = new List<MethodElement>(0);
3181 /** 3315 /**
3182 * Initialize a newly created method element to have the given name. 3316 * Initialize a newly created method element to have the given name.
3183 * @param name the name of this element 3317 * @param name the name of this element
3184 */ 3318 */
3185 MethodElementImpl.con1(Identifier name) : super.con1(name) { 3319 MethodElementImpl.con1(Identifier name) : super.con1(name) {
3186 _jtd_constructor_199_impl(name); 3320 _jtd_constructor_211_impl(name);
3187 } 3321 }
3188 _jtd_constructor_199_impl(Identifier name) { 3322 _jtd_constructor_211_impl(Identifier name) {
3189 } 3323 }
3190 /** 3324 /**
3191 * Initialize a newly created method element to have the given name. 3325 * Initialize a newly created method element to have the given name.
3192 * @param name the name of this element 3326 * @param name the name of this element
3193 * @param nameOffset the offset of the name of this element in the file that c ontains the 3327 * @param nameOffset the offset of the name of this element in the file that c ontains the
3194 * declaration of this element 3328 * declaration of this element
3195 */ 3329 */
3196 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff set) { 3330 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff set) {
3197 _jtd_constructor_200_impl(name, nameOffset); 3331 _jtd_constructor_212_impl(name, nameOffset);
3198 } 3332 }
3199 _jtd_constructor_200_impl(String name, int nameOffset) { 3333 _jtd_constructor_212_impl(String name, int nameOffset) {
3200 } 3334 }
3201 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); 3335 accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
3202 ClassElement get enclosingElement => super.enclosingElement as ClassElement; 3336 ClassElement get enclosingElement => super.enclosingElement as ClassElement;
3203 ElementKind get kind => ElementKind.METHOD; 3337 ElementKind get kind => ElementKind.METHOD;
3204 bool isAbstract() => hasModifier(Modifier.ABSTRACT); 3338 bool isAbstract() => hasModifier(Modifier.ABSTRACT);
3205 bool isOperator() { 3339 bool isOperator() {
3206 String name14 = name; 3340 String name16 = name;
3207 if (name14.isEmpty) { 3341 if (name16.isEmpty) {
3208 return false; 3342 return false;
3209 } 3343 }
3210 int first = name14.codeUnitAt(0); 3344 int first = name16.codeUnitAt(0);
3211 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A ) || first == 0x5F || first == 0x24); 3345 return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A ) || first == 0x5F || first == 0x24);
3212 } 3346 }
3213 bool isStatic() => hasModifier(Modifier.STATIC); 3347 bool isStatic() => hasModifier(Modifier.STATIC);
3214 /** 3348 /**
3215 * Set whether this method is abstract to correspond to the given value. 3349 * Set whether this method is abstract to correspond to the given value.
3216 * @param isAbstract {@code true} if the method is abstract 3350 * @param isAbstract {@code true} if the method is abstract
3217 */ 3351 */
3218 void set abstract(bool isAbstract) { 3352 void set abstract(bool isAbstract) {
3219 setModifier(Modifier.ABSTRACT, isAbstract); 3353 setModifier(Modifier.ABSTRACT, isAbstract);
3220 } 3354 }
3221 /** 3355 /**
3222 * Set whether this method is static to correspond to the given value. 3356 * Set whether this method is static to correspond to the given value.
3223 * @param isStatic {@code true} if the method is static 3357 * @param isStatic {@code true} if the method is static
3224 */ 3358 */
3225 void set static(bool isStatic) { 3359 void set static(bool isStatic) {
3226 setModifier(Modifier.STATIC, isStatic); 3360 setModifier(Modifier.STATIC, isStatic);
3227 } 3361 }
3228 void appendTo(JavaStringBuilder builder) { 3362 void appendTo(JavaStringBuilder builder) {
3229 builder.append(enclosingElement.name); 3363 builder.append(enclosingElement.name);
3230 builder.append("."); 3364 builder.append(".");
3231 builder.append(name); 3365 builder.append(name);
3232 super.appendTo(builder); 3366 super.appendTo(builder);
3233 } 3367 }
3234 } 3368 }
3235 /** 3369 /**
3236 * The enumeration {@code Modifier} defines constants for all of the modifiers d efined by the Dart 3370 * The enumeration {@code Modifier} defines constants for all of the modifiers d efined by the Dart
3237 * language and for a few additional flags that are useful. 3371 * language and for a few additional flags that are useful.
3238 * @coverage dart.engine.element 3372 * @coverage dart.engine.element
3239 */ 3373 */
3240 class Modifier { 3374 class Modifier implements Comparable<Modifier> {
3241 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0); 3375 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0);
3242 static final Modifier CONST = new Modifier('CONST', 1); 3376 static final Modifier CONST = new Modifier('CONST', 1);
3243 static final Modifier FACTORY = new Modifier('FACTORY', 2); 3377 static final Modifier FACTORY = new Modifier('FACTORY', 2);
3244 static final Modifier FINAL = new Modifier('FINAL', 3); 3378 static final Modifier FINAL = new Modifier('FINAL', 3);
3245 static final Modifier GETTER = new Modifier('GETTER', 4); 3379 static final Modifier GETTER = new Modifier('GETTER', 4);
3246 static final Modifier INITIALIZING_FORMAL = new Modifier('INITIALIZING_FORMAL' , 5); 3380 static final Modifier INITIALIZING_FORMAL = new Modifier('INITIALIZING_FORMAL' , 5);
3247 static final Modifier MIXIN = new Modifier('MIXIN', 6); 3381 static final Modifier MIXIN = new Modifier('MIXIN', 6);
3248 static final Modifier SETTER = new Modifier('SETTER', 7); 3382 static final Modifier SETTER = new Modifier('SETTER', 7);
3249 static final Modifier STATIC = new Modifier('STATIC', 8); 3383 static final Modifier STATIC = new Modifier('STATIC', 8);
3250 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9); 3384 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9);
3251 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10); 3385 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10);
3252 static final List<Modifier> values = [ABSTRACT, CONST, FACTORY, FINAL, GETTER, INITIALIZING_FORMAL, MIXIN, SETTER, STATIC, SYNTHETIC, TYPEDEF]; 3386 static final List<Modifier> values = [ABSTRACT, CONST, FACTORY, FINAL, GETTER, INITIALIZING_FORMAL, MIXIN, SETTER, STATIC, SYNTHETIC, TYPEDEF];
3253 final String __name; 3387 final String __name;
3254 final int __ordinal; 3388 final int __ordinal;
3255 int get ordinal => __ordinal; 3389 int get ordinal => __ordinal;
3256 Modifier(this.__name, this.__ordinal) { 3390 Modifier(this.__name, this.__ordinal) {
3257 } 3391 }
3392 int compareTo(Modifier other) => __ordinal - other.__ordinal;
3258 String toString() => __name; 3393 String toString() => __name;
3259 } 3394 }
3260 /** 3395 /**
3261 * Instances of the class {@code MultiplyDefinedElementImpl} represent a collect ion of elements that 3396 * Instances of the class {@code MultiplyDefinedElementImpl} represent a collect ion of elements that
3262 * have the same name within the same scope. 3397 * have the same name within the same scope.
3263 * @coverage dart.engine.element 3398 * @coverage dart.engine.element
3264 */ 3399 */
3265 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { 3400 class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
3266 /** 3401 /**
3267 * The analysis context in which the multiply defined elements are defined. 3402 * The analysis context in which the multiply defined elements are defined.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 add(elements, secondElement); 3485 add(elements, secondElement);
3351 return new List.from(elements); 3486 return new List.from(elements);
3352 } 3487 }
3353 } 3488 }
3354 /** 3489 /**
3355 * Instances of the class {@code ParameterElementImpl} implement a {@code Parame terElement}. 3490 * Instances of the class {@code ParameterElementImpl} implement a {@code Parame terElement}.
3356 * @coverage dart.engine.element 3491 * @coverage dart.engine.element
3357 */ 3492 */
3358 class ParameterElementImpl extends VariableElementImpl implements ParameterEleme nt { 3493 class ParameterElementImpl extends VariableElementImpl implements ParameterEleme nt {
3359 /** 3494 /**
3495 * An array containing all of the parameters defined by this parameter element . There will only be
3496 * parameters if this parameter is a function typed parameter.
3497 */
3498 List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
3499 /**
3360 * The kind of this parameter. 3500 * The kind of this parameter.
3361 */ 3501 */
3362 ParameterKind _parameterKind; 3502 ParameterKind _parameterKind;
3363 /** 3503 /**
3364 * The offset to the beginning of the visible range for this element. 3504 * The offset to the beginning of the visible range for this element.
3365 */ 3505 */
3366 int _visibleRangeOffset = 0; 3506 int _visibleRangeOffset = 0;
3367 /** 3507 /**
3368 * The length of the visible range for this element, or {@code -1} if this ele ment does not have a 3508 * The length of the visible range for this element, or {@code -1} if this ele ment does not have a
3369 * visible range. 3509 * visible range.
3370 */ 3510 */
3371 int _visibleRangeLength = -1; 3511 int _visibleRangeLength = -1;
3372 /** 3512 /**
3373 * An empty array of field elements. 3513 * An empty array of field elements.
3374 */ 3514 */
3375 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0); 3515 static List<ParameterElement> EMPTY_ARRAY = new List<ParameterElement>(0);
3376 /** 3516 /**
3377 * Initialize a newly created parameter element to have the given name. 3517 * Initialize a newly created parameter element to have the given name.
3378 * @param name the name of this element 3518 * @param name the name of this element
3379 */ 3519 */
3380 ParameterElementImpl(Identifier name) : super.con1(name) { 3520 ParameterElementImpl(Identifier name) : super.con1(name) {
3381 } 3521 }
3382 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); 3522 accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
3383 ElementKind get kind => ElementKind.PARAMETER; 3523 ElementKind get kind => ElementKind.PARAMETER;
3384 ParameterKind get parameterKind => _parameterKind; 3524 ParameterKind get parameterKind => _parameterKind;
3525 List<ParameterElement> get parameters => _parameters;
3385 SourceRange get visibleRange { 3526 SourceRange get visibleRange {
3386 if (_visibleRangeLength < 0) { 3527 if (_visibleRangeLength < 0) {
3387 return null; 3528 return null;
3388 } 3529 }
3389 return new SourceRange(_visibleRangeOffset, _visibleRangeLength); 3530 return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
3390 } 3531 }
3391 bool isInitializingFormal() => hasModifier(Modifier.INITIALIZING_FORMAL); 3532 bool isInitializingFormal() => hasModifier(Modifier.INITIALIZING_FORMAL);
3392 /** 3533 /**
3393 * Set whether this parameter is an initializing formal parameter to match the given value. 3534 * Set whether this parameter is an initializing formal parameter to match the given value.
3394 * @param isInitializingFormal {@code true} if this parameter is an initializi ng formal parameter 3535 * @param isInitializingFormal {@code true} if this parameter is an initializi ng formal parameter
3395 */ 3536 */
3396 void set initializingFormal(bool isInitializingFormal) { 3537 void set initializingFormal(bool isInitializingFormal) {
3397 setModifier(Modifier.INITIALIZING_FORMAL, isInitializingFormal); 3538 setModifier(Modifier.INITIALIZING_FORMAL, isInitializingFormal);
3398 } 3539 }
3399 /** 3540 /**
3400 * Set the kind of this parameter to the given kind. 3541 * Set the kind of this parameter to the given kind.
3401 * @param parameterKind the new kind of this parameter 3542 * @param parameterKind the new kind of this parameter
3402 */ 3543 */
3403 void set parameterKind(ParameterKind parameterKind2) { 3544 void set parameterKind(ParameterKind parameterKind2) {
3404 this._parameterKind = parameterKind2; 3545 this._parameterKind = parameterKind2;
3405 } 3546 }
3406 /** 3547 /**
3548 * Set the parameters defined by this executable element to the given paramete rs.
3549 * @param parameters the parameters defined by this executable element
3550 */
3551 void set parameters(List<ParameterElement> parameters9) {
3552 for (ParameterElement parameter in parameters9) {
3553 ((parameter as ParameterElementImpl)).enclosingElement = this;
3554 }
3555 this._parameters = parameters9;
3556 }
3557 /**
3407 * Set the visible range for this element to the range starting at the given o ffset with the given 3558 * Set the visible range for this element to the range starting at the given o ffset with the given
3408 * length. 3559 * length.
3409 * @param offset the offset to the beginning of the visible range for this ele ment 3560 * @param offset the offset to the beginning of the visible range for this ele ment
3410 * @param length the length of the visible range for this element, or {@code - 1} if this element 3561 * @param length the length of the visible range for this element, or {@code - 1} if this element
3411 * does not have a visible range 3562 * does not have a visible range
3412 */ 3563 */
3413 void setVisibleRange(int offset, int length) { 3564 void setVisibleRange(int offset, int length) {
3414 _visibleRangeOffset = offset; 3565 _visibleRangeOffset = offset;
3415 _visibleRangeLength = length; 3566 _visibleRangeLength = length;
3416 } 3567 }
3568 void visitChildren(ElementVisitor<Object> visitor) {
3569 super.visitChildren(visitor);
3570 safelyVisitChildren(_parameters, visitor);
3571 }
3417 void appendTo(JavaStringBuilder builder) { 3572 void appendTo(JavaStringBuilder builder) {
3573 String left = "";
3574 String right = "";
3575 while (true) {
3576 if (parameterKind == ParameterKind.NAMED) {
3577 left = "{";
3578 right = "}";
3579 } else if (parameterKind == ParameterKind.POSITIONAL) {
3580 left = "[";
3581 right = "]";
3582 }
3583 break;
3584 }
3585 builder.append(left);
3418 builder.append(type); 3586 builder.append(type);
3419 builder.append(" "); 3587 builder.append(" ");
3420 builder.append(name); 3588 builder.append(name);
3421 builder.append(" ("); 3589 builder.append(right);
3422 builder.append(kind);
3423 builder.append(")");
3424 } 3590 }
3425 } 3591 }
3426 /** 3592 /**
3427 * Instances of the class {@code PrefixElementImpl} implement a {@code PrefixEle ment}. 3593 * Instances of the class {@code PrefixElementImpl} implement a {@code PrefixEle ment}.
3428 * @coverage dart.engine.element 3594 * @coverage dart.engine.element
3429 */ 3595 */
3430 class PrefixElementImpl extends ElementImpl implements PrefixElement { 3596 class PrefixElementImpl extends ElementImpl implements PrefixElement {
3431 /** 3597 /**
3432 * An array containing all of the libraries that are imported using this prefi x. 3598 * An array containing all of the libraries that are imported using this prefi x.
3433 */ 3599 */
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 PropertyInducingElement _variable; 3638 PropertyInducingElement _variable;
3473 /** 3639 /**
3474 * An empty array of property accessor elements. 3640 * An empty array of property accessor elements.
3475 */ 3641 */
3476 static List<PropertyAccessorElement> EMPTY_ARRAY = new List<PropertyAccessorEl ement>(0); 3642 static List<PropertyAccessorElement> EMPTY_ARRAY = new List<PropertyAccessorEl ement>(0);
3477 /** 3643 /**
3478 * Initialize a newly created property accessor element to have the given name . 3644 * Initialize a newly created property accessor element to have the given name .
3479 * @param name the name of this element 3645 * @param name the name of this element
3480 */ 3646 */
3481 PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) { 3647 PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) {
3482 _jtd_constructor_205_impl(name); 3648 _jtd_constructor_217_impl(name);
3483 } 3649 }
3484 _jtd_constructor_205_impl(Identifier name) { 3650 _jtd_constructor_217_impl(Identifier name) {
3485 } 3651 }
3486 /** 3652 /**
3487 * Initialize a newly created synthetic property accessor element to be associ ated with the given 3653 * Initialize a newly created synthetic property accessor element to be associ ated with the given
3488 * variable. 3654 * variable.
3489 * @param variable the variable with which this access is associated 3655 * @param variable the variable with which this access is associated
3490 */ 3656 */
3491 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe r.con2(variable2.name, -1) { 3657 PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : supe r.con2(variable2.name, -1) {
3492 _jtd_constructor_206_impl(variable2); 3658 _jtd_constructor_218_impl(variable2);
3493 } 3659 }
3494 _jtd_constructor_206_impl(PropertyInducingElementImpl variable2) { 3660 _jtd_constructor_218_impl(PropertyInducingElementImpl variable2) {
3495 this._variable = variable2; 3661 this._variable = variable2;
3496 synthetic = true; 3662 synthetic = true;
3497 } 3663 }
3498 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); 3664 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
3499 bool operator ==(Object object) => super == object && identical(isGetter(), (( object as PropertyAccessorElement)).isGetter()); 3665 bool operator ==(Object object) => super == object && identical(isGetter(), (( object as PropertyAccessorElement)).isGetter());
3500 ElementKind get kind { 3666 ElementKind get kind {
3501 if (isGetter()) { 3667 if (isGetter()) {
3502 return ElementKind.GETTER; 3668 return ElementKind.GETTER;
3503 } 3669 }
3504 return ElementKind.SETTER; 3670 return ElementKind.SETTER;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3549 PropertyAccessorElement _setter; 3715 PropertyAccessorElement _setter;
3550 /** 3716 /**
3551 * An empty array of elements. 3717 * An empty array of elements.
3552 */ 3718 */
3553 static List<PropertyInducingElement> EMPTY_ARRAY = new List<PropertyInducingEl ement>(0); 3719 static List<PropertyInducingElement> EMPTY_ARRAY = new List<PropertyInducingEl ement>(0);
3554 /** 3720 /**
3555 * Initialize a newly created element to have the given name. 3721 * Initialize a newly created element to have the given name.
3556 * @param name the name of this element 3722 * @param name the name of this element
3557 */ 3723 */
3558 PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) { 3724 PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) {
3559 _jtd_constructor_207_impl(name); 3725 _jtd_constructor_219_impl(name);
3560 } 3726 }
3561 _jtd_constructor_207_impl(Identifier name) { 3727 _jtd_constructor_219_impl(Identifier name) {
3562 } 3728 }
3563 /** 3729 /**
3564 * Initialize a newly created synthetic element to have the given name. 3730 * Initialize a newly created synthetic element to have the given name.
3565 * @param name the name of this element 3731 * @param name the name of this element
3566 */ 3732 */
3567 PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) { 3733 PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) {
3568 _jtd_constructor_208_impl(name); 3734 _jtd_constructor_220_impl(name);
3569 } 3735 }
3570 _jtd_constructor_208_impl(String name) { 3736 _jtd_constructor_220_impl(String name) {
3571 synthetic = true; 3737 synthetic = true;
3572 } 3738 }
3573 PropertyAccessorElement get getter => _getter; 3739 PropertyAccessorElement get getter => _getter;
3574 PropertyAccessorElement get setter => _setter; 3740 PropertyAccessorElement get setter => _setter;
3575 /** 3741 /**
3576 * Set the getter associated with this element to the given accessor. 3742 * Set the getter associated with this element to the given accessor.
3577 * @param getter the getter associated with this element 3743 * @param getter the getter associated with this element
3578 */ 3744 */
3579 void set getter(PropertyAccessorElement getter2) { 3745 void set getter(PropertyAccessorElement getter2) {
3580 this._getter = getter2; 3746 this._getter = getter2;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
3631 class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements TopLevelVariableElement { 3797 class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements TopLevelVariableElement {
3632 /** 3798 /**
3633 * An empty array of top-level variable elements. 3799 * An empty array of top-level variable elements.
3634 */ 3800 */
3635 static List<TopLevelVariableElement> EMPTY_ARRAY = new List<TopLevelVariableEl ement>(0); 3801 static List<TopLevelVariableElement> EMPTY_ARRAY = new List<TopLevelVariableEl ement>(0);
3636 /** 3802 /**
3637 * Initialize a newly created top-level variable element to have the given nam e. 3803 * Initialize a newly created top-level variable element to have the given nam e.
3638 * @param name the name of this element 3804 * @param name the name of this element
3639 */ 3805 */
3640 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) { 3806 TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) {
3641 _jtd_constructor_210_impl(name); 3807 _jtd_constructor_222_impl(name);
3642 } 3808 }
3643 _jtd_constructor_210_impl(Identifier name) { 3809 _jtd_constructor_222_impl(Identifier name) {
3644 } 3810 }
3645 /** 3811 /**
3646 * Initialize a newly created synthetic top-level variable element to have the given name. 3812 * Initialize a newly created synthetic top-level variable element to have the given name.
3647 * @param name the name of this element 3813 * @param name the name of this element
3648 */ 3814 */
3649 TopLevelVariableElementImpl.con2(String name) : super.con2(name) { 3815 TopLevelVariableElementImpl.con2(String name) : super.con2(name) {
3650 _jtd_constructor_211_impl(name); 3816 _jtd_constructor_223_impl(name);
3651 } 3817 }
3652 _jtd_constructor_211_impl(String name) { 3818 _jtd_constructor_223_impl(String name) {
3653 } 3819 }
3654 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); 3820 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
3655 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; 3821 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
3656 bool isStatic() => true; 3822 bool isStatic() => true;
3657 } 3823 }
3658 /** 3824 /**
3659 * Instances of the class {@code TypeVariableElementImpl} implement a {@code Typ eVariableElement}. 3825 * Instances of the class {@code TypeVariableElementImpl} implement a {@code Typ eVariableElement}.
3660 * @coverage dart.engine.element 3826 * @coverage dart.engine.element
3661 */ 3827 */
3662 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement { 3828 class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
3721 FunctionElement _initializer; 3887 FunctionElement _initializer;
3722 /** 3888 /**
3723 * An empty array of variable elements. 3889 * An empty array of variable elements.
3724 */ 3890 */
3725 static List<VariableElement> EMPTY_ARRAY = new List<VariableElement>(0); 3891 static List<VariableElement> EMPTY_ARRAY = new List<VariableElement>(0);
3726 /** 3892 /**
3727 * Initialize a newly created variable element to have the given name. 3893 * Initialize a newly created variable element to have the given name.
3728 * @param name the name of this element 3894 * @param name the name of this element
3729 */ 3895 */
3730 VariableElementImpl.con1(Identifier name) : super.con1(name) { 3896 VariableElementImpl.con1(Identifier name) : super.con1(name) {
3731 _jtd_constructor_213_impl(name); 3897 _jtd_constructor_225_impl(name);
3732 } 3898 }
3733 _jtd_constructor_213_impl(Identifier name) { 3899 _jtd_constructor_225_impl(Identifier name) {
3734 } 3900 }
3735 /** 3901 /**
3736 * Initialize a newly created variable element to have the given name. 3902 * Initialize a newly created variable element to have the given name.
3737 * @param name the name of this element 3903 * @param name the name of this element
3738 * @param nameOffset the offset of the name of this element in the file that c ontains the 3904 * @param nameOffset the offset of the name of this element in the file that c ontains the
3739 * declaration of this element 3905 * declaration of this element
3740 */ 3906 */
3741 VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameO ffset) { 3907 VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameO ffset) {
3742 _jtd_constructor_214_impl(name, nameOffset); 3908 _jtd_constructor_226_impl(name, nameOffset);
3743 } 3909 }
3744 _jtd_constructor_214_impl(String name, int nameOffset) { 3910 _jtd_constructor_226_impl(String name, int nameOffset) {
3745 } 3911 }
3746 /** 3912 /**
3747 * Return the result of evaluating this variable's initializer as a compile-ti me constant 3913 * Return the result of evaluating this variable's initializer as a compile-ti me constant
3748 * expression, or {@code null} if this variable is not a 'const' variable or d oes not have an 3914 * expression, or {@code null} if this variable is not a 'const' variable or d oes not have an
3749 * initializer. 3915 * initializer.
3750 * @return the result of evaluating this variable's initializer 3916 * @return the result of evaluating this variable's initializer
3751 */ 3917 */
3752 EvaluationResultImpl get evaluationResult => null; 3918 EvaluationResultImpl get evaluationResult => null;
3753 FunctionElement get initializer => _initializer; 3919 FunctionElement get initializer => _initializer;
3754 Type2 get type => _type; 3920 Type2 get type => _type;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
3797 super.visitChildren(visitor); 3963 super.visitChildren(visitor);
3798 safelyVisitChild(_initializer, visitor); 3964 safelyVisitChild(_initializer, visitor);
3799 } 3965 }
3800 void appendTo(JavaStringBuilder builder) { 3966 void appendTo(JavaStringBuilder builder) {
3801 builder.append(type); 3967 builder.append(type);
3802 builder.append(" "); 3968 builder.append(" ");
3803 builder.append(name); 3969 builder.append(name);
3804 } 3970 }
3805 } 3971 }
3806 /** 3972 /**
3973 * The abstract class {@code ExecutableMember} defines the behavior common to me mbers that represent
3974 * an executable element defined in a parameterized type where the values of the type parameters are
3975 * known.
3976 */
3977 abstract class ExecutableMember extends Member implements ExecutableElement {
3978 /**
3979 * Initialize a newly created element to represent an executable element of th e given
3980 * parameterized type.
3981 * @param baseElement the element on which the parameterized element was creat ed
3982 * @param definingType the type in which the element is defined
3983 */
3984 ExecutableMember(ExecutableElement baseElement, InterfaceType definingType) : super(baseElement, definingType) {
3985 }
3986 ExecutableElement get baseElement => super.baseElement as ExecutableElement;
3987 List<FunctionElement> get functions {
3988 throw new UnsupportedOperationException();
3989 }
3990 List<LabelElement> get labels => baseElement.labels;
3991 List<LocalVariableElement> get localVariables {
3992 throw new UnsupportedOperationException();
3993 }
3994 List<ParameterElement> get parameters {
3995 List<ParameterElement> baseParameters = baseElement.parameters;
3996 int parameterCount = baseParameters.length;
3997 if (parameterCount == 0) {
3998 return baseParameters;
3999 }
4000 List<ParameterElement> parameterizedParameters = new List<ParameterElement>( parameterCount);
4001 for (int i = 0; i < parameterCount; i++) {
4002 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin ingType);
4003 }
4004 return parameterizedParameters;
4005 }
4006 FunctionType get type => substituteFor(baseElement.type);
4007 bool isOperator() => baseElement.isOperator();
4008 bool isStatic() => baseElement.isStatic();
4009 }
4010 /**
4011 * Instances of the class {@code FieldMember} represent a field element defined in a parameterized
4012 * type where the values of the type parameters are known.
4013 */
4014 class FieldMember extends VariableMember implements FieldElement {
4015 /**
4016 * If the given field's type is different when any type parameters from the de fining type's
4017 * declaration are replaced with the actual type arguments from the defining t ype, create a field
4018 * member representing the given field. Return the member that was created, or the base field if
4019 * no member was created.
4020 * @param baseField the base field for which a member might be created
4021 * @param definingType the type defining the parameters and arguments to be us ed in the
4022 * substitution
4023 * @return the field element that will return the correctly substituted types
4024 */
4025 static FieldElement from(FieldElement baseField, InterfaceType definingType) {
4026 if (baseField == null || definingType.typeArguments.length == 0) {
4027 return baseField;
4028 }
4029 Type2 baseType = baseField.type;
4030 if (baseType == null) {
4031 return baseField;
4032 }
4033 List<Type2> argumentTypes = definingType.typeArguments;
4034 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem ent.typeVariables);
4035 Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
4036 if (baseType == substitutedType) {
4037 return baseField;
4038 }
4039 return new FieldMember(baseField, definingType);
4040 }
4041 /**
4042 * Initialize a newly created element to represent a field of the given parame terized type.
4043 * @param baseElement the element on which the parameterized element was creat ed
4044 * @param definingType the type in which the element is defined
4045 */
4046 FieldMember(FieldElement baseElement, InterfaceType definingType) : super(base Element, definingType) {
4047 }
4048 FieldElement get baseElement => super.baseElement as FieldElement;
4049 ClassElement get enclosingElement => baseElement.enclosingElement;
4050 PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement. getter, definingType);
4051 PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement. setter, definingType);
4052 bool isStatic() => baseElement.isStatic();
4053 }
4054 /**
4055 * The abstract class {@code Member} defines the behavior common to elements tha t represent members
4056 * of parameterized types.
4057 */
4058 abstract class Member implements Element {
4059 /**
4060 * The element on which the parameterized element was created.
4061 */
4062 Element _baseElement;
4063 /**
4064 * The type in which the element is defined.
4065 */
4066 InterfaceType _definingType;
4067 /**
4068 * Initialize a newly created element to represent the member of the given par ameterized type.
4069 * @param baseElement the element on which the parameterized element was creat ed
4070 * @param definingType the type in which the element is defined
4071 */
4072 Member(Element baseElement, InterfaceType definingType) {
4073 this._baseElement = baseElement;
4074 this._definingType = definingType;
4075 }
4076 accept(ElementVisitor visitor) {
4077 throw new UnsupportedOperationException();
4078 }
4079 Element getAncestor(Type elementClass) => baseElement.getAncestor(elementClass );
4080 /**
4081 * Return the element on which the parameterized element was created.
4082 * @return the element on which the parameterized element was created
4083 */
4084 Element get baseElement => _baseElement;
4085 AnalysisContext get context => _baseElement.context;
4086 ElementKind get kind => _baseElement.kind;
4087 LibraryElement get library => _baseElement.library;
4088 ElementLocation get location => _baseElement.location;
4089 List<Annotation> get metadata {
4090 throw new UnsupportedOperationException();
4091 }
4092 String get name => _baseElement.name;
4093 int get nameOffset => _baseElement.nameOffset;
4094 Source get source => _baseElement.source;
4095 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib rary);
4096 bool isSynthetic() => _baseElement.isSynthetic();
4097 void visitChildren(ElementVisitor<Object> visitor) {
4098 throw new UnsupportedOperationException();
4099 }
4100 /**
4101 * Return the type in which the element is defined.
4102 * @return the type in which the element is defined
4103 */
4104 InterfaceType get definingType => _definingType;
4105 /**
4106 * Return the type that results from replacing the type parameters in the give n type with the type
4107 * arguments.
4108 * @param type the type to be transformed
4109 * @return the result of transforming the type
4110 */
4111 Type2 substituteFor(Type2 type) {
4112 List<Type2> argumentTypes = _definingType.typeArguments;
4113 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(_definingType.ele ment.typeVariables);
4114 return type.substitute2(argumentTypes, parameterTypes) as Type2;
4115 }
4116 /**
4117 * Return the array of types that results from replacing the type parameters i n the given types
4118 * with the type arguments.
4119 * @param types the types to be transformed
4120 * @return the result of transforming the types
4121 */
4122 List<InterfaceType> substituteFor2(List<InterfaceType> types) {
4123 int count = types.length;
4124 List<InterfaceType> substitutedTypes = new List<InterfaceType>(count);
4125 for (int i = 0; i < count; i++) {
4126 substitutedTypes[i] = substituteFor(types[i]);
4127 }
4128 return substitutedTypes;
4129 }
4130 }
4131 /**
4132 * Instances of the class {@code MethodMember} represent a method element define d in a parameterized
4133 * type where the values of the type parameters are known.
4134 */
4135 class MethodMember extends ExecutableMember implements MethodElement {
4136 /**
4137 * If the given method's type is different when any type parameters from the d efining type's
4138 * declaration are replaced with the actual type arguments from the defining t ype, create a method
4139 * member representing the given method. Return the member that was created, o r the base method if
4140 * no member was created.
4141 * @param baseMethod the base method for which a member might be created
4142 * @param definingType the type defining the parameters and arguments to be us ed in the
4143 * substitution
4144 * @return the method element that will return the correctly substituted types
4145 */
4146 static MethodElement from(MethodElement baseMethod, InterfaceType definingType ) {
4147 if (baseMethod == null || definingType.typeArguments.length == 0) {
4148 return baseMethod;
4149 }
4150 FunctionType baseType = baseMethod.type;
4151 List<Type2> argumentTypes = definingType.typeArguments;
4152 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem ent.typeVariables);
4153 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter Types);
4154 if (baseType == substitutedType) {
4155 return baseMethod;
4156 }
4157 return new MethodMember(baseMethod, definingType);
4158 }
4159 /**
4160 * Initialize a newly created element to represent a method of the given param eterized type.
4161 * @param baseElement the element on which the parameterized element was creat ed
4162 * @param definingType the type in which the element is defined
4163 */
4164 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba seElement, definingType) {
4165 }
4166 MethodElement get baseElement => super.baseElement as MethodElement;
4167 ClassElement get enclosingElement => baseElement.enclosingElement;
4168 bool isAbstract() => baseElement.isAbstract();
4169 String toString() {
4170 MethodElement baseElement2 = baseElement;
4171 List<ParameterElement> parameters12 = parameters;
4172 FunctionType type13 = type;
4173 JavaStringBuilder builder = new JavaStringBuilder();
4174 builder.append(baseElement2.enclosingElement.name);
4175 builder.append(".");
4176 builder.append(baseElement2.name);
4177 builder.append("(");
4178 int parameterCount = parameters12.length;
4179 for (int i = 0; i < parameterCount; i++) {
4180 if (i > 0) {
4181 builder.append(", ");
4182 }
4183 builder.append(parameters12[i]).toString();
4184 }
4185 builder.append(")");
4186 if (type13 != null) {
4187 builder.append(" -> ");
4188 builder.append(type13.returnType);
4189 }
4190 return builder.toString();
4191 }
4192 }
4193 /**
4194 * Instances of the class {@code ParameterMember} represent a parameter element defined in a
4195 * parameterized type where the values of the type parameters are known.
4196 */
4197 class ParameterMember extends VariableMember implements ParameterElement {
4198 /**
4199 * If the given parameter's type is different when any type parameters from th e defining type's
4200 * declaration are replaced with the actual type arguments from the defining t ype, create a
4201 * parameter member representing the given parameter. Return the member that w as created, or the
4202 * base parameter if no member was created.
4203 * @param baseParameter the base parameter for which a member might be created
4204 * @param definingType the type defining the parameters and arguments to be us ed in the
4205 * substitution
4206 * @return the parameter element that will return the correctly substituted ty pes
4207 */
4208 static ParameterElement from(ParameterElement baseParameter, InterfaceType def iningType) {
4209 if (baseParameter == null || definingType.typeArguments.length == 0) {
4210 return baseParameter;
4211 }
4212 Type2 baseType = baseParameter.type;
4213 List<Type2> argumentTypes = definingType.typeArguments;
4214 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem ent.typeVariables);
4215 Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
4216 if (baseType == substitutedType) {
4217 return baseParameter;
4218 }
4219 return new ParameterMember(baseParameter, definingType);
4220 }
4221 /**
4222 * Initialize a newly created element to represent a parameter of the given pa rameterized type.
4223 * @param baseElement the element on which the parameterized element was creat ed
4224 * @param definingType the type in which the element is defined
4225 */
4226 ParameterMember(ParameterElement baseElement, InterfaceType definingType) : su per(baseElement, definingType) {
4227 }
4228 Element getAncestor(Type elementClass) {
4229 Element element = baseElement.getAncestor(elementClass);
4230 if (element is MethodElement) {
4231 return MethodMember.from((element as MethodElement), definingType) as Elem ent;
4232 } else if (element is PropertyAccessorElement) {
4233 return PropertyAccessorMember.from((element as PropertyAccessorElement), d efiningType) as Element;
4234 }
4235 return element;
4236 }
4237 ParameterElement get baseElement => super.baseElement as ParameterElement;
4238 Element get enclosingElement => baseElement.enclosingElement;
4239 ParameterKind get parameterKind => baseElement.parameterKind;
4240 List<ParameterElement> get parameters {
4241 List<ParameterElement> baseParameters = baseElement.parameters;
4242 int parameterCount = baseParameters.length;
4243 if (parameterCount == 0) {
4244 return baseParameters;
4245 }
4246 List<ParameterElement> parameterizedParameters = new List<ParameterElement>( parameterCount);
4247 for (int i = 0; i < parameterCount; i++) {
4248 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin ingType);
4249 }
4250 return parameterizedParameters;
4251 }
4252 SourceRange get visibleRange => baseElement.visibleRange;
4253 bool isInitializingFormal() => baseElement.isInitializingFormal();
4254 String toString() {
4255 ParameterElement baseElement3 = baseElement;
4256 String left = "";
4257 String right = "";
4258 while (true) {
4259 if (baseElement3.parameterKind == ParameterKind.NAMED) {
4260 left = "{";
4261 right = "}";
4262 } else if (baseElement3.parameterKind == ParameterKind.POSITIONAL) {
4263 left = "[";
4264 right = "]";
4265 }
4266 break;
4267 }
4268 JavaStringBuilder builder = new JavaStringBuilder();
4269 builder.append(left);
4270 builder.append(type);
4271 builder.append(" ");
4272 builder.append(baseElement3.name);
4273 builder.append(right);
4274 return builder.toString();
4275 }
4276 }
4277 /**
4278 * Instances of the class {@code PropertyAccessorMember} represent a property ac cessor element
4279 * defined in a parameterized type where the values of the type parameters are k nown.
4280 */
4281 class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso rElement {
4282 /**
4283 * If the given property accessor's type is different when any type parameters from the defining
4284 * type's declaration are replaced with the actual type arguments from the def ining type, create a
4285 * property accessor member representing the given property accessor. Return t he member that was
4286 * created, or the base accessor if no member was created.
4287 * @param baseAccessor the base property accessor for which a member might be created
4288 * @param definingType the type defining the parameters and arguments to be us ed in the
4289 * substitution
4290 * @return the property accessor element that will return the correctly substi tuted types
4291 */
4292 static PropertyAccessorElement from(PropertyAccessorElement baseAccessor, Inte rfaceType definingType) {
4293 if (baseAccessor == null || definingType.typeArguments.length == 0) {
4294 return baseAccessor;
4295 }
4296 FunctionType baseType = baseAccessor.type;
4297 List<Type2> argumentTypes = definingType.typeArguments;
4298 List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.elem ent.typeVariables);
4299 FunctionType substitutedType = baseType.substitute2(argumentTypes, parameter Types);
4300 if (baseType == substitutedType) {
4301 return baseAccessor;
4302 }
4303 return new PropertyAccessorMember(baseAccessor, definingType);
4304 }
4305 /**
4306 * Initialize a newly created element to represent a property accessor of the given parameterized
4307 * type.
4308 * @param baseElement the element on which the parameterized element was creat ed
4309 * @param definingType the type in which the element is defined
4310 */
4311 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi ningType) : super(baseElement, definingType) {
4312 }
4313 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess orElement;
4314 Element get enclosingElement => baseElement.enclosingElement;
4315 PropertyInducingElement get variable {
4316 PropertyInducingElement variable4 = baseElement.variable;
4317 if (variable4 is FieldElement) {
4318 return FieldMember.from(((variable4 as FieldElement)), definingType);
4319 }
4320 return variable4;
4321 }
4322 bool isGetter() => baseElement.isGetter();
4323 bool isSetter() => baseElement.isSetter();
4324 }
4325 /**
4326 * The abstract class {@code VariableMember} defines the behavior common to memb ers that represent a
4327 * variable element defined in a parameterized type where the values of the type parameters are
4328 * known.
4329 */
4330 abstract class VariableMember extends Member implements VariableElement {
4331 /**
4332 * Initialize a newly created element to represent an executable element of th e given
4333 * parameterized type.
4334 * @param baseElement the element on which the parameterized element was creat ed
4335 * @param definingType the type in which the element is defined
4336 */
4337 VariableMember(VariableElement baseElement, InterfaceType definingType) : supe r(baseElement, definingType) {
4338 }
4339 VariableElement get baseElement => super.baseElement as VariableElement;
4340 FunctionElement get initializer {
4341 throw new UnsupportedOperationException();
4342 }
4343 Type2 get type => substituteFor(baseElement.type);
4344 bool isConst() => baseElement.isConst();
4345 bool isFinal() => baseElement.isFinal();
4346 }
4347 /**
3807 * The unique instance of the class {@code BottomTypeImpl} implements the type { @code bottom}. 4348 * The unique instance of the class {@code BottomTypeImpl} implements the type { @code bottom}.
3808 * @coverage dart.engine.type 4349 * @coverage dart.engine.type
3809 */ 4350 */
3810 class BottomTypeImpl extends TypeImpl { 4351 class BottomTypeImpl extends TypeImpl {
3811 /** 4352 /**
3812 * The unique instance of this class. 4353 * The unique instance of this class.
3813 */ 4354 */
3814 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); 4355 static BottomTypeImpl _INSTANCE = new BottomTypeImpl();
3815 /** 4356 /**
3816 * Return the unique instance of this class. 4357 * Return the unique instance of this class.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3927 /** 4468 /**
3928 * The type of object returned by this type of function. 4469 * The type of object returned by this type of function.
3929 */ 4470 */
3930 Type2 _returnType = VoidTypeImpl.instance; 4471 Type2 _returnType = VoidTypeImpl.instance;
3931 /** 4472 /**
3932 * Initialize a newly created function type to be declared by the given elemen t and to have the 4473 * Initialize a newly created function type to be declared by the given elemen t and to have the
3933 * given name. 4474 * given name.
3934 * @param element the element representing the declaration of the function typ e 4475 * @param element the element representing the declaration of the function typ e
3935 */ 4476 */
3936 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n ull ? null : element.name) { 4477 FunctionTypeImpl.con1(ExecutableElement element) : super(element, element == n ull ? null : element.name) {
3937 _jtd_constructor_265_impl(element); 4478 _jtd_constructor_290_impl(element);
3938 } 4479 }
3939 _jtd_constructor_265_impl(ExecutableElement element) { 4480 _jtd_constructor_290_impl(ExecutableElement element) {
3940 } 4481 }
3941 /** 4482 /**
3942 * Initialize a newly created function type to be declared by the given elemen t and to have the 4483 * Initialize a newly created function type to be declared by the given elemen t and to have the
3943 * given name. 4484 * given name.
3944 * @param element the element representing the declaration of the function typ e 4485 * @param element the element representing the declaration of the function typ e
3945 */ 4486 */
3946 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme nt == null ? null : element.name) { 4487 FunctionTypeImpl.con2(FunctionTypeAliasElement element) : super(element, eleme nt == null ? null : element.name) {
3947 _jtd_constructor_266_impl(element); 4488 _jtd_constructor_291_impl(element);
3948 } 4489 }
3949 _jtd_constructor_266_impl(FunctionTypeAliasElement element) { 4490 _jtd_constructor_291_impl(FunctionTypeAliasElement element) {
3950 } 4491 }
3951 bool operator ==(Object object) { 4492 bool operator ==(Object object) {
3952 if (object is! FunctionTypeImpl) { 4493 if (object is! FunctionTypeImpl) {
3953 return false; 4494 return false;
3954 } 4495 }
3955 FunctionTypeImpl otherType = object as FunctionTypeImpl; 4496 FunctionTypeImpl otherType = object as FunctionTypeImpl;
3956 return element == otherType.element && JavaArrays.equals(_normalParameterTyp es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType ._namedParameterTypes); 4497 return element == otherType.element && JavaArrays.equals(_normalParameterTyp es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType ._namedParameterTypes) && _returnType == otherType._returnType;
3957 } 4498 }
3958 Map<String, Type2> get namedParameterTypes => _namedParameterTypes; 4499 Map<String, Type2> get namedParameterTypes => _namedParameterTypes;
3959 List<Type2> get normalParameterTypes => _normalParameterTypes; 4500 List<Type2> get normalParameterTypes => _normalParameterTypes;
3960 List<Type2> get optionalParameterTypes => _optionalParameterTypes; 4501 List<Type2> get optionalParameterTypes => _optionalParameterTypes;
3961 Type2 get returnType => _returnType; 4502 Type2 get returnType => _returnType;
3962 List<Type2> get typeArguments => _typeArguments; 4503 List<Type2> get typeArguments => _typeArguments;
3963 int get hashCode { 4504 int get hashCode {
3964 Element element44 = element; 4505 Element element53 = element;
3965 if (element44 == null) { 4506 if (element53 == null) {
3966 return 0; 4507 return 0;
3967 } 4508 }
3968 return element44.hashCode; 4509 return element53.hashCode;
3969 } 4510 }
3970 bool isSubtypeOf(Type2 type) { 4511 bool isSubtypeOf(Type2 type) {
3971 if (type == null) { 4512 if (type == null) {
3972 return false; 4513 return false;
3973 } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunct ion()) { 4514 } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunct ion()) {
3974 return true; 4515 return true;
3975 } else if (type is! FunctionType) { 4516 } else if (type is! FunctionType) {
3976 return false; 4517 return false;
3977 } else if (this == type) { 4518 } else if (this == type) {
3978 return true; 4519 return true;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
4069 this._typeArguments = typeArguments4; 4610 this._typeArguments = typeArguments4;
4070 } 4611 }
4071 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen tTypes, typeArguments); 4612 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen tTypes, typeArguments);
4072 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT ypes) { 4613 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT ypes) {
4073 if (argumentTypes.length != parameterTypes.length) { 4614 if (argumentTypes.length != parameterTypes.length) {
4074 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes. length}) != parameterTypes.length (${parameterTypes.length})"); 4615 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes. length}) != parameterTypes.length (${parameterTypes.length})");
4075 } 4616 }
4076 if (argumentTypes.length == 0) { 4617 if (argumentTypes.length == 0) {
4077 return this; 4618 return this;
4078 } 4619 }
4079 Element element45 = element; 4620 Element element54 = element;
4080 FunctionTypeImpl newType = (element45 is ExecutableElement) ? new FunctionTy peImpl.con1((element45 as ExecutableElement)) : new FunctionTypeImpl.con2((eleme nt45 as FunctionTypeAliasElement)); 4621 FunctionTypeImpl newType = (element54 is ExecutableElement) ? new FunctionTy peImpl.con1((element54 as ExecutableElement)) : new FunctionTypeImpl.con2((eleme nt54 as FunctionTypeAliasElement));
4081 newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes); 4622 newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes);
4082 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar gumentTypes, parameterTypes); 4623 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar gumentTypes, parameterTypes);
4083 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes , argumentTypes, parameterTypes); 4624 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes , argumentTypes, parameterTypes);
4084 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp es, parameterTypes); 4625 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp es, parameterTypes);
4085 return newType; 4626 return newType;
4086 } 4627 }
4087 void appendTo(JavaStringBuilder builder) { 4628 void appendTo(JavaStringBuilder builder) {
4088 builder.append("("); 4629 builder.append("(");
4089 bool needsComma = false; 4630 bool needsComma = false;
4090 if (_normalParameterTypes.length > 0) { 4631 if (_normalParameterTypes.length > 0) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 /** 4744 /**
4204 * Returns the set of all superinterfaces of the passed {@link Type}. This is a recursive method, 4745 * Returns the set of all superinterfaces of the passed {@link Type}. This is a recursive method,
4205 * callers should call the public {@link #computeSuperinterfaceSet(Type)}. 4746 * callers should call the public {@link #computeSuperinterfaceSet(Type)}.
4206 * @param type the {@link Type} to compute the set of superinterfaces of 4747 * @param type the {@link Type} to compute the set of superinterfaces of
4207 * @param set a {@link HashSet} used recursively by this method 4748 * @param set a {@link HashSet} used recursively by this method
4208 * @return the {@link Set} of superinterfaces of the passed {@link Type} 4749 * @return the {@link Set} of superinterfaces of the passed {@link Type}
4209 * @see #computeSuperinterfaceSet(Type) 4750 * @see #computeSuperinterfaceSet(Type)
4210 * @see #getLeastUpperBound(Type) 4751 * @see #getLeastUpperBound(Type)
4211 */ 4752 */
4212 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In terfaceType> set) { 4753 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In terfaceType> set) {
4213 Element element46 = type.element; 4754 Element element55 = type.element;
4214 if (element46 != null && element46 is ClassElement) { 4755 if (element55 != null && element55 is ClassElement) {
4215 ClassElement classElement = element46 as ClassElement; 4756 ClassElement classElement = element55 as ClassElement;
4216 List<InterfaceType> superinterfaces = classElement.interfaces; 4757 List<InterfaceType> superinterfaces = classElement.interfaces;
4217 for (InterfaceType superinterface in superinterfaces) { 4758 for (InterfaceType superinterface in superinterfaces) {
4218 javaSetAdd(set, superinterface); 4759 javaSetAdd(set, superinterface);
4219 computeSuperinterfaceSet2(superinterface, set); 4760 computeSuperinterfaceSet2(superinterface, set);
4220 } 4761 }
4221 InterfaceType supertype4 = classElement.supertype; 4762 InterfaceType supertype4 = classElement.supertype;
4222 if (supertype4 != null) { 4763 if (supertype4 != null) {
4223 javaSetAdd(set, supertype4); 4764 javaSetAdd(set, supertype4);
4224 computeSuperinterfaceSet2(supertype4, set); 4765 computeSuperinterfaceSet2(supertype4, set);
4225 } 4766 }
4226 } 4767 }
4227 return set; 4768 return set;
4228 } 4769 }
4229 /** 4770 /**
4230 * An array containing the actual types of the type arguments. 4771 * An array containing the actual types of the type arguments.
4231 */ 4772 */
4232 List<Type2> _typeArguments = TypeImpl.EMPTY_ARRAY; 4773 List<Type2> _typeArguments = TypeImpl.EMPTY_ARRAY;
4233 /** 4774 /**
4234 * Initialize a newly created type to be declared by the given element. 4775 * Initialize a newly created type to be declared by the given element.
4235 * @param element the element representing the declaration of the type 4776 * @param element the element representing the declaration of the type
4236 */ 4777 */
4237 InterfaceTypeImpl.con1(ClassElement element) : super(element, element.name) { 4778 InterfaceTypeImpl.con1(ClassElement element) : super(element, element.name) {
4238 _jtd_constructor_267_impl(element); 4779 _jtd_constructor_292_impl(element);
4239 } 4780 }
4240 _jtd_constructor_267_impl(ClassElement element) { 4781 _jtd_constructor_292_impl(ClassElement element) {
4241 } 4782 }
4242 /** 4783 /**
4243 * Initialize a newly created type to have the given name. This constructor sh ould only be used in 4784 * Initialize a newly created type to have the given name. This constructor sh ould only be used in
4244 * cases where there is no declaration of the type. 4785 * cases where there is no declaration of the type.
4245 * @param name the name of the type 4786 * @param name the name of the type
4246 */ 4787 */
4247 InterfaceTypeImpl.con2(String name) : super(null, name) { 4788 InterfaceTypeImpl.con2(String name) : super(null, name) {
4248 _jtd_constructor_268_impl(name); 4789 _jtd_constructor_293_impl(name);
4249 } 4790 }
4250 _jtd_constructor_268_impl(String name) { 4791 _jtd_constructor_293_impl(String name) {
4251 } 4792 }
4252 bool operator ==(Object object) { 4793 bool operator ==(Object object) {
4253 if (object is! InterfaceTypeImpl) { 4794 if (object is! InterfaceTypeImpl) {
4254 return false; 4795 return false;
4255 } 4796 }
4256 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; 4797 InterfaceTypeImpl otherType = object as InterfaceTypeImpl;
4257 return element == otherType.element && JavaArrays.equals(_typeArguments, oth erType._typeArguments); 4798 return element == otherType.element && JavaArrays.equals(_typeArguments, oth erType._typeArguments);
4258 } 4799 }
4259 ClassElement get element => super.element as ClassElement; 4800 ClassElement get element => super.element as ClassElement;
4260 Type2 getLeastUpperBound(Type2 type) { 4801 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember .from(((element as ClassElementImpl)).getGetter(getterName), this);
4802 List<InterfaceType> get interfaces {
4803 ClassElement classElement = element;
4804 List<InterfaceType> interfaces4 = classElement.interfaces;
4805 List<TypeVariableElement> typeVariables7 = classElement.typeVariables;
4806 if (typeVariables7.length == 0) {
4807 return interfaces4;
4808 }
4809 int count = interfaces4.length;
4810 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count);
4811 for (int i = 0; i < count; i++) {
4812 typedInterfaces[i] = interfaces4[i].substitute2(_typeArguments, TypeVariab leTypeImpl.getTypes(typeVariables7));
4813 }
4814 return typedInterfaces;
4815 }
4816 Type2 getLeastUpperBound(Type2 type39) {
4261 Type2 dynamicType = DynamicTypeImpl.instance; 4817 Type2 dynamicType = DynamicTypeImpl.instance;
4262 if (identical(this, dynamicType) || identical(type, dynamicType)) { 4818 if (identical(this, dynamicType) || identical(type39, dynamicType)) {
4263 return dynamicType; 4819 return dynamicType;
4264 } 4820 }
4265 if (type == null || type is! InterfaceType) { 4821 if (type39 == null || type39 is! InterfaceType) {
4266 return null; 4822 return null;
4267 } 4823 }
4268 InterfaceType i = this; 4824 InterfaceType i = this;
4269 InterfaceType j = type as InterfaceType; 4825 InterfaceType j = type39 as InterfaceType;
4270 Set<InterfaceType> si = computeSuperinterfaceSet(i); 4826 Set<InterfaceType> si = computeSuperinterfaceSet(i);
4271 Set<InterfaceType> sj = computeSuperinterfaceSet(j); 4827 Set<InterfaceType> sj = computeSuperinterfaceSet(j);
4272 javaSetAdd(si, i); 4828 javaSetAdd(si, i.element.type);
4273 javaSetAdd(sj, j); 4829 javaSetAdd(sj, j.element.type);
4274 si.retainAll(sj); 4830 si.retainAll(sj);
4275 Set<InterfaceType> s = si; 4831 Set<InterfaceType> s = si;
4276 List<InterfaceType> sn = new List.from(s); 4832 List<InterfaceType> sn = new List.from(s);
4277 List<int> depths = new List<int>.filled(sn.length, 0); 4833 List<int> depths = new List<int>.filled(sn.length, 0);
4278 int maxDepth = 0; 4834 int maxDepth = 0;
4279 for (int n = 0; n < sn.length; n++) { 4835 for (int n = 0; n < sn.length; n++) {
4280 depths[n] = computeLongestInheritancePathToObject(sn[n]); 4836 depths[n] = computeLongestInheritancePathToObject(sn[n]);
4281 if (depths[n] > maxDepth) { 4837 if (depths[n] > maxDepth) {
4282 maxDepth = depths[n]; 4838 maxDepth = depths[n];
4283 } 4839 }
4284 } 4840 }
4285 for (; maxDepth >= 0; maxDepth--) { 4841 for (; maxDepth >= 0; maxDepth--) {
4286 int indexOfLeastUpperBound = -1; 4842 int indexOfLeastUpperBound = -1;
4287 int numberOfTypesAtMaxDepth = 0; 4843 int numberOfTypesAtMaxDepth = 0;
4288 for (int m = 0; m < depths.length; m++) { 4844 for (int m = 0; m < depths.length; m++) {
4289 if (depths[m] == maxDepth) { 4845 if (depths[m] == maxDepth) {
4290 numberOfTypesAtMaxDepth++; 4846 numberOfTypesAtMaxDepth++;
4291 indexOfLeastUpperBound = m; 4847 indexOfLeastUpperBound = m;
4292 } 4848 }
4293 } 4849 }
4294 if (numberOfTypesAtMaxDepth == 1) { 4850 if (numberOfTypesAtMaxDepth == 1) {
4295 return sn[indexOfLeastUpperBound]; 4851 return sn[indexOfLeastUpperBound];
4296 } 4852 }
4297 } 4853 }
4298 return null; 4854 return null;
4299 } 4855 }
4300 Type2 get superclass { 4856 MethodElement getMethod(String methodName) => MethodMember.from(((element as C lassElementImpl)).getMethod(methodName), this);
4857 List<InterfaceType> get mixins {
4301 ClassElement classElement = element; 4858 ClassElement classElement = element;
4302 return element.supertype.substitute2(_typeArguments, TypeVariableTypeImpl.ge tTypes(classElement.typeVariables)); 4859 List<InterfaceType> mixins3 = classElement.mixins;
4860 List<TypeVariableElement> typeVariables8 = classElement.typeVariables;
4861 if (typeVariables8.length == 0) {
4862 return mixins3;
4863 }
4864 int count = mixins3.length;
4865 List<InterfaceType> typedMixins = new List<InterfaceType>(count);
4866 for (int i = 0; i < count; i++) {
4867 typedMixins[i] = mixins3[i].substitute2(_typeArguments, TypeVariableTypeIm pl.getTypes(typeVariables8));
4868 }
4869 return typedMixins;
4870 }
4871 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember .from(((element as ClassElementImpl)).getSetter(setterName), this);
4872 InterfaceType get superclass {
4873 ClassElement classElement = element;
4874 InterfaceType supertype5 = classElement.supertype;
4875 if (supertype5 == null) {
4876 return null;
4877 }
4878 return supertype5.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes( classElement.typeVariables));
4303 } 4879 }
4304 List<Type2> get typeArguments => _typeArguments; 4880 List<Type2> get typeArguments => _typeArguments;
4305 int get hashCode { 4881 int get hashCode {
4306 ClassElement element47 = element; 4882 ClassElement element56 = element;
4307 if (element47 == null) { 4883 if (element56 == null) {
4308 return 0; 4884 return 0;
4309 } 4885 }
4310 return element47.hashCode; 4886 return element56.hashCode;
4311 } 4887 }
4312 bool isDartCoreFunction() { 4888 bool isDartCoreFunction() {
4313 ClassElement element48 = element; 4889 ClassElement element57 = element;
4314 if (element48 == null) { 4890 if (element57 == null) {
4315 return false; 4891 return false;
4316 } 4892 }
4317 return element48.name == "Function" && element48.library.isDartCore(); 4893 return element57.name == "Function" && element57.library.isDartCore();
4318 } 4894 }
4319 bool isDirectSupertypeOf(InterfaceType type) { 4895 bool isDirectSupertypeOf(InterfaceType type) {
4320 ClassElement i = element; 4896 ClassElement i = element;
4321 ClassElement j = type.element; 4897 ClassElement j = type.element;
4322 InterfaceType supertype5 = j.supertype; 4898 InterfaceType supertype6 = j.supertype;
4323 if (supertype5 == null) { 4899 if (supertype6 == null) {
4324 return false; 4900 return false;
4325 } 4901 }
4326 ClassElement supertypeElement = supertype5.element; 4902 ClassElement supertypeElement = supertype6.element;
4327 if (supertypeElement == i) { 4903 if (supertypeElement == i) {
4328 return true; 4904 return true;
4329 } 4905 }
4330 for (InterfaceType interfaceType in j.interfaces) { 4906 for (InterfaceType interfaceType in j.interfaces) {
4331 if (interfaceType.element == i) { 4907 if (interfaceType.element == i) {
4332 return true; 4908 return true;
4333 } 4909 }
4334 } 4910 }
4335 for (InterfaceType mixinType in j.mixins) { 4911 for (InterfaceType mixinType in j.mixins) {
4336 if (mixinType.element == i) { 4912 if (mixinType.element == i) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 if (typeTArgs.length != typeSArgs.length) { 4973 if (typeTArgs.length != typeSArgs.length) {
4398 return false; 4974 return false;
4399 } 4975 }
4400 for (int i = 0; i < typeTArgs.length; i++) { 4976 for (int i = 0; i < typeTArgs.length; i++) {
4401 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { 4977 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) {
4402 return false; 4978 return false;
4403 } 4979 }
4404 } 4980 }
4405 return true; 4981 return true;
4406 } 4982 }
4407 Type2 supertype6 = elementT.supertype; 4983 Type2 supertype7 = elementT.supertype;
4408 if (supertype6 == null) { 4984 if (supertype7 == null) {
4409 return false; 4985 return false;
4410 } 4986 }
4411 List<Type2> interfaceTypes = elementT.interfaces; 4987 List<Type2> interfaceTypes = elementT.interfaces;
4412 for (Type2 interfaceType in interfaceTypes) { 4988 for (Type2 interfaceType in interfaceTypes) {
4413 if (interfaceType.isSubtypeOf(typeS)) { 4989 if (interfaceType.isSubtypeOf(typeS)) {
4414 return true; 4990 return true;
4415 } 4991 }
4416 } 4992 }
4417 List<Type2> mixinTypes = elementT.mixins; 4993 List<Type2> mixinTypes = elementT.mixins;
4418 for (Type2 mixinType in mixinTypes) { 4994 for (Type2 mixinType in mixinTypes) {
4419 if (mixinType == typeS) { 4995 if (mixinType == typeS) {
4420 return true; 4996 return true;
4421 } 4997 }
4422 } 4998 }
4423 return supertype6.isSubtypeOf(typeS); 4999 return supertype7.isSubtypeOf(typeS);
5000 }
5001 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ) {
5002 PropertyAccessorElement element = getGetter(getterName);
5003 if (element != null && element.isAccessibleIn(library)) {
5004 return element;
5005 }
5006 for (InterfaceType mixin in mixins) {
5007 element = mixin.getGetter(getterName);
5008 if (element != null && element.isAccessibleIn(library)) {
5009 return element;
5010 }
5011 }
5012 InterfaceType supertype = superclass;
5013 while (supertype != null) {
5014 element = supertype.getGetter(getterName);
5015 if (element != null && element.isAccessibleIn(library)) {
5016 return element;
5017 }
5018 supertype = supertype.superclass;
5019 }
5020 return null;
5021 }
5022 MethodElement lookUpMethod(String methodName, LibraryElement library) {
5023 MethodElement element = getMethod(methodName);
5024 if (element != null && element.isAccessibleIn(library)) {
5025 return element;
5026 }
5027 for (InterfaceType mixin in mixins) {
5028 element = mixin.getMethod(methodName);
5029 if (element != null && element.isAccessibleIn(library)) {
5030 return element;
5031 }
5032 }
5033 InterfaceType supertype = superclass;
5034 while (supertype != null) {
5035 element = supertype.getMethod(methodName);
5036 if (element != null && element.isAccessibleIn(library)) {
5037 return element;
5038 }
5039 supertype = supertype.superclass;
5040 }
5041 return null;
5042 }
5043 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library ) {
5044 PropertyAccessorElement element = getSetter(setterName);
5045 if (element != null && element.isAccessibleIn(library)) {
5046 return element;
5047 }
5048 for (InterfaceType mixin in mixins) {
5049 element = mixin.getSetter(setterName);
5050 if (element != null && element.isAccessibleIn(library)) {
5051 return element;
5052 }
5053 }
5054 InterfaceType supertype = superclass;
5055 while (supertype != null) {
5056 element = supertype.getSetter(setterName);
5057 if (element != null && element.isAccessibleIn(library)) {
5058 return element;
5059 }
5060 supertype = supertype.superclass;
5061 }
5062 return null;
4424 } 5063 }
4425 /** 5064 /**
4426 * Set the actual types of the type arguments to those in the given array. 5065 * Set the actual types of the type arguments to those in the given array.
4427 * @param typeArguments the actual types of the type arguments 5066 * @param typeArguments the actual types of the type arguments
4428 */ 5067 */
4429 void set typeArguments(List<Type2> typeArguments5) { 5068 void set typeArguments(List<Type2> typeArguments5) {
4430 this._typeArguments = typeArguments5; 5069 this._typeArguments = typeArguments5;
4431 } 5070 }
4432 InterfaceTypeImpl substitute5(List<Type2> argumentTypes) => substitute2(argume ntTypes, typeArguments); 5071 InterfaceTypeImpl substitute5(List<Type2> argumentTypes) => substitute2(argume ntTypes, typeArguments);
4433 InterfaceTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameter Types) { 5072 InterfaceTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameter Types) {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
4724 FunctionType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes ); 5363 FunctionType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes );
4725 } 5364 }
4726 /** 5365 /**
4727 * The interface {@code InterfaceType} defines the behavior common to objects re presenting the type 5366 * The interface {@code InterfaceType} defines the behavior common to objects re presenting the type
4728 * introduced by either a class or an interface, or a reference to such a type. 5367 * introduced by either a class or an interface, or a reference to such a type.
4729 * @coverage dart.engine.type 5368 * @coverage dart.engine.type
4730 */ 5369 */
4731 abstract class InterfaceType implements Type2 { 5370 abstract class InterfaceType implements Type2 {
4732 ClassElement get element; 5371 ClassElement get element;
4733 /** 5372 /**
5373 * Return the element representing the getter with the given name that is decl ared in this class,
5374 * or {@code null} if this class does not declare a getter with the given name .
5375 * @param getterName the name of the getter to be returned
5376 * @return the getter declared in this class with the given name
5377 */
5378 PropertyAccessorElement getGetter(String getterName);
5379 /**
5380 * Return an array containing all of the interfaces that are implemented by th is interface. Note
5381 * that this is <b>not</b>, in general, equivalent to getting the interfaces f rom this type's
5382 * element because the types returned by this method will have had their type parameters replaced.
5383 * @return the interfaces that are implemented by this type
5384 */
5385 List<InterfaceType> get interfaces;
5386 /**
4734 * Return the least upper bound of this type and the given type, or {@code nul l} if there is no 5387 * Return the least upper bound of this type and the given type, or {@code nul l} if there is no
4735 * least upper bound. 5388 * least upper bound.
4736 * <p> 5389 * <p>
4737 * Given two interfaces <i>I</i> and <i>J</i>, let <i>S<sub>I</sub></i> be the set of 5390 * Given two interfaces <i>I</i> and <i>J</i>, let <i>S<sub>I</sub></i> be the set of
4738 * superinterfaces of <i>I<i>, let <i>S<sub>J</sub></i> be the set of superint erfaces of <i>J</i> 5391 * superinterfaces of <i>I<i>, let <i>S<sub>J</sub></i> be the set of superint erfaces of <i>J</i>
4739 * and let <i>S = (I &cup; S<sub>I</sub>) &cap; (J &cup; S<sub>J</sub>)</i>. F urthermore, we 5392 * and let <i>S = (I &cup; S<sub>I</sub>) &cap; (J &cup; S<sub>J</sub>)</i>. F urthermore, we
4740 * define <i>S<sub>n</sub> = {T | T &isin; S &and; depth(T) = n}</i> for any f inite <i>n</i>, 5393 * define <i>S<sub>n</sub> = {T | T &isin; S &and; depth(T) = n}</i> for any f inite <i>n</i>,
4741 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat h from <i>T</i> to 5394 * where <i>depth(T)</i> is the number of steps in the longest inheritance pat h from <i>T</i> to
4742 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub ></i> has 5395 * <i>Object</i>. Let <i>q</i> be the largest number such that <i>S<sub>q</sub ></i> has
4743 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole element of 5396 * cardinality one. The least upper bound of <i>I</i> and <i>J</i> is the sole element of
4744 * <i>S<sub>q</sub></i>. 5397 * <i>S<sub>q</sub></i>.
4745 * @param type the other type used to compute the least upper bound 5398 * @param type the other type used to compute the least upper bound
4746 * @return the least upper bound of this type and the given type 5399 * @return the least upper bound of this type and the given type
4747 */ 5400 */
4748 Type2 getLeastUpperBound(Type2 type); 5401 Type2 getLeastUpperBound(Type2 type);
4749 /** 5402 /**
4750 * Return the type representing the superclass of this type. Note that this is <b>not</b>, in 5403 * Return the element representing the method with the given name that is decl ared in this class,
4751 * general, equivalent to getting the superclass from this type's element beca use the type 5404 * or {@code null} if this class does not declare a method with the given name .
4752 * returned by this method will have had it's type parameters replaced. 5405 * @param methodName the name of the method to be returned
5406 * @return the method declared in this class with the given name
5407 */
5408 MethodElement getMethod(String methodName);
5409 /**
5410 * Return an array containing all of the mixins that are applied to the class being extended in
5411 * order to derive the superclass of this class. Note that this is <b>not</b>, in general,
5412 * equivalent to getting the mixins from this type's element because the types returned by this
5413 * method will have had their type parameters replaced.
5414 * @return the mixins that are applied to derive the superclass of this class
5415 */
5416 List<InterfaceType> get mixins;
5417 /**
5418 * Return the element representing the setter with the given name that is decl ared in this class,
5419 * or {@code null} if this class does not declare a setter with the given name .
5420 * @param setterName the name of the setter to be returned
5421 * @return the setter declared in this class with the given name
5422 */
5423 PropertyAccessorElement getSetter(String setterName);
5424 /**
5425 * Return the type representing the superclass of this type, or null if this t ype represents the
5426 * class 'Object'. Note that this is <b>not</b>, in general, equivalent to get ting the superclass
5427 * from this type's element because the type returned by this method will have had it's type
5428 * parameters replaced.
4753 * @return the superclass of this type 5429 * @return the superclass of this type
4754 */ 5430 */
4755 Type2 get superclass; 5431 InterfaceType get superclass;
4756 /** 5432 /**
4757 * Return an array containing the actual types of the type arguments. If this type's element does 5433 * Return an array containing the actual types of the type arguments. If this type's element does
4758 * not have type parameters, then the array should be empty (although it is po ssible for type 5434 * not have type parameters, then the array should be empty (although it is po ssible for type
4759 * arguments to be erroneously declared). If the element has type parameters a nd the actual type 5435 * arguments to be erroneously declared). If the element has type parameters a nd the actual type
4760 * does not explicitly include argument values, then the type "dynamic" will b e automatically 5436 * does not explicitly include argument values, then the type "dynamic" will b e automatically
4761 * provided. 5437 * provided.
4762 * @return the actual types of the type arguments 5438 * @return the actual types of the type arguments
4763 */ 5439 */
4764 List<Type2> get typeArguments; 5440 List<Type2> get typeArguments;
4765 /** 5441 /**
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
4800 * Return {@code true} if this type is a subtype of the given type. An interfa ce type <i>T</i> is 5476 * Return {@code true} if this type is a subtype of the given type. An interfa ce type <i>T</i> is
4801 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff 5477 * a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff
4802 * <i>[bottom/dynamic]T</i> &laquo; <i>S</i> (<i>T</i> is more specific than < i>S</i>). If an 5478 * <i>[bottom/dynamic]T</i> &laquo; <i>S</i> (<i>T</i> is more specific than < i>S</i>). If an
4803 * interface type <i>I</i> includes a method named <i>call()</i>, and the type of <i>call()</i> is 5479 * interface type <i>I</i> includes a method named <i>call()</i>, and the type of <i>call()</i> is
4804 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of <i>F</i>. 5480 * the function type <i>F</i>, then <i>I</i> is considered to be a subtype of <i>F</i>.
4805 * @param type the type being compared with this type 5481 * @param type the type being compared with this type
4806 * @return {@code true} if this type is a subtype of the given type 5482 * @return {@code true} if this type is a subtype of the given type
4807 */ 5483 */
4808 bool isSubtypeOf(Type2 type); 5484 bool isSubtypeOf(Type2 type);
4809 /** 5485 /**
5486 * Return the element representing the getter that results from looking up the given getter in
5487 * this class with respect to the given library, or {@code null} if the look u p fails. The
5488 * behavior of this method is defined by the Dart Language Specification in se ction 12.15.1:
5489 * <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
5490 * with respect to library <i>L</i> is:
5491 * <ul>
5492 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i> m</i> that is
5493 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup.
5494 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result
5495 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>.
5496 * Otherwise, we say that the lookup has failed.</li>
5497 * </ul>
5498 * </blockquote>
5499 * @param getterName the name of the getter being looked up
5500 * @param library the library with respect to which the lookup is being perfor med
5501 * @return the result of looking up the given getter in this class with respec t to the given
5502 * library
5503 */
5504 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library );
5505 /**
5506 * Return the element representing the method that results from looking up the given method in
5507 * this class with respect to the given library, or {@code null} if the look u p fails. The
5508 * behavior of this method is defined by the Dart Language Specification in se ction 12.15.1:
5509 * <blockquote> The result of looking up method <i>m</i> in class <i>C</i> wit h respect to library
5510 * <i>L</i> is:
5511 * <ul>
5512 * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessib le to <i>L</i>, then
5513 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super class <i>S</i>, then
5514 * the result of the lookup is the result of looking up method <i>m</i> in <i> S</i> with respect
5515 * to <i>L</i>. Otherwise, we say that the lookup has failed.</li>
5516 * </ul>
5517 * </blockquote>
5518 * @param methodName the name of the method being looked up
5519 * @param library the library with respect to which the lookup is being perfor med
5520 * @return the result of looking up the given method in this class with respec t to the given
5521 * library
5522 */
5523 MethodElement lookUpMethod(String methodName, LibraryElement library);
5524 /**
5525 * Return the element representing the setter that results from looking up the given setter in
5526 * this class with respect to the given library, or {@code null} if the look u p fails. The
5527 * behavior of this method is defined by the Dart Language Specification in se ction 12.16:
5528 * <blockquote> The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
5529 * with respect to library <i>L</i> is:
5530 * <ul>
5531 * <li>If <i>C</i> declares an instance getter (respectively setter) named <i> m</i> that is
5532 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup.
5533 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result
5534 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>.
5535 * Otherwise, we say that the lookup has failed.</li>
5536 * </ul>
5537 * </blockquote>
5538 * @param setterName the name of the setter being looked up
5539 * @param library the library with respect to which the lookup is being perfor med
5540 * @return the result of looking up the given setter in this class with respec t to the given
5541 * library
5542 */
5543 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library );
5544 /**
4810 * Return the type resulting from substituting the given arguments for this ty pe's parameters. 5545 * Return the type resulting from substituting the given arguments for this ty pe's parameters.
4811 * This is fully equivalent to {@code substitute(argumentTypes, getTypeArgumen ts())}. 5546 * This is fully equivalent to {@code substitute(argumentTypes, getTypeArgumen ts())}.
4812 * @param argumentTypes the actual type arguments being substituted for the ty pe parameters 5547 * @param argumentTypes the actual type arguments being substituted for the ty pe parameters
4813 * @return the result of performing the substitution 5548 * @return the result of performing the substitution
4814 */ 5549 */
4815 InterfaceType substitute5(List<Type2> argumentTypes); 5550 InterfaceType substitute5(List<Type2> argumentTypes);
4816 InterfaceType substitute2(List<Type2> argumentTypes, List<Type2> parameterType s); 5551 InterfaceType substitute2(List<Type2> argumentTypes, List<Type2> parameterType s);
4817 } 5552 }
4818 /** 5553 /**
4819 * The interface {@code Type} defines the behavior of objects representing the d eclared type of 5554 * The interface {@code Type} defines the behavior of objects representing the d eclared type of
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
4906 */ 5641 */
4907 abstract class TypeVariableType implements Type2 { 5642 abstract class TypeVariableType implements Type2 {
4908 TypeVariableElement get element; 5643 TypeVariableElement get element;
4909 } 5644 }
4910 /** 5645 /**
4911 * The interface {@code VoidType} defines the behavior of the unique object repr esenting the type{@code void}. 5646 * The interface {@code VoidType} defines the behavior of the unique object repr esenting the type{@code void}.
4912 * @coverage dart.engine.type 5647 * @coverage dart.engine.type
4913 */ 5648 */
4914 abstract class VoidType implements Type2 { 5649 abstract class VoidType implements Type2 {
4915 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); 5650 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
4916 } 5651 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/constant.dart ('k') | pkg/analyzer_experimental/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698