OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// Entity model for elements derived from Kernel IR. | 5 /// Entity model for elements derived from Kernel IR. |
6 | 6 |
7 import '../elements/entities.dart'; | 7 import '../elements/entities.dart'; |
8 import '../elements/names.dart'; | 8 import '../elements/names.dart'; |
9 import '../elements/types.dart'; | 9 import '../elements/types.dart'; |
10 import 'elements.dart'; | 10 import 'elements.dart'; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 : super(memberIndex, enclosingClass, name, parameterStructure, | 157 : super(memberIndex, enclosingClass, name, parameterStructure, |
158 isExternal: isExternal, isConst: isConst); | 158 isExternal: isExternal, isConst: isConst); |
159 | 159 |
160 @override | 160 @override |
161 bool get isFactoryConstructor => true; | 161 bool get isFactoryConstructor => true; |
162 | 162 |
163 @override | 163 @override |
164 bool get isGenerativeConstructor => false; | 164 bool get isGenerativeConstructor => false; |
165 } | 165 } |
166 | 166 |
| 167 class KConstructorBody extends KFunction implements ConstructorBodyEntity { |
| 168 final ConstructorEntity constructor; |
| 169 |
| 170 KConstructorBody(int memberIndex, this.constructor) |
| 171 : super( |
| 172 memberIndex, |
| 173 constructor.library, |
| 174 constructor.enclosingClass, |
| 175 constructor.memberName, |
| 176 constructor.parameterStructure, |
| 177 AsyncMarker.SYNC, |
| 178 isStatic: false, |
| 179 isExternal: false); |
| 180 |
| 181 @override |
| 182 bool get isFunction => true; |
| 183 |
| 184 String get _kind => 'constructor_body'; |
| 185 } |
| 186 |
167 class KMethod extends KFunction { | 187 class KMethod extends KFunction { |
168 final bool isAbstract; | 188 final bool isAbstract; |
169 | 189 |
170 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name, | 190 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name, |
171 ParameterStructure parameterStructure, AsyncMarker asyncMarker, | 191 ParameterStructure parameterStructure, AsyncMarker asyncMarker, |
172 {bool isStatic, bool isExternal, this.isAbstract}) | 192 {bool isStatic, bool isExternal, this.isAbstract}) |
173 : super(memberIndex, library, enclosingClass, name, parameterStructure, | 193 : super(memberIndex, library, enclosingClass, name, parameterStructure, |
174 asyncMarker, | 194 asyncMarker, |
175 isStatic: isStatic, isExternal: isExternal); | 195 isStatic: isStatic, isExternal: isExternal); |
176 | 196 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 final MemberEntity memberContext; | 266 final MemberEntity memberContext; |
247 final Entity executableContext; | 267 final Entity executableContext; |
248 final FunctionType functionType; | 268 final FunctionType functionType; |
249 | 269 |
250 KLocalFunction( | 270 KLocalFunction( |
251 this.name, this.memberContext, this.executableContext, this.functionType); | 271 this.name, this.memberContext, this.executableContext, this.functionType); |
252 | 272 |
253 String toString() => '${kElementPrefix}local_function' | 273 String toString() => '${kElementPrefix}local_function' |
254 '(${memberContext.name}.${name ?? '<anonymous>'})'; | 274 '(${memberContext.name}.${name ?? '<anonymous>'})'; |
255 } | 275 } |
OLD | NEW |