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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 bool get isGenerativeConstructor; | 199 bool get isGenerativeConstructor; |
200 | 200 |
201 /// Whether this is a factory constructor, possibly redirecting. | 201 /// Whether this is a factory constructor, possibly redirecting. |
202 bool get isFactoryConstructor; | 202 bool get isFactoryConstructor; |
203 | 203 |
204 /// Whether this is a `fromEnvironment` const constructor in `int`, `bool` or | 204 /// Whether this is a `fromEnvironment` const constructor in `int`, `bool` or |
205 /// `String`. | 205 /// `String`. |
206 bool get isFromEnvironmentConstructor; | 206 bool get isFromEnvironmentConstructor; |
207 } | 207 } |
208 | 208 |
| 209 /// The constructor body for a [ConstructorEntity]. |
| 210 /// |
| 211 /// This is used only in the backend to split encoding of a Dart constructor |
| 212 /// into two JavaScript functions; the constructor and the constructor body. |
| 213 // TODO(johnniwinther): Remove this when modelx is removed. Constructor bodies |
| 214 // should then be created directly with the J-model. |
| 215 abstract class ConstructorBodyEntity extends FunctionEntity { |
| 216 /// The constructor for which this constructor body was created. |
| 217 ConstructorEntity get constructor; |
| 218 } |
| 219 |
209 /// An entity that defines a local entity (memory slot) in generated code. | 220 /// An entity that defines a local entity (memory slot) in generated code. |
210 /// | 221 /// |
211 /// Parameters, local variables and local functions (can) define local entity | 222 /// Parameters, local variables and local functions (can) define local entity |
212 /// and thus implement [Local] through [LocalElement]. For non-element locals, | 223 /// and thus implement [Local] through [LocalElement]. For non-element locals, |
213 /// like `this` and boxes, specialized [Local] classes are created. | 224 /// like `this` and boxes, specialized [Local] classes are created. |
214 /// | 225 /// |
215 /// Type variables can introduce locals in factories and constructors | 226 /// Type variables can introduce locals in factories and constructors |
216 /// but since one type variable can introduce different locals in different | 227 /// but since one type variable can introduce different locals in different |
217 /// factories and constructors it is not itself a [Local] but instead | 228 /// factories and constructors it is not itself a [Local] but instead |
218 /// a non-element [Local] is created through a specialized class. | 229 /// a non-element [Local] is created through a specialized class. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 /// The total number of parameters (required or optional). | 266 /// The total number of parameters (required or optional). |
256 int get totalParameters => positionalParameters + namedParameters.length; | 267 int get totalParameters => positionalParameters + namedParameters.length; |
257 | 268 |
258 /// Returns the [CallStructure] corresponding to a call site passing all | 269 /// Returns the [CallStructure] corresponding to a call site passing all |
259 /// parameters both required and optional. | 270 /// parameters both required and optional. |
260 CallStructure get callStructure { | 271 CallStructure get callStructure { |
261 return new CallStructure( | 272 return new CallStructure( |
262 positionalParameters + namedParameters.length, namedParameters); | 273 positionalParameters + namedParameters.length, namedParameters); |
263 } | 274 } |
264 } | 275 } |
OLD | NEW |