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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/member.dart

Issue 2966313002: Remove ExecutableElement.localVariables altogether. (Closed)
Patch Set: Created 3 years, 5 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.dart.element.member; 5 library analyzer.src.dart.element.member;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/constant/value.dart'; 8 import 'package:analyzer/dart/constant/value.dart';
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 @override 170 @override
171 bool get isStatic => baseElement.isStatic; 171 bool get isStatic => baseElement.isStatic;
172 172
173 @override 173 @override
174 bool get isSynchronous => baseElement.isSynchronous; 174 bool get isSynchronous => baseElement.isSynchronous;
175 175
176 @override 176 @override
177 List<LabelElement> get labels => baseElement.labels; 177 List<LabelElement> get labels => baseElement.labels;
178 178
179 @override 179 @override
180 List<LocalVariableElement> get localVariables {
181 //
182 // Elements within this element should have type parameters substituted,
183 // just like this element.
184 //
185 throw new UnsupportedError('localVariables');
186 // return getBaseElement().getLocalVariables();
187 }
188
189 @override
190 List<ParameterElement> get parameters => type.parameters; 180 List<ParameterElement> get parameters => type.parameters;
191 181
192 @override 182 @override
193 DartType get returnType => type.returnType; 183 DartType get returnType => type.returnType;
194 184
195 @override 185 @override
196 FunctionType get type { 186 FunctionType get type {
197 return _type ??= baseElement.type.substitute2(definingType.typeArguments, 187 return _type ??= baseElement.type.substitute2(definingType.typeArguments,
198 TypeParameterTypeImpl.getTypes(definingType.typeParameters)); 188 TypeParameterTypeImpl.getTypes(definingType.typeParameters));
199 } 189 }
200 190
201 @override 191 @override
202 List<TypeParameterElement> get typeParameters => baseElement.typeParameters; 192 List<TypeParameterElement> get typeParameters => baseElement.typeParameters;
203 193
204 @override 194 @override
205 void visitChildren(ElementVisitor visitor) { 195 void visitChildren(ElementVisitor visitor) {
206 // TODO(brianwilkerson) We need to finish implementing the accessors used 196 // TODO(brianwilkerson) We need to finish implementing the accessors used
207 // below so that we can safely invoke them. 197 // below so that we can safely invoke them.
208 super.visitChildren(visitor); 198 super.visitChildren(visitor);
209 safelyVisitChildren(baseElement.functions, visitor); 199 safelyVisitChildren(baseElement.functions, visitor);
210 safelyVisitChildren(labels, visitor); 200 safelyVisitChildren(labels, visitor);
211 safelyVisitChildren(baseElement.localVariables, visitor);
212 safelyVisitChildren(parameters, visitor); 201 safelyVisitChildren(parameters, visitor);
213 } 202 }
214 } 203 }
215 204
216 /** 205 /**
217 * A parameter element defined in a parameterized type where the values of the 206 * A parameter element defined in a parameterized type where the values of the
218 * type parameters are known. 207 * type parameters are known.
219 */ 208 */
220 class FieldFormalParameterMember extends ParameterMember 209 class FieldFormalParameterMember extends ParameterMember
221 implements FieldFormalParameterElement { 210 implements FieldFormalParameterElement {
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 DartObject computeConstantValue() => baseElement.computeConstantValue(); 995 DartObject computeConstantValue() => baseElement.computeConstantValue();
1007 996
1008 @override 997 @override
1009 void visitChildren(ElementVisitor visitor) { 998 void visitChildren(ElementVisitor visitor) {
1010 // TODO(brianwilkerson) We need to finish implementing the accessors used 999 // TODO(brianwilkerson) We need to finish implementing the accessors used
1011 // below so that we can safely invoke them. 1000 // below so that we can safely invoke them.
1012 super.visitChildren(visitor); 1001 super.visitChildren(visitor);
1013 baseElement.initializer?.accept(visitor); 1002 baseElement.initializer?.accept(visitor);
1014 } 1003 }
1015 } 1004 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/fasta/mock_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698