Index: pkg/compiler/lib/src/js_model/closure.dart |
diff --git a/pkg/compiler/lib/src/js_model/closure.dart b/pkg/compiler/lib/src/js_model/closure.dart |
index 7202e5ce7e733a36b12efa70d8e26e8b12da4c4e..042568b095d6f19a21f2f4f1b036c8ae0b9c42cc 100644 |
--- a/pkg/compiler/lib/src/js_model/closure.dart |
+++ b/pkg/compiler/lib/src/js_model/closure.dart |
@@ -145,8 +145,17 @@ class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> { |
@override |
// TODO(efortuna): Eventually closureRepresentationMap[node] should always be |
// non-null, and we should just test that with an assert. |
- ClosureRepresentationInfo getClosureRepresentationInfo(Entity entity) => |
- _closureRepresentationMap[entity] ?? const ClosureRepresentationInfo(); |
+ ClosureRepresentationInfo getClosureRepresentationInfo(Entity entity) { |
+ // TODO(johnniwinther): Remove this check when constructor bodies a created |
+ // eagerly with the J-model; a constructor body should have it's own |
+ // [ClosureRepresentationInfo]. |
+ if (entity is ConstructorBodyEntity) { |
+ ConstructorBodyEntity constructorBody = entity; |
+ entity = constructorBody.constructor; |
+ } |
+ return _closureRepresentationMap[entity] ?? |
+ const ClosureRepresentationInfo(); |
+ } |
} |
class KernelScopeInfo extends ScopeInfo { |