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

Side by Side Diff: pkg/analyzer/lib/src/generated/testing/element_factory.dart

Issue 1022843002: Rewrite ImplicitConstructorBuilder to use only element model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 // 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 type.typeArguments = typeParameterTypes; 63 type.typeArguments = typeParameterTypes;
64 } 64 }
65 } 65 }
66 return element; 66 return element;
67 } 67 }
68 68
69 static ClassElementImpl classElement2(String typeName, 69 static ClassElementImpl classElement2(String typeName,
70 [List<String> parameterNames]) => 70 [List<String> parameterNames]) =>
71 classElement(typeName, objectType, parameterNames); 71 classElement(typeName, objectType, parameterNames);
72 72
73 static ClassElementImpl classTypeAlias2(String typeName,
74 [List<String> parameterNames]) =>
75 classTypeAlias(typeName, objectType, parameterNames);
76
77 static classTypeAlias(String typeName, InterfaceType superclassType,
78 [List<String> parameterNames]) {
79 ClassElementImpl element =
80 classElement(typeName, superclassType, parameterNames);
81 element.typedef = true;
82 return element;
83 }
84
73 static CompilationUnitElementImpl compilationUnit(String fileName) { 85 static CompilationUnitElementImpl compilationUnit(String fileName) {
74 Source source = new NonExistingSource(fileName, UriKind.FILE_URI); 86 Source source = new NonExistingSource(fileName, UriKind.FILE_URI);
75 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); 87 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName);
76 unit.source = source; 88 unit.source = source;
77 return unit; 89 return unit;
78 } 90 }
79 91
80 static ConstructorElementImpl constructorElement( 92 static ConstructorElementImpl constructorElement(
81 ClassElement definingClass, String name, bool isConst, 93 ClassElement definingClass, String name, bool isConst,
82 [List<DartType> argumentTypes]) { 94 [List<DartType> argumentTypes]) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 getter.returnType = type; 207 getter.returnType = type;
196 field.getter = getter; 208 field.getter = getter;
197 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); 209 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
198 getter.type = getterType; 210 getter.type = getterType;
199 if (!isConst && !isFinal) { 211 if (!isConst && !isFinal) {
200 PropertyAccessorElementImpl setter = 212 PropertyAccessorElementImpl setter =
201 new PropertyAccessorElementImpl.forVariable(field); 213 new PropertyAccessorElementImpl.forVariable(field);
202 setter.setter = true; 214 setter.setter = true;
203 setter.synthetic = true; 215 setter.synthetic = true;
204 setter.variable = field; 216 setter.variable = field;
205 setter.parameters = <ParameterElement>[ 217 setter.parameters =
206 requiredParameter2("_$name", type) 218 <ParameterElement>[requiredParameter2("_$name", type)];
207 ];
208 setter.returnType = VoidTypeImpl.instance; 219 setter.returnType = VoidTypeImpl.instance;
209 setter.type = new FunctionTypeImpl.con1(setter); 220 setter.type = new FunctionTypeImpl.con1(setter);
210 field.setter = setter; 221 field.setter = setter;
211 } 222 }
212 return field; 223 return field;
213 } 224 }
214 225
215 static FieldFormalParameterElementImpl fieldFormalParameter( 226 static FieldFormalParameterElementImpl fieldFormalParameter(
216 Identifier name) => new FieldFormalParameterElementImpl(name); 227 Identifier name) => new FieldFormalParameterElementImpl(name);
217 228
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 variable.getter = getter; 511 variable.getter = getter;
501 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); 512 FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
502 getter.type = getterType; 513 getter.type = getterType;
503 if (!isConst && !isFinal) { 514 if (!isConst && !isFinal) {
504 PropertyAccessorElementImpl setter = 515 PropertyAccessorElementImpl setter =
505 new PropertyAccessorElementImpl.forVariable(variable); 516 new PropertyAccessorElementImpl.forVariable(variable);
506 setter.setter = true; 517 setter.setter = true;
507 setter.static = true; 518 setter.static = true;
508 setter.synthetic = true; 519 setter.synthetic = true;
509 setter.variable = variable; 520 setter.variable = variable;
510 setter.parameters = <ParameterElement>[ 521 setter.parameters =
511 requiredParameter2("_$name", type) 522 <ParameterElement>[requiredParameter2("_$name", type)];
512 ];
513 setter.returnType = VoidTypeImpl.instance; 523 setter.returnType = VoidTypeImpl.instance;
514 setter.type = new FunctionTypeImpl.con1(setter); 524 setter.type = new FunctionTypeImpl.con1(setter);
515 variable.setter = setter; 525 variable.setter = setter;
516 } 526 }
517 return variable; 527 return variable;
518 } 528 }
519 } 529 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698