| Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
|
| index e7cc68a4c981c0a13b9645a0b23af79b8b9cae2c..85afd266b5010c190d67ef3f6fd4aa900540259c 100644
|
| --- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
|
| @@ -827,17 +827,14 @@ class CodeGenerator extends tree_ir.StatementVisitor
|
| registry.registerInstantiatedClosure(classElement.methodElement);
|
| }
|
| js.Expression instance = new js.New(
|
| - glue.constructorAccess(classElement),
|
| - visitExpressionList(node.arguments))
|
| + glue.constructorAccess(classElement),
|
| + visitExpressionList(node.arguments))
|
| .withSourceInformation(node.sourceInformation);
|
|
|
| - List<tree_ir.Expression> typeInformation = node.typeInformation;
|
| - assert(typeInformation.isEmpty ||
|
| - typeInformation.length == classElement.typeVariables.length);
|
| - if (typeInformation.isNotEmpty) {
|
| + tree_ir.Expression typeInformation = node.typeInformation;
|
| + if (typeInformation != null) {
|
| FunctionElement helper = glue.getAddRuntimeTypeInformation();
|
| - js.Expression typeArguments = new js.ArrayInitializer(
|
| - visitExpressionList(typeInformation));
|
| + js.Expression typeArguments = visitExpression(typeInformation);
|
| return buildStaticHelperInvocation(helper,
|
| <js.Expression>[instance, typeArguments],
|
| sourceInformation: node.sourceInformation);
|
| @@ -989,7 +986,14 @@ class CodeGenerator extends tree_ir.StatementVisitor
|
| @override
|
| js.Expression visitTypeExpression(tree_ir.TypeExpression node) {
|
| List<js.Expression> arguments = visitExpressionList(node.arguments);
|
| - return glue.generateTypeRepresentation(node.dartType, arguments, registry);
|
| + switch (node.kind) {
|
| + case tree_ir.TypeExpressionKind.COMPLETE:
|
| + return glue.generateTypeRepresentation(
|
| + node.dartType, arguments, registry);
|
| + case tree_ir.TypeExpressionKind.INSTANCE:
|
| + registry.registerInstantiatedClass(glue.listClass);
|
| + return new js.ArrayInitializer(arguments);
|
| + }
|
| }
|
|
|
| js.Node handleForeignCode(tree_ir.ForeignCode node) {
|
|
|