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 78ccd5829e5cb30eaef2996fc59e5e308f9eba5c..b95819bf05b32f69d7e06f6aa5c57e9683f57dd0 100644 |
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart |
@@ -614,7 +614,7 @@ class CodeGenerator extends tree_ir.StatementVisitor |
js.Expression argumentNames = new js.ArrayInitializer( |
node.selector.namedArguments.map(js.string).toList(growable: false)); |
return buildStaticHelperInvocation(glue.createInvocationMirrorMethod, |
- [name, internalName, kind, arguments, argumentNames]); |
+ <js.Expression>[name, internalName, kind, arguments, argumentNames]); |
} |
@override |
@@ -700,6 +700,21 @@ class CodeGenerator extends tree_ir.StatementVisitor |
return glue.generateTypeRepresentation(node.dartType, arguments); |
} |
+ js.Node handleForeignCode(tree_ir.ForeignCode node) { |
+ registry.registerStaticUse(node.dependency); |
+ return node.codeTemplate.instantiate(visitExpressionList(node.arguments)); |
+ } |
+ |
+ @override |
+ js.Expression visitForeignExpression(tree_ir.ForeignExpression node) { |
+ return handleForeignCode(node); |
+ } |
+ |
+ @override |
+ visitForeignStatement(tree_ir.ForeignStatement node) { |
+ return handleForeignCode(node); |
+ } |
+ |
@override |
js.Expression visitApplyBuiltinOperator(tree_ir.ApplyBuiltinOperator node) { |
List<js.Expression> args = visitExpressionList(node.arguments); |