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 entities; | 5 library entities; |
6 | 6 |
7 import 'package:front_end/src/fasta/parser/async_modifier.dart' | 7 import 'package:front_end/src/fasta/parser/async_modifier.dart' |
8 show AsyncModifier; | 8 show AsyncModifier; |
9 | 9 |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 /// and thus implement [Local] through [LocalElement]. For non-element locals, | 227 /// and thus implement [Local] through [LocalElement]. For non-element locals, |
228 /// like `this` and boxes, specialized [Local] classes are created. | 228 /// like `this` and boxes, specialized [Local] classes are created. |
229 /// | 229 /// |
230 /// Type variables can introduce locals in factories and constructors | 230 /// Type variables can introduce locals in factories and constructors |
231 /// but since one type variable can introduce different locals in different | 231 /// but since one type variable can introduce different locals in different |
232 /// factories and constructors it is not itself a [Local] but instead | 232 /// factories and constructors it is not itself a [Local] but instead |
233 /// a non-element [Local] is created through a specialized class. | 233 /// a non-element [Local] is created through a specialized class. |
234 // TODO(johnniwinther): Should [Local] have `isAssignable` or `type`? | 234 // TODO(johnniwinther): Should [Local] have `isAssignable` or `type`? |
235 abstract class Local extends Entity { | 235 abstract class Local extends Entity { |
236 /// The context in which this local is defined. | 236 /// The context in which this local is defined. |
| 237 // TODO(johnniwinther): Remove this. It is only used in the AST based closure |
| 238 // converter. |
237 Entity get executableContext; | 239 Entity get executableContext; |
238 | 240 |
239 /// The outermost member that contains this element. | 241 /// The outermost member that contains this element. |
240 /// | 242 /// |
241 /// For top level, static or instance members, the member context is the | 243 /// For top level, static or instance members, the member context is the |
242 /// element itself. For parameters, local variables and nested closures, the | 244 /// element itself. For parameters, local variables and nested closures, the |
243 /// member context is the top level, static or instance member in which it is | 245 /// member context is the top level, static or instance member in which it is |
244 /// defined. | 246 /// defined. |
245 MemberEntity get memberContext; | 247 MemberEntity get memberContext; |
246 } | 248 } |
(...skipping 23 matching lines...) Expand all Loading... |
270 /// The total number of parameters (required or optional). | 272 /// The total number of parameters (required or optional). |
271 int get totalParameters => positionalParameters + namedParameters.length; | 273 int get totalParameters => positionalParameters + namedParameters.length; |
272 | 274 |
273 /// Returns the [CallStructure] corresponding to a call site passing all | 275 /// Returns the [CallStructure] corresponding to a call site passing all |
274 /// parameters both required and optional. | 276 /// parameters both required and optional. |
275 CallStructure get callStructure { | 277 CallStructure get callStructure { |
276 return new CallStructure( | 278 return new CallStructure( |
277 positionalParameters + namedParameters.length, namedParameters); | 279 positionalParameters + namedParameters.length, namedParameters); |
278 } | 280 } |
279 } | 281 } |
OLD | NEW |