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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen_listener.dart

Issue 2750503003: Register type constants through ConstantUse (Closed)
Patch Set: Created 3 years, 9 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_backend/codegen_listener.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen_listener.dart b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
index 8de2576f6b08f215dff7ae197a22dbfec32b87b7..705fbfa8a8ab46e7311f28da4042eaa3b93d2080 100644
--- a/pkg/compiler/lib/src/js_backend/codegen_listener.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
@@ -211,6 +211,14 @@ class CodegenEnqueuerListener extends EnqueuerListener {
} else if (constant.isType) {
impactBuilder
.registerTypeUse(new TypeUse.instantiation(_backendClasses.typeType));
+ // If the type is a web component, we need to ensure the constructors are
+ // available to 'upgrade' the native object.
+ TypeConstantValue type = constant;
+ if (type.representedType.isInterfaceType) {
+ ResolutionInterfaceType representedType = type.representedType;
+ _customElementsAnalysis.registerTypeConstant(representedType.element);
+ _lookupMapAnalysis.registerTypeConstant(representedType.element);
+ }
}
_lookupMapAnalysis.registerConstantKey(constant);
}

Powered by Google App Engine
This is Rietveld 408576698