| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| index 7b0b1a119c67bf8984bad08d580bc1cce559bd00..215ce846235407ca11db16620d934751a6ca4bff 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
| @@ -1796,7 +1796,8 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
|
| List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
|
| // TODO(floitsch): jsClassReference is an Access. We shouldn't treat it
|
| // as if it was a string.
|
| - push(new js.New(new js.VariableUse(jsClassReference), arguments), node);
|
| + js.Expression constructor = new js.VariableUse(jsClassReference);
|
| + push(new js.New(constructor, arguments), node);
|
| registerForeignTypes(node);
|
| if (node.instantiatedTypes == null) {
|
| return;
|
| @@ -1820,6 +1821,15 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
|
| FunctionConstant function = constant;
|
| world.registerStaticUse(function.element);
|
| }
|
| + if (constant.isType()) {
|
| + // If the type is a web component, we need to ensure the constructors are
|
| + // available to 'upgrade' the native object.
|
| + TypeConstant type = constant;
|
| + Element element = type.representedType.element;
|
| + if (element != null && element.isClass()) {
|
| + world.registerEscapingConstructorsOfClass(element);
|
| + }
|
| + }
|
| push(backend.emitter.constantReference(constant));
|
| }
|
|
|
|
|