Chromium Code Reviews| 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..ae281954f89c44bb36cd09ed629e14d04d6c0877 100644 |
| --- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
| +++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
| @@ -831,13 +831,12 @@ class CodeGenerator extends tree_ir.StatementVisitor |
| 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; |
| + //assert(typeInformation.isEmpty || |
| + // typeInformation.length == classElement.typeVariables.length); |
|
asgerf
2016/01/26 10:30:00
Clean up outcommented code.
sra1
2016/01/26 22:21:08
Done. It had to be removed since it can be a varia
|
| + 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 +988,13 @@ 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); |
| + if (node.isForInstance) { |
| + registry.registerInstantiatedClass(glue.listClass); |
| + return new js.ArrayInitializer(arguments); |
| + } else { |
| + return glue.generateTypeRepresentation( |
| + node.dartType, arguments, registry); |
| + } |
| } |
| js.Node handleForeignCode(tree_ir.ForeignCode node) { |