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 abstract class ConstructorBodyEntity extends FunctionEntity { | |
Siggi Cherem (dart-lang)
2017/07/07 20:00:25
+TODO or clarify that this entity shouldn't exist
Johnni Winther
2017/07/10 14:11:33
Done.
| |
214 /// The constructor for which this constructor body was created. | |
215 ConstructorEntity get constructor; | |
216 } | |
217 | |
209 /// An entity that defines a local entity (memory slot) in generated code. | 218 /// An entity that defines a local entity (memory slot) in generated code. |
210 /// | 219 /// |
211 /// Parameters, local variables and local functions (can) define local entity | 220 /// Parameters, local variables and local functions (can) define local entity |
212 /// and thus implement [Local] through [LocalElement]. For non-element locals, | 221 /// and thus implement [Local] through [LocalElement]. For non-element locals, |
213 /// like `this` and boxes, specialized [Local] classes are created. | 222 /// like `this` and boxes, specialized [Local] classes are created. |
214 /// | 223 /// |
215 /// Type variables can introduce locals in factories and constructors | 224 /// Type variables can introduce locals in factories and constructors |
216 /// but since one type variable can introduce different locals in different | 225 /// but since one type variable can introduce different locals in different |
217 /// factories and constructors it is not itself a [Local] but instead | 226 /// factories and constructors it is not itself a [Local] but instead |
218 /// a non-element [Local] is created through a specialized class. | 227 /// 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). | 264 /// The total number of parameters (required or optional). |
256 int get totalParameters => positionalParameters + namedParameters.length; | 265 int get totalParameters => positionalParameters + namedParameters.length; |
257 | 266 |
258 /// Returns the [CallStructure] corresponding to a call site passing all | 267 /// Returns the [CallStructure] corresponding to a call site passing all |
259 /// parameters both required and optional. | 268 /// parameters both required and optional. |
260 CallStructure get callStructure { | 269 CallStructure get callStructure { |
261 return new CallStructure( | 270 return new CallStructure( |
262 positionalParameters + namedParameters.length, namedParameters); | 271 positionalParameters + namedParameters.length, namedParameters); |
263 } | 272 } |
264 } | 273 } |
OLD | NEW |