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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 935613002: Make [EnumClassElement.enumValues] a [List]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'elements.dart'; 7 import 'elements.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../helpers/helpers.dart'; // Included for debug helpers. 9 import '../helpers/helpers.dart'; // Included for debug helpers.
10 import '../tree/tree.dart'; 10 import '../tree/tree.dart';
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 } else if (patch != null) { 2663 } else if (patch != null) {
2664 return 'origin ${super.toString()}'; 2664 return 'origin ${super.toString()}';
2665 } else { 2665 } else {
2666 return super.toString(); 2666 return super.toString();
2667 } 2667 }
2668 } 2668 }
2669 } 2669 }
2670 2670
2671 class EnumClassElementX extends ClassElementX implements EnumClassElement { 2671 class EnumClassElementX extends ClassElementX implements EnumClassElement {
2672 final Enum node; 2672 final Enum node;
2673 Iterable<FieldElement> _enumValues; 2673 List<FieldElement> _enumValues;
2674 2674
2675 EnumClassElementX(String name, Element enclosing, int id, this.node) 2675 EnumClassElementX(String name, Element enclosing, int id, this.node)
2676 : super(name, enclosing, id, STATE_NOT_STARTED); 2676 : super(name, enclosing, id, STATE_NOT_STARTED);
2677 2677
2678 @override 2678 @override
2679 bool get hasNode => true; 2679 bool get hasNode => true;
2680 2680
2681 @override 2681 @override
2682 Token get position => node.name.token; 2682 Token get position => node.name.token;
2683 2683
2684 @override 2684 @override
2685 bool get isEnumClass => true; 2685 bool get isEnumClass => true;
2686 2686
2687 @override 2687 @override
2688 Node parseNode(Compiler compiler) => node; 2688 Node parseNode(Compiler compiler) => node;
2689 2689
2690 @override 2690 @override
2691 accept(ElementVisitor visitor) => visitor.visitEnumClassElement(this); 2691 accept(ElementVisitor visitor) => visitor.visitEnumClassElement(this);
2692 2692
2693 List<DartType> computeTypeParameters(Compiler compiler) => const <DartType>[]; 2693 List<DartType> computeTypeParameters(Compiler compiler) => const <DartType>[];
2694 2694
2695 Iterable<FieldElement> get enumValues { 2695 List<FieldElement> get enumValues {
2696 assert(invariant(this, _enumValues != null, 2696 assert(invariant(this, _enumValues != null,
2697 message: "enumValues has not been computed for $this.")); 2697 message: "enumValues has not been computed for $this."));
2698 return _enumValues; 2698 return _enumValues;
2699 } 2699 }
2700 2700
2701 void set enumValues(Iterable<FieldElement> values) { 2701 void set enumValues(List<FieldElement> values) {
2702 assert(invariant(this, _enumValues == null, 2702 assert(invariant(this, _enumValues == null,
2703 message: "enumValues has already been computed for $this.")); 2703 message: "enumValues has already been computed for $this."));
2704 _enumValues = values; 2704 _enumValues = values;
2705 } 2705 }
2706 } 2706 }
2707 2707
2708 class EnumConstructorElementX extends ConstructorElementX { 2708 class EnumConstructorElementX extends ConstructorElementX {
2709 final FunctionExpression node; 2709 final FunctionExpression node;
2710 2710
2711 EnumConstructorElementX(EnumClassElementX enumClass, 2711 EnumConstructorElementX(EnumClassElementX enumClass,
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
3063 AstElement get definingElement; 3063 AstElement get definingElement;
3064 3064
3065 bool get hasResolvedAst => definingElement.hasTreeElements; 3065 bool get hasResolvedAst => definingElement.hasTreeElements;
3066 3066
3067 ResolvedAst get resolvedAst { 3067 ResolvedAst get resolvedAst {
3068 return new ResolvedAst(declaration, 3068 return new ResolvedAst(declaration,
3069 definingElement.node, definingElement.treeElements); 3069 definingElement.node, definingElement.treeElements);
3070 } 3070 }
3071 3071
3072 } 3072 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698