| 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 library analyzer.src.generated.testing.element_factory; | 5 library analyzer.src.generated.testing.element_factory; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 parameter.parameterKind = ParameterKind.REQUIRED; | 111 parameter.parameterKind = ParameterKind.REQUIRED; |
| 112 parameters[i] = parameter; | 112 parameters[i] = parameter; |
| 113 } | 113 } |
| 114 constructor.parameters = parameters; | 114 constructor.parameters = parameters; |
| 115 } else { | 115 } else { |
| 116 constructor.parameters = <ParameterElement>[]; | 116 constructor.parameters = <ParameterElement>[]; |
| 117 } | 117 } |
| 118 constructor.returnType = type; | 118 constructor.returnType = type; |
| 119 constructor.enclosingElement = definingClass; | 119 constructor.enclosingElement = definingClass; |
| 120 constructor.type = new FunctionTypeImpl(constructor); | 120 constructor.type = new FunctionTypeImpl(constructor); |
| 121 if (!constructor.isSynthetic) { |
| 122 constructor.constantInitializers = <ConstructorInitializer>[]; |
| 123 } |
| 121 return constructor; | 124 return constructor; |
| 122 } | 125 } |
| 123 | 126 |
| 124 static ConstructorElementImpl constructorElement2( | 127 static ConstructorElementImpl constructorElement2( |
| 125 ClassElement definingClass, String name, | 128 ClassElement definingClass, String name, |
| 126 [List<DartType> argumentTypes]) => | 129 [List<DartType> argumentTypes]) => |
| 127 constructorElement(definingClass, name, false, argumentTypes); | 130 constructorElement(definingClass, name, false, argumentTypes); |
| 128 | 131 |
| 129 static ClassElementImpl enumElement( | 132 static ClassElementImpl enumElement( |
| 130 TypeProvider typeProvider, String enumName, | 133 TypeProvider typeProvider, String enumName, |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 } | 628 } |
| 626 | 629 |
| 627 static TypeParameterElementImpl typeParameterWithType(String name, | 630 static TypeParameterElementImpl typeParameterWithType(String name, |
| 628 [DartType bound]) { | 631 [DartType bound]) { |
| 629 TypeParameterElementImpl typeParameter = typeParameterElement(name); | 632 TypeParameterElementImpl typeParameter = typeParameterElement(name); |
| 630 typeParameter.type = new TypeParameterTypeImpl(typeParameter); | 633 typeParameter.type = new TypeParameterTypeImpl(typeParameter); |
| 631 typeParameter.bound = bound; | 634 typeParameter.bound = bound; |
| 632 return typeParameter; | 635 return typeParameter; |
| 633 } | 636 } |
| 634 } | 637 } |
| OLD | NEW |