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

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

Issue 1625473004: Copy 'ConstructorName.staticElement' in ConstantAstCloner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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/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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 static TopLevelVariableElementImpl topLevelVariableElement3( 558 static TopLevelVariableElementImpl topLevelVariableElement3(
559 String name, bool isConst, bool isFinal, DartType type) { 559 String name, bool isConst, bool isFinal, DartType type) {
560 TopLevelVariableElementImpl variable; 560 TopLevelVariableElementImpl variable;
561 if (isConst) { 561 if (isConst) {
562 ConstTopLevelVariableElementImpl constant = 562 ConstTopLevelVariableElementImpl constant =
563 new ConstTopLevelVariableElementImpl(AstFactory.identifier3(name)); 563 new ConstTopLevelVariableElementImpl(AstFactory.identifier3(name));
564 InstanceCreationExpression initializer = AstFactory.instanceCreationExpres sion2( 564 InstanceCreationExpression initializer = AstFactory.instanceCreationExpres sion2(
565 Keyword.CONST, AstFactory.typeName(type.element)); 565 Keyword.CONST, AstFactory.typeName(type.element));
566 if (type is InterfaceType) { 566 if (type is InterfaceType) {
567 initializer.staticElement = type.element.unnamedConstructor; 567 ConstructorElement element = type.element.unnamedConstructor;
568 initializer.staticElement = element;
569 initializer.constructorName.staticElement = element;
568 } 570 }
569 constant.constantInitializer = initializer; 571 constant.constantInitializer = initializer;
570 variable = constant; 572 variable = constant;
571 } else { 573 } else {
572 variable = new TopLevelVariableElementImpl(name, -1); 574 variable = new TopLevelVariableElementImpl(name, -1);
573 } 575 }
574 variable.const3 = isConst; 576 variable.const3 = isConst;
575 variable.final2 = isFinal; 577 variable.final2 = isFinal;
576 variable.synthetic = false; 578 variable.synthetic = false;
577 variable.type = type; 579 variable.type = type;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 } 623 }
622 624
623 static TypeParameterElementImpl typeParameterWithType(String name, 625 static TypeParameterElementImpl typeParameterWithType(String name,
624 [DartType bound]) { 626 [DartType bound]) {
625 TypeParameterElementImpl typeParameter = typeParameterElement(name); 627 TypeParameterElementImpl typeParameter = typeParameterElement(name);
626 typeParameter.type = new TypeParameterTypeImpl(typeParameter); 628 typeParameter.type = new TypeParameterTypeImpl(typeParameter);
627 typeParameter.bound = bound; 629 typeParameter.bound = bound;
628 return typeParameter; 630 return typeParameter;
629 } 631 }
630 } 632 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698