Chromium Code Reviews| 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. |
|
ngeoffray
2012/02/17 10:03:50
Please explain the hack: a parameter with a functi
|
| + 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. |
|
ngeoffray
2012/02/17 10:03:50
Not sure I understand this comment, because the ba
ahe
2012/02/17 16:26:46
The backend should run through "element.computePar
|
| node.visitChildren(this); |
| attachCapturedScopeVariables(node); |