OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.analyzer.element_store; | 5 library fasta.analyzer.element_store; |
6 | 6 |
7 import 'package:kernel/analyzer/loader.dart' show | 7 import 'package:kernel/analyzer/loader.dart' show |
8 ReferenceLevelLoader; | 8 ReferenceLevelLoader; |
9 | 9 |
10 import 'package:kernel/ast.dart'; | 10 import 'package:kernel/ast.dart'; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ? cls.cls.constructors.first | 112 ? cls.cls.constructors.first |
113 : cls.cls.constructors.firstWhere( | 113 : cls.cls.constructors.firstWhere( |
114 (Constructor c) => c.name.name == constructorName); | 114 (Constructor c) => c.name.name == constructorName); |
115 return constructor; | 115 return constructor; |
116 } | 116 } |
117 | 117 |
118 Library getLibraryReference(LibraryElement element) { | 118 Library getLibraryReference(LibraryElement element) { |
119 return internalError("not supported."); | 119 return internalError("not supported."); |
120 } | 120 } |
121 | 121 |
122 Class getClassReference(KernelClassElement cls) => cls.builder.cls; | 122 Class getClassReference(covariant KernelClassElement cls) => cls.builder.cls; |
123 | 123 |
124 Member getMemberReference(Element element) { | 124 Member getMemberReference(Element element) { |
125 if (element is KernelFunctionElement) { | 125 if (element is KernelFunctionElement) { |
126 return element.procedure; | 126 return element.procedure; |
127 } else { | 127 } else { |
128 return internalError("getMemberReference(${element.runtimeType})"); | 128 return internalError("getMemberReference(${element.runtimeType})"); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 Class getRootClassReference() => internalError("not supported."); | 132 Class getRootClassReference() => internalError("not supported."); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 AnalyzerLocalVariableElemment(this.variable) | 251 AnalyzerLocalVariableElemment(this.variable) |
252 : super(ElementKind.LOCAL_VARIABLE); | 252 : super(ElementKind.LOCAL_VARIABLE); |
253 | 253 |
254 String get name => variable.name.name; | 254 String get name => variable.name.name; |
255 | 255 |
256 bool get isFinal => false; // TODO(ahe): implement this. | 256 bool get isFinal => false; // TODO(ahe): implement this. |
257 | 257 |
258 bool get isConst => false; // TODO(ahe): implement this. | 258 bool get isConst => false; // TODO(ahe): implement this. |
259 | 259 |
260 analyzer.VariableDeclaration get target => variable; | 260 analyzer.VariableDeclaration get target => variable; |
| 261 |
| 262 get type => null; |
| 263 |
| 264 get constantValue => internalError("not supported."); |
| 265 |
| 266 computeConstantValue() => internalError("not supported."); |
261 } | 267 } |
262 | 268 |
263 /// Both an [Element] and [Builder] to using memory to store local elements in | 269 /// Both an [Element] and [Builder] to using memory to store local elements in |
264 /// [ElementStore]. | 270 /// [ElementStore]. |
265 class AnalyzerParameterElement extends MockParameterElement with Builder { | 271 class AnalyzerParameterElement extends MockParameterElement with Builder { |
266 final analyzer.FormalParameter parameter; | 272 final analyzer.FormalParameter parameter; |
267 | 273 |
268 AnalyzerParameterElement(this.parameter); | 274 AnalyzerParameterElement(this.parameter); |
269 | 275 |
270 String get name => parameter.identifier.name; | 276 String get name => parameter.identifier.name; |
(...skipping 15 matching lines...) Expand all Loading... |
286 } | 292 } |
287 } | 293 } |
288 | 294 |
289 class KernelInterfaceType extends MockInterfaceType { | 295 class KernelInterfaceType extends MockInterfaceType { |
290 final KernelClassElement element; | 296 final KernelClassElement element; |
291 | 297 |
292 KernelInterfaceType(this.element); | 298 KernelInterfaceType(this.element); |
293 | 299 |
294 List<analyzer.DartType> get typeArguments => const <analyzer.DartType>[]; | 300 List<analyzer.DartType> get typeArguments => const <analyzer.DartType>[]; |
295 } | 301 } |
OLD | NEW |