| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.element_test; | 4 library engine.element_test; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'package:analyzer-experimental/src/generated/java_core.dart'; | 8 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 9 import 'package:analyzer-experimental/src/generated/java_engine.dart'; | 9 import 'package:analyzer_experimental/src/generated/java_engine.dart'; |
| 10 import 'package:analyzer-experimental/src/generated/java_engine_io.dart'; | 10 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; |
| 11 import 'package:analyzer-experimental/src/generated/java_junit.dart'; | 11 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 12 import 'package:analyzer-experimental/src/generated/source_io.dart'; | 12 import 'package:analyzer_experimental/src/generated/source_io.dart'; |
| 13 import 'package:analyzer-experimental/src/generated/error.dart'; | 13 import 'package:analyzer_experimental/src/generated/error.dart'; |
| 14 import 'package:analyzer-experimental/src/generated/scanner.dart'; | 14 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
| 15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; | 15 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; |
| 16 import 'package:analyzer-experimental/src/generated/ast.dart' hide Annotation; | 16 import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation; |
| 17 import 'package:analyzer-experimental/src/generated/element.dart' hide Annotatio
n; | 17 import 'package:analyzer_experimental/src/generated/element.dart' hide Annotatio
n; |
| 18 import 'package:analyzer-experimental/src/generated/engine.dart' show AnalysisCo
ntext, AnalysisContextImpl; | 18 import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisCo
ntext, AnalysisContextImpl; |
| 19 import 'package:unittest/unittest.dart' as _ut; | 19 import 'package:unittest/unittest.dart' as _ut; |
| 20 import 'test_support.dart'; | 20 import 'test_support.dart'; |
| 21 import 'scanner_test.dart' show TokenFactory; | 21 import 'scanner_test.dart' show TokenFactory; |
| 22 import 'ast_test.dart' show ASTFactory; | 22 import 'ast_test.dart' show ASTFactory; |
| 23 | 23 |
| 24 class ElementLocationImplTest extends EngineTestCase { | 24 class ElementLocationImplTest extends EngineTestCase { |
| 25 void test_create_encoding() { | 25 void test_create_encoding() { |
| 26 String encoding = "a;b;c"; | 26 String encoding = "a;b;c"; |
| 27 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); | 27 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); |
| 28 JUnitTestCase.assertEquals(encoding, location.encoding); | 28 JUnitTestCase.assertEquals(encoding, location.encoding); |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 return element; | 1034 return element; |
| 1035 } | 1035 } |
| 1036 static ClassElementImpl classElement2(String typeName, List<String> parameterN
ames) => classElement(typeName, object.type, parameterNames); | 1036 static ClassElementImpl classElement2(String typeName, List<String> parameterN
ames) => classElement(typeName, object.type, parameterNames); |
| 1037 static ConstructorElementImpl constructorElement(String name) => new Construct
orElementImpl(name == null ? null : ASTFactory.identifier2(name)); | 1037 static ConstructorElementImpl constructorElement(String name) => new Construct
orElementImpl(name == null ? null : ASTFactory.identifier2(name)); |
| 1038 static ExportElementImpl exportFor(LibraryElement exportedLibrary4, List<Names
paceCombinator> combinators4) { | 1038 static ExportElementImpl exportFor(LibraryElement exportedLibrary4, List<Names
paceCombinator> combinators4) { |
| 1039 ExportElementImpl spec = new ExportElementImpl(); | 1039 ExportElementImpl spec = new ExportElementImpl(); |
| 1040 spec.exportedLibrary = exportedLibrary4; | 1040 spec.exportedLibrary = exportedLibrary4; |
| 1041 spec.combinators = combinators4; | 1041 spec.combinators = combinators4; |
| 1042 return spec; | 1042 return spec; |
| 1043 } | 1043 } |
| 1044 static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal,
bool isConst, Type2 type33) { | 1044 static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal,
bool isConst, Type2 type34) { |
| 1045 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); | 1045 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); |
| 1046 field.const2 = isConst; | 1046 field.const3 = isConst; |
| 1047 field.final2 = isFinal; | 1047 field.final2 = isFinal; |
| 1048 field.static = isStatic; | 1048 field.static = isStatic; |
| 1049 field.type = type33; | 1049 field.type = type34; |
| 1050 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); | 1050 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); |
| 1051 getter.getter = true; | 1051 getter.getter = true; |
| 1052 getter.synthetic = true; | 1052 getter.synthetic = true; |
| 1053 field.getter = getter; | 1053 field.getter = getter; |
| 1054 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 1054 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |
| 1055 getterType.returnType = type33; | 1055 getterType.returnType = type34; |
| 1056 getter.type = getterType; | 1056 getter.type = getterType; |
| 1057 if (!isConst && !isFinal) { | 1057 if (!isConst && !isFinal) { |
| 1058 PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(
field); | 1058 PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(
field); |
| 1059 setter.setter = true; | 1059 setter.setter = true; |
| 1060 setter.synthetic = true; | 1060 setter.synthetic = true; |
| 1061 field.setter = setter; | 1061 field.setter = setter; |
| 1062 FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter); | 1062 FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter); |
| 1063 setterType.normalParameterTypes = <Type2> [type33]; | 1063 setterType.normalParameterTypes = <Type2> [type34]; |
| 1064 setterType.returnType = VoidTypeImpl.instance; | 1064 setterType.returnType = VoidTypeImpl.instance; |
| 1065 setter.type = setterType; | 1065 setter.type = setterType; |
| 1066 } | 1066 } |
| 1067 return field; | 1067 return field; |
| 1068 } | 1068 } |
| 1069 static FunctionElementImpl functionElement(String functionName) => functionEle
ment4(functionName, null, null, null, null); | 1069 static FunctionElementImpl functionElement(String functionName) => functionEle
ment4(functionName, null, null, null, null); |
| 1070 static FunctionElementImpl functionElement2(String functionName, ClassElement
returnElement) => functionElement3(functionName, returnElement, null, null); | 1070 static FunctionElementImpl functionElement2(String functionName, ClassElement
returnElement) => functionElement3(functionName, returnElement, null, null); |
| 1071 static FunctionElementImpl functionElement3(String functionName, ClassElement
returnElement, List<ClassElement> normalParameters, List<ClassElement> optionalP
arameters) { | 1071 static FunctionElementImpl functionElement3(String functionName, ClassElement
returnElement, List<ClassElement> normalParameters, List<ClassElement> optionalP
arameters) { |
| 1072 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor
y.identifier2(functionName)); | 1072 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor
y.identifier2(functionName)); |
| 1073 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); | 1073 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 } | 1121 } |
| 1122 static FunctionElementImpl functionElement5(String functionName, List<ClassEle
ment> normalParameters) => functionElement3(functionName, null, normalParameters
, null); | 1122 static FunctionElementImpl functionElement5(String functionName, List<ClassEle
ment> normalParameters) => functionElement3(functionName, null, normalParameters
, null); |
| 1123 static FunctionElementImpl functionElement6(String functionName, List<ClassEle
ment> normalParameters, List<ClassElement> optionalParameters) => functionElemen
t3(functionName, null, normalParameters, optionalParameters); | 1123 static FunctionElementImpl functionElement6(String functionName, List<ClassEle
ment> normalParameters, List<ClassElement> optionalParameters) => functionElemen
t3(functionName, null, normalParameters, optionalParameters); |
| 1124 static FunctionElementImpl functionElement7(String functionName, List<ClassEle
ment> normalParameters, List<String> names, List<ClassElement> namedParameters)
=> functionElement4(functionName, null, normalParameters, names, namedParameters
); | 1124 static FunctionElementImpl functionElement7(String functionName, List<ClassEle
ment> normalParameters, List<String> names, List<ClassElement> namedParameters)
=> functionElement4(functionName, null, normalParameters, names, namedParameters
); |
| 1125 static ClassElementImpl get object { | 1125 static ClassElementImpl get object { |
| 1126 if (_objectElement == null) { | 1126 if (_objectElement == null) { |
| 1127 _objectElement = classElement("Object", (null as InterfaceType), []); | 1127 _objectElement = classElement("Object", (null as InterfaceType), []); |
| 1128 } | 1128 } |
| 1129 return _objectElement; | 1129 return _objectElement; |
| 1130 } | 1130 } |
| 1131 static PropertyAccessorElementImpl getterElement(String name, bool isStatic, T
ype2 type34) { | 1131 static PropertyAccessorElementImpl getterElement(String name, bool isStatic, T
ype2 type35) { |
| 1132 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); | 1132 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); |
| 1133 field.static = isStatic; | 1133 field.static = isStatic; |
| 1134 field.synthetic = true; | 1134 field.synthetic = true; |
| 1135 field.type = type34; | 1135 field.type = type35; |
| 1136 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); | 1136 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); |
| 1137 getter.getter = true; | 1137 getter.getter = true; |
| 1138 field.getter = getter; | 1138 field.getter = getter; |
| 1139 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 1139 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |
| 1140 getterType.returnType = type34; | 1140 getterType.returnType = type35; |
| 1141 getter.type = getterType; | 1141 getter.type = getterType; |
| 1142 return getter; | 1142 return getter; |
| 1143 } | 1143 } |
| 1144 static ImportElementImpl importFor(LibraryElement importedLibrary5, PrefixElem
ent prefix13, List<NamespaceCombinator> combinators5) { | 1144 static ImportElementImpl importFor(LibraryElement importedLibrary5, PrefixElem
ent prefix13, List<NamespaceCombinator> combinators5) { |
| 1145 ImportElementImpl spec = new ImportElementImpl(); | 1145 ImportElementImpl spec = new ImportElementImpl(); |
| 1146 spec.importedLibrary = importedLibrary5; | 1146 spec.importedLibrary = importedLibrary5; |
| 1147 spec.prefix = prefix13; | 1147 spec.prefix = prefix13; |
| 1148 spec.combinators = combinators5; | 1148 spec.combinators = combinators5; |
| 1149 return spec; | 1149 return spec; |
| 1150 } | 1150 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); | 1185 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); |
| 1186 parameter.parameterKind = ParameterKind.POSITIONAL; | 1186 parameter.parameterKind = ParameterKind.POSITIONAL; |
| 1187 return parameter; | 1187 return parameter; |
| 1188 } | 1188 } |
| 1189 static PrefixElementImpl prefix(String name) => new PrefixElementImpl(ASTFacto
ry.identifier2(name)); | 1189 static PrefixElementImpl prefix(String name) => new PrefixElementImpl(ASTFacto
ry.identifier2(name)); |
| 1190 static ParameterElementImpl requiredParameter(String name) { | 1190 static ParameterElementImpl requiredParameter(String name) { |
| 1191 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); | 1191 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); |
| 1192 parameter.parameterKind = ParameterKind.REQUIRED; | 1192 parameter.parameterKind = ParameterKind.REQUIRED; |
| 1193 return parameter; | 1193 return parameter; |
| 1194 } | 1194 } |
| 1195 static PropertyAccessorElementImpl setterElement(String name, bool isStatic, T
ype2 type35) { | 1195 static PropertyAccessorElementImpl setterElement(String name, bool isStatic, T
ype2 type36) { |
| 1196 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); | 1196 FieldElementImpl field = new FieldElementImpl.con1(ASTFactory.identifier2(na
me)); |
| 1197 field.static = isStatic; | 1197 field.static = isStatic; |
| 1198 field.synthetic = true; | 1198 field.synthetic = true; |
| 1199 field.type = type35; | 1199 field.type = type36; |
| 1200 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); | 1200 PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(fi
eld); |
| 1201 getter.getter = true; | 1201 getter.getter = true; |
| 1202 field.getter = getter; | 1202 field.getter = getter; |
| 1203 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 1203 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |
| 1204 getterType.returnType = type35; | 1204 getterType.returnType = type36; |
| 1205 getter.type = getterType; | 1205 getter.type = getterType; |
| 1206 PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(fi
eld); | 1206 PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(fi
eld); |
| 1207 setter.setter = true; | 1207 setter.setter = true; |
| 1208 setter.synthetic = true; | 1208 setter.synthetic = true; |
| 1209 field.setter = setter; | 1209 field.setter = setter; |
| 1210 FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter); | 1210 FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter); |
| 1211 setterType.normalParameterTypes = <Type2> [type35]; | 1211 setterType.normalParameterTypes = <Type2> [type36]; |
| 1212 setterType.returnType = VoidTypeImpl.instance; | 1212 setterType.returnType = VoidTypeImpl.instance; |
| 1213 setter.type = setterType; | 1213 setter.type = setterType; |
| 1214 return setter; | 1214 return setter; |
| 1215 } | 1215 } |
| 1216 static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) =>
new TopLevelVariableElementImpl.con1(name); | 1216 static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) =>
new TopLevelVariableElementImpl.con1(name); |
| 1217 static TopLevelVariableElementImpl topLevelVariableElement2(String name) => ne
w TopLevelVariableElementImpl.con2(name); | 1217 static TopLevelVariableElementImpl topLevelVariableElement2(String name) => ne
w TopLevelVariableElementImpl.con2(name); |
| 1218 /** | 1218 /** |
| 1219 * Prevent the creation of instances of this class. | 1219 * Prevent the creation of instances of this class. |
| 1220 */ | 1220 */ |
| 1221 ElementFactory() { | 1221 ElementFactory() { |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 } | 1902 } |
| 1903 main() { | 1903 main() { |
| 1904 FunctionTypeImplTest.dartSuite(); | 1904 FunctionTypeImplTest.dartSuite(); |
| 1905 InterfaceTypeImplTest.dartSuite(); | 1905 InterfaceTypeImplTest.dartSuite(); |
| 1906 TypeVariableTypeImplTest.dartSuite(); | 1906 TypeVariableTypeImplTest.dartSuite(); |
| 1907 ClassElementImplTest.dartSuite(); | 1907 ClassElementImplTest.dartSuite(); |
| 1908 ElementLocationImplTest.dartSuite(); | 1908 ElementLocationImplTest.dartSuite(); |
| 1909 ElementImplTest.dartSuite(); | 1909 ElementImplTest.dartSuite(); |
| 1910 LibraryElementImplTest.dartSuite(); | 1910 LibraryElementImplTest.dartSuite(); |
| 1911 } | 1911 } |
| OLD | NEW |