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

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

Issue 1531233002: Compute all default values of parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
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 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/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 [List<NamespaceCombinator> combinators = 192 [List<NamespaceCombinator> combinators =
193 NamespaceCombinator.EMPTY_LIST]) { 193 NamespaceCombinator.EMPTY_LIST]) {
194 ExportElementImpl spec = new ExportElementImpl(-1); 194 ExportElementImpl spec = new ExportElementImpl(-1);
195 spec.exportedLibrary = exportedLibrary; 195 spec.exportedLibrary = exportedLibrary;
196 spec.combinators = combinators; 196 spec.combinators = combinators;
197 return spec; 197 return spec;
198 } 198 }
199 199
200 static FieldElementImpl fieldElement( 200 static FieldElementImpl fieldElement(
201 String name, bool isStatic, bool isFinal, bool isConst, DartType type) { 201 String name, bool isStatic, bool isFinal, bool isConst, DartType type) {
202 FieldElementImpl field = new FieldElementImpl(name, 0); 202 FieldElementImpl field = isConst
203 ? new ConstFieldElementImpl(name, 0)
204 : new FieldElementImpl(name, 0);
203 field.const3 = isConst; 205 field.const3 = isConst;
204 field.final2 = isFinal; 206 field.final2 = isFinal;
205 field.static = isStatic; 207 field.static = isStatic;
206 field.type = type; 208 field.type = type;
207 PropertyAccessorElementImpl getter = 209 PropertyAccessorElementImpl getter =
208 new PropertyAccessorElementImpl.forVariable(field); 210 new PropertyAccessorElementImpl.forVariable(field);
209 getter.getter = true; 211 getter.getter = true;
210 getter.synthetic = true; 212 getter.synthetic = true;
211 getter.variable = field; 213 getter.variable = field;
212 getter.returnType = type; 214 getter.returnType = type;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 } 613 }
612 614
613 static TypeParameterElementImpl typeParameterWithType(String name, 615 static TypeParameterElementImpl typeParameterWithType(String name,
614 [DartType bound]) { 616 [DartType bound]) {
615 TypeParameterElementImpl typeParameter = typeParameterElement(name); 617 TypeParameterElementImpl typeParameter = typeParameterElement(name);
616 typeParameter.type = new TypeParameterTypeImpl(typeParameter); 618 typeParameter.type = new TypeParameterTypeImpl(typeParameter);
617 typeParameter.bound = bound; 619 typeParameter.bound = bound;
618 return typeParameter; 620 return typeParameter;
619 } 621 }
620 } 622 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698