Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: pkg/compiler/lib/src/js_model/closure.dart

Issue 2968383002: Add ConstructorBodyEntity (Closed)
Patch Set: Skip non-live constructor bodies Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart ('k') | pkg/compiler/lib/src/js_model/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698