| Index: pkg/compiler/lib/src/kernel/kernel_visitor.dart
|
| diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
|
| index ae845896c21c6d2362d4acd7640a0027150010dc..84096868f299798236c7416173586ccd58dbcfb8 100644
|
| --- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
|
| +++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
|
| @@ -1145,8 +1145,13 @@ class KernelVisitor extends Object
|
|
|
| ir.Expression buildConstructorInvoke(NewExpression node, {bool isConst}) {
|
| ConstructorElement constructor = elements[node.send];
|
| - ConstructorTarget target =
|
| - kernel.computeEffectiveTarget(constructor, elements.getType(node));
|
| + ConstructorTarget target;
|
| + if (isConst) {
|
| + target =
|
| + kernel.computeEffectiveTarget(constructor, elements.getType(node));
|
| + } else {
|
| + target = new ConstructorTarget(constructor, elements.getType(node));
|
| + }
|
| NodeList arguments = node.send.argumentsNode;
|
| if (kernel.isSyntheticError(target.element)) {
|
| return new ir.MethodInvocation(new ir.InvalidExpression(),
|
| @@ -1206,7 +1211,10 @@ class KernelVisitor extends Object
|
| ir.FunctionExpression visitClosureDeclaration(FunctionExpression node,
|
| LocalFunctionElement closure, NodeList parameters, Node body, _) {
|
| return withCurrentElement(closure, () {
|
| - return new ir.FunctionExpression(buildFunctionNode(closure, body));
|
| + ir.FunctionExpression function =
|
| + new ir.FunctionExpression(buildFunctionNode(closure, body));
|
| + kernel.localFunctions[closure] = function;
|
| + return function;
|
| });
|
| }
|
|
|
|
|