| Index: dart/frog/leg/ssa/closure.dart
|
| diff --git a/dart/frog/leg/ssa/closure.dart b/dart/frog/leg/ssa/closure.dart
|
| index 6dc77ce4404b3bf7c6f47366b06bd0eb2871ebca..707634a2f782d69fc3430cd71f8313d25ba8ed63 100644
|
| --- a/dart/frog/leg/ssa/closure.dart
|
| +++ b/dart/frog/leg/ssa/closure.dart
|
| @@ -309,7 +309,12 @@ class ClosureTranslator extends AbstractVisitor {
|
| }
|
|
|
| visitFunctionExpression(FunctionExpression node) {
|
| - FunctionElement element = elements[node];
|
| + Element element = elements[node];
|
| + if (element.kind === ElementKind.PARAMETER) {
|
| + // TODO(ahe): This is a hack. This method should *not* call
|
| + // visitChildren.
|
| + return node.name.accept(this);
|
| + }
|
| bool isClosure = (closureData !== null);
|
|
|
| if (isClosure) closures.add(node);
|
| @@ -360,6 +365,9 @@ class ClosureTranslator extends AbstractVisitor {
|
| declareLocal(element);
|
| }
|
|
|
| + // TODO(ahe): This is problematic. The backend should not repeat
|
| + // the work of the resolver. It is the resolver's job to create
|
| + // parameters, etc. Other phases should only visit statements.
|
| node.visitChildren(this);
|
|
|
| attachCapturedScopeVariables(node);
|
|
|