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

Side by Side Diff: pkg/analyzer-experimental/test/generated/element_test.dart

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 7 years, 9 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_test; 4 library engine.element_test;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'package:analyzer-experimental/src/generated/java_core.dart'; 7 import 'package:analyzer-experimental/src/generated/java_core.dart';
8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; 8 import 'package:analyzer-experimental/src/generated/java_engine.dart';
9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; 9 import 'package:analyzer-experimental/src/generated/java_junit.dart';
10 import 'package:analyzer-experimental/src/generated/source.dart'; 10 import 'package:analyzer-experimental/src/generated/source.dart';
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 * The element representing the class 'Object'. 606 * The element representing the class 'Object'.
607 */ 607 */
608 static ClassElement _objectElement; 608 static ClassElement _objectElement;
609 static ClassElement classElement(String typeName, InterfaceType superclassType , List<String> parameterNames) { 609 static ClassElement classElement(String typeName, InterfaceType superclassType , List<String> parameterNames) {
610 ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier2(typeN ame)); 610 ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier2(typeN ame));
611 element.supertype = superclassType; 611 element.supertype = superclassType;
612 InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element); 612 InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element);
613 element.type = type; 613 element.type = type;
614 int count = parameterNames.length; 614 int count = parameterNames.length;
615 if (count > 0) { 615 if (count > 0) {
616 List<TypeVariableElementImpl> typeVariables = new List<TypeVariableElement Impl>.fixedLength(count); 616 List<TypeVariableElementImpl> typeVariables = new List<TypeVariableElement Impl>(count);
617 List<TypeVariableTypeImpl> typeArguments = new List<TypeVariableTypeImpl>. fixedLength(count); 617 List<TypeVariableTypeImpl> typeArguments = new List<TypeVariableTypeImpl>( count);
618 for (int i = 0; i < count; i++) { 618 for (int i = 0; i < count; i++) {
619 TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactor y.identifier2(parameterNames[i])); 619 TypeVariableElementImpl variable = new TypeVariableElementImpl(ASTFactor y.identifier2(parameterNames[i]));
620 typeVariables[i] = variable; 620 typeVariables[i] = variable;
621 typeArguments[i] = new TypeVariableTypeImpl(variable); 621 typeArguments[i] = new TypeVariableTypeImpl(variable);
622 variable.type = typeArguments[i]; 622 variable.type = typeArguments[i];
623 } 623 }
624 element.typeVariables = typeVariables; 624 element.typeVariables = typeVariables;
625 type.typeArguments = typeArguments; 625 type.typeArguments = typeArguments;
626 } 626 }
627 return element; 627 return element;
(...skipping 29 matching lines...) Expand all
657 static FunctionElement functionElement2(String functionName, ClassElement retu rnElement) => functionElement3(functionName, returnElement, null, null); 657 static FunctionElement functionElement2(String functionName, ClassElement retu rnElement) => functionElement3(functionName, returnElement, null, null);
658 static FunctionElement functionElement3(String functionName, ClassElement retu rnElement, List<ClassElement> normalParameters, List<ClassElement> optionalParam eters) { 658 static FunctionElement functionElement3(String functionName, ClassElement retu rnElement, List<ClassElement> normalParameters, List<ClassElement> optionalParam eters) {
659 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor y.identifier2(functionName)); 659 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor y.identifier2(functionName));
660 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); 660 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
661 functionElement.type = functionType; 661 functionElement.type = functionType;
662 if (returnElement != null) { 662 if (returnElement != null) {
663 functionType.returnType = returnElement.type; 663 functionType.returnType = returnElement.type;
664 } 664 }
665 int count = normalParameters == null ? 0 : normalParameters.length; 665 int count = normalParameters == null ? 0 : normalParameters.length;
666 if (count > 0) { 666 if (count > 0) {
667 List<InterfaceType> normalParameterTypes = new List<InterfaceType>.fixedLe ngth(count); 667 List<InterfaceType> normalParameterTypes = new List<InterfaceType>(count);
668 for (int i = 0; i < count; i++) { 668 for (int i = 0; i < count; i++) {
669 normalParameterTypes[i] = normalParameters[i].type; 669 normalParameterTypes[i] = normalParameters[i].type;
670 } 670 }
671 functionType.normalParameterTypes = normalParameterTypes; 671 functionType.normalParameterTypes = normalParameterTypes;
672 } 672 }
673 count = optionalParameters == null ? 0 : optionalParameters.length; 673 count = optionalParameters == null ? 0 : optionalParameters.length;
674 if (count > 0) { 674 if (count > 0) {
675 List<InterfaceType> optionalParameterTypes = new List<InterfaceType>.fixed Length(count); 675 List<InterfaceType> optionalParameterTypes = new List<InterfaceType>(count );
676 for (int i = 0; i < count; i++) { 676 for (int i = 0; i < count; i++) {
677 optionalParameterTypes[i] = optionalParameters[i].type; 677 optionalParameterTypes[i] = optionalParameters[i].type;
678 } 678 }
679 functionType.optionalParameterTypes = optionalParameterTypes; 679 functionType.optionalParameterTypes = optionalParameterTypes;
680 } 680 }
681 return functionElement; 681 return functionElement;
682 } 682 }
683 static FunctionElement functionElement4(String functionName, ClassElement retu rnElement, List<ClassElement> normalParameters, List<String> names, List<ClassEl ement> namedParameters) { 683 static FunctionElement functionElement4(String functionName, ClassElement retu rnElement, List<ClassElement> normalParameters, List<String> names, List<ClassEl ement> namedParameters) {
684 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor y.identifier2(functionName)); 684 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor y.identifier2(functionName));
685 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); 685 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
686 functionElement.type = functionType; 686 functionElement.type = functionType;
687 if (returnElement != null) { 687 if (returnElement != null) {
688 functionType.returnType = returnElement.type; 688 functionType.returnType = returnElement.type;
689 } 689 }
690 int count = normalParameters == null ? 0 : normalParameters.length; 690 int count = normalParameters == null ? 0 : normalParameters.length;
691 if (count > 0) { 691 if (count > 0) {
692 List<InterfaceType> normalParameterTypes = new List<InterfaceType>.fixedLe ngth(count); 692 List<InterfaceType> normalParameterTypes = new List<InterfaceType>(count);
693 for (int i = 0; i < count; i++) { 693 for (int i = 0; i < count; i++) {
694 normalParameterTypes[i] = normalParameters[i].type; 694 normalParameterTypes[i] = normalParameters[i].type;
695 } 695 }
696 functionType.normalParameterTypes = normalParameterTypes; 696 functionType.normalParameterTypes = normalParameterTypes;
697 } 697 }
698 if (names != null && names.length > 0 && names.length == namedParameters.len gth) { 698 if (names != null && names.length > 0 && names.length == namedParameters.len gth) {
699 LinkedHashMap<String, Type2> map = new LinkedHashMap<String, Type2>(); 699 LinkedHashMap<String, Type2> map = new LinkedHashMap<String, Type2>();
700 for (int i = 0; i < names.length; i++) { 700 for (int i = 0; i < names.length; i++) {
701 map[names[i]] = namedParameters[i].type; 701 map[names[i]] = namedParameters[i].type;
702 } 702 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 FileBasedSource source = new FileBasedSource.con1(null, createFile(fileName) ); 740 FileBasedSource source = new FileBasedSource.con1(null, createFile(fileName) );
741 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); 741 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName);
742 unit.source = source; 742 unit.source = source;
743 LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libr aryIdentifier2([libraryName])); 743 LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libr aryIdentifier2([libraryName]));
744 library.definingCompilationUnit = unit; 744 library.definingCompilationUnit = unit;
745 return library; 745 return library;
746 } 746 }
747 static MethodElement methodElement(String methodName, Type2 returnType9, List< Type2> argumentTypes) { 747 static MethodElement methodElement(String methodName, Type2 returnType9, List< Type2> argumentTypes) {
748 MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier2 (methodName)); 748 MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier2 (methodName));
749 int count = argumentTypes.length; 749 int count = argumentTypes.length;
750 List<ParameterElement> parameters = new List<ParameterElement>.fixedLength(c ount); 750 List<ParameterElement> parameters = new List<ParameterElement>(count);
751 for (int i = 0; i < count; i++) { 751 for (int i = 0; i < count; i++) {
752 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.ident ifier2("a${i}")); 752 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.ident ifier2("a${i}"));
753 parameter.type = argumentTypes[i]; 753 parameter.type = argumentTypes[i];
754 parameters[i] = parameter; 754 parameters[i] = parameter;
755 } 755 }
756 method.parameters = parameters; 756 method.parameters = parameters;
757 FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method); 757 FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method);
758 methodType.normalParameterTypes = argumentTypes; 758 methodType.normalParameterTypes = argumentTypes;
759 methodType.returnType = returnType9; 759 methodType.returnType = returnType9;
760 method.type = methodType; 760 method.type = methodType;
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 } 1831 }
1832 main() { 1832 main() {
1833 ClassElementImplTest.dartSuite(); 1833 ClassElementImplTest.dartSuite();
1834 ElementLocationImplTest.dartSuite(); 1834 ElementLocationImplTest.dartSuite();
1835 ElementImplTest.dartSuite(); 1835 ElementImplTest.dartSuite();
1836 LibraryElementImplTest.dartSuite(); 1836 LibraryElementImplTest.dartSuite();
1837 FunctionTypeImplTest.dartSuite(); 1837 FunctionTypeImplTest.dartSuite();
1838 InterfaceTypeImplTest.dartSuite(); 1838 InterfaceTypeImplTest.dartSuite();
1839 TypeVariableTypeImplTest.dartSuite(); 1839 TypeVariableTypeImplTest.dartSuite();
1840 } 1840 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698