| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.testing.element_factory; | 8 library engine.testing.element_factory; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 element.type = type; | 48 element.type = type; |
| 49 if (parameterNames != null) { | 49 if (parameterNames != null) { |
| 50 int count = parameterNames.length; | 50 int count = parameterNames.length; |
| 51 if (count > 0) { | 51 if (count > 0) { |
| 52 List<TypeParameterElementImpl> typeParameters = | 52 List<TypeParameterElementImpl> typeParameters = |
| 53 new List<TypeParameterElementImpl>(count); | 53 new List<TypeParameterElementImpl>(count); |
| 54 List<TypeParameterTypeImpl> typeParameterTypes = | 54 List<TypeParameterTypeImpl> typeParameterTypes = |
| 55 new List<TypeParameterTypeImpl>(count); | 55 new List<TypeParameterTypeImpl>(count); |
| 56 for (int i = 0; i < count; i++) { | 56 for (int i = 0; i < count; i++) { |
| 57 TypeParameterElementImpl typeParameter = | 57 TypeParameterElementImpl typeParameter = |
| 58 new TypeParameterElementImpl(parameterNames[i], 0); | 58 typeParameterElement(parameterNames[i]); |
| 59 typeParameters[i] = typeParameter; | 59 typeParameters[i] = typeParameter; |
| 60 typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter); | 60 typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter); |
| 61 typeParameter.type = typeParameterTypes[i]; | 61 typeParameter.type = typeParameterTypes[i]; |
| 62 } | 62 } |
| 63 element.typeParameters = typeParameters; | 63 element.typeParameters = typeParameters; |
| 64 type.typeArguments = typeParameterTypes; | 64 type.typeArguments = typeParameterTypes; |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 return element; | 67 return element; |
| 68 } | 68 } |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 FunctionElementImpl functionElement = | 339 FunctionElementImpl functionElement = |
| 340 new FunctionElementImpl(functionName, 0); | 340 new FunctionElementImpl(functionName, 0); |
| 341 functionElement.returnType = | 341 functionElement.returnType = |
| 342 returnType == null ? VoidTypeImpl.instance : returnType; | 342 returnType == null ? VoidTypeImpl.instance : returnType; |
| 343 functionElement.parameters = parameters; | 343 functionElement.parameters = parameters; |
| 344 FunctionTypeImpl functionType = new FunctionTypeImpl(functionElement); | 344 FunctionTypeImpl functionType = new FunctionTypeImpl(functionElement); |
| 345 functionElement.type = functionType; | 345 functionElement.type = functionType; |
| 346 return functionElement; | 346 return functionElement; |
| 347 } | 347 } |
| 348 | 348 |
| 349 static FunctionTypeAliasElementImpl functionTypeAliasElement(String name) { |
| 350 FunctionTypeAliasElementImpl functionTypeAliasElement = |
| 351 new FunctionTypeAliasElementImpl(name, -1); |
| 352 functionTypeAliasElement.type = |
| 353 new FunctionTypeImpl.forTypedef(functionTypeAliasElement); |
| 354 return functionTypeAliasElement; |
| 355 } |
| 356 |
| 349 static PropertyAccessorElementImpl getterElement( | 357 static PropertyAccessorElementImpl getterElement( |
| 350 String name, bool isStatic, DartType type) { | 358 String name, bool isStatic, DartType type) { |
| 351 FieldElementImpl field = new FieldElementImpl(name, -1); | 359 FieldElementImpl field = new FieldElementImpl(name, -1); |
| 352 field.static = isStatic; | 360 field.static = isStatic; |
| 353 field.synthetic = true; | 361 field.synthetic = true; |
| 354 field.type = type; | 362 field.type = type; |
| 355 PropertyAccessorElementImpl getter = | 363 PropertyAccessorElementImpl getter = |
| 356 new PropertyAccessorElementImpl.forVariable(field); | 364 new PropertyAccessorElementImpl.forVariable(field); |
| 357 getter.getter = true; | 365 getter.getter = true; |
| 358 getter.variable = field; | 366 getter.variable = field; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 setter.synthetic = true; | 538 setter.synthetic = true; |
| 531 setter.variable = variable; | 539 setter.variable = variable; |
| 532 setter.parameters = | 540 setter.parameters = |
| 533 <ParameterElement>[requiredParameter2("_$name", type)]; | 541 <ParameterElement>[requiredParameter2("_$name", type)]; |
| 534 setter.returnType = VoidTypeImpl.instance; | 542 setter.returnType = VoidTypeImpl.instance; |
| 535 setter.type = new FunctionTypeImpl(setter); | 543 setter.type = new FunctionTypeImpl(setter); |
| 536 variable.setter = setter; | 544 variable.setter = setter; |
| 537 } | 545 } |
| 538 return variable; | 546 return variable; |
| 539 } | 547 } |
| 548 |
| 549 static TypeParameterElementImpl typeParameterElement(String name) => |
| 550 new TypeParameterElementImpl(name, 0); |
| 540 } | 551 } |
| OLD | NEW |