Index: pkg/compiler/lib/src/js_model/elements.dart |
diff --git a/pkg/compiler/lib/src/js_model/elements.dart b/pkg/compiler/lib/src/js_model/elements.dart |
index f156f056acb6eb3017e72f63100c48d33c2ce431..30244c06d019de9266f6598c5c4acf1970b08180 100644 |
--- a/pkg/compiler/lib/src/js_model/elements.dart |
+++ b/pkg/compiler/lib/src/js_model/elements.dart |
@@ -66,6 +66,7 @@ abstract class JsToFrontendMapBase implements JsToFrontendMap { |
TypeVariableEntity toFrontendTypeVariable(TypeVariableEntity typeVariable); |
} |
+// TODO(johnniwinther): Merge this with [JsKernelToElementMap]. |
class JsElementCreatorMixin { |
IndexedLibrary createLibrary( |
int libraryIndex, String name, Uri canonicalUri) { |
@@ -109,6 +110,11 @@ class JsElementCreatorMixin { |
isFromEnvironmentConstructor: isFromEnvironmentConstructor); |
} |
+ ConstructorBodyEntity createConstructorBody( |
+ int memberIndex, ConstructorEntity constructor) { |
+ return new JConstructorBody(memberIndex, constructor); |
+ } |
+ |
IndexedFunction createGetter(int memberIndex, LibraryEntity library, |
ClassEntity enclosingClass, Name name, AsyncMarker asyncMarker, |
{bool isStatic, bool isExternal, bool isAbstract}) { |
@@ -419,6 +425,26 @@ class JFactoryConstructor extends JConstructor { |
bool get isGenerativeConstructor => false; |
} |
+class JConstructorBody extends JFunction implements ConstructorBodyEntity { |
+ final ConstructorEntity constructor; |
+ |
+ JConstructorBody(int memberIndex, this.constructor) |
+ : super( |
+ memberIndex, |
+ constructor.library, |
+ constructor.enclosingClass, |
+ constructor.memberName, |
+ constructor.parameterStructure, |
+ AsyncMarker.SYNC, |
+ isStatic: false, |
+ isExternal: false); |
+ |
+ @override |
+ bool get isFunction => true; |
+ |
+ String get _kind => 'constructor_body'; |
+} |
+ |
class JMethod extends JFunction { |
final bool isAbstract; |