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

Side by Side Diff: lib/compiler/implementation/elements/elements.dart

Issue 10191016: Introduce typed selectors for getters and setters also for better tree shaking. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 bool isCompilationUnit() { 119 bool isCompilationUnit() {
120 return kind === ElementKind.COMPILATION_UNIT || 120 return kind === ElementKind.COMPILATION_UNIT ||
121 kind === ElementKind.LIBRARY; 121 kind === ElementKind.LIBRARY;
122 } 122 }
123 bool isClass() => kind === ElementKind.CLASS; 123 bool isClass() => kind === ElementKind.CLASS;
124 bool isVariable() => kind === ElementKind.VARIABLE; 124 bool isVariable() => kind === ElementKind.VARIABLE;
125 bool isParameter() => kind === ElementKind.PARAMETER; 125 bool isParameter() => kind === ElementKind.PARAMETER;
126 bool isStatement() => kind === ElementKind.STATEMENT; 126 bool isStatement() => kind === ElementKind.STATEMENT;
127 bool isTypedef() => kind === ElementKind.TYPEDEF; 127 bool isTypedef() => kind === ElementKind.TYPEDEF;
128 bool isTypeVariable() => kind === ElementKind.TYPE_VARIABLE; 128 bool isTypeVariable() => kind === ElementKind.TYPE_VARIABLE;
129 bool isField() => kind === ElementKind.FIELD;
129 bool isGetter() => kind === ElementKind.GETTER; 130 bool isGetter() => kind === ElementKind.GETTER;
130 bool isSetter() => kind === ElementKind.SETTER; 131 bool isSetter() => kind === ElementKind.SETTER;
131 bool impliesType() => (kind.category & ElementCategory.IMPLIES_TYPE) != 0; 132 bool impliesType() => (kind.category & ElementCategory.IMPLIES_TYPE) != 0;
132 bool isExtendable() => (kind.category & ElementCategory.IS_EXTENDABLE) != 0; 133 bool isExtendable() => (kind.category & ElementCategory.IS_EXTENDABLE) != 0;
133 134
134 bool isAssignable() { 135 bool isAssignable() {
135 if (modifiers != null && modifiers.isFinal()) return false; 136 if (modifiers != null && modifiers.isFinal()) return false;
136 if (isFunction() || isGenerativeConstructor()) return false; 137 if (isFunction() || isGenerativeConstructor()) return false;
137 return true; 138 return true;
138 } 139 }
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 final Node node; 1046 final Node node;
1046 Type bound; 1047 Type bound;
1047 Type type; 1048 Type type;
1048 TypeVariableElement(name, Element enclosing, this.node, this.type, 1049 TypeVariableElement(name, Element enclosing, this.node, this.type,
1049 [this.bound]) 1050 [this.bound])
1050 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1051 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1051 Type computeType(compiler) => type; 1052 Type computeType(compiler) => type;
1052 Node parseNode(compiler) => node; 1053 Node parseNode(compiler) => node;
1053 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1054 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1054 } 1055 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698