Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart |
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
index f1c8f8a18b0bef109627198e288672561d769435..4036c1ae87d562dc99fc6ef69d14cc3cded1ca61 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
@@ -3396,7 +3396,7 @@ class CodeGenerator extends GeneralizingAstVisitor |
if (targetType is FunctionType) { |
// Call methods on function types should be handled as regular function |
// invocations. |
- return _emitFunctionCall(node); |
+ return _emitFunctionCall(node, node.target); |
} |
if (targetType.isDartCoreFunction || targetType.isDynamic) { |
// TODO(vsm): Can a call method take generic type parameters? |
@@ -3543,10 +3543,13 @@ class CodeGenerator extends GeneralizingAstVisitor |
/// Emits a function call, to a top-level function, local function, or |
/// an expression. |
- JS.Expression _emitFunctionCall(InvocationExpression node) { |
- var fn = _visit(node.function); |
+ JS.Expression _emitFunctionCall(InvocationExpression node, [Expression function]) { |
Jennifer Messerly
2016/12/01 23:20:33
do you mind running format?
|
+ if (function == null) { |
+ function = node.function; |
+ } |
+ var fn = _visit(function); |
var args = _visit(node.argumentList) as List<JS.Expression>; |
- if (isDynamicInvoke(node.function)) { |
+ if (isDynamicInvoke(function)) { |
return _emitDynamicInvoke(node, fn, args); |
} else { |
return new JS.Call(_applyInvokeTypeArguments(fn, node), args); |