| Index: frog/leg/ssa/closure.dart
|
| diff --git a/frog/leg/ssa/closure.dart b/frog/leg/ssa/closure.dart
|
| index eead9b947743bb1ceeaabe9ec24ac6aa3d5a3f88..f8b6143d5019e017d1157caa41c86c5e1a8357c9 100644
|
| --- a/frog/leg/ssa/closure.dart
|
| +++ b/frog/leg/ssa/closure.dart
|
| @@ -147,7 +147,13 @@ class ClosureTranslator extends AbstractVisitor {
|
| }
|
|
|
| void useLocal(Element element) {
|
| - if (element.enclosingElement != currentFunctionElement) {
|
| + // TODO(floitsch): replace this with a general solution.
|
| + Element functionElement = currentFunctionElement;
|
| + if (functionElement.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
|
| + ConstructorBodyElement body = functionElement;
|
| + functionElement = body.constructor;
|
| + }
|
| + if (element.enclosingElement != functionElement) {
|
| assert(closureData.freeVariableMapping[element] == null ||
|
| closureData.freeVariableMapping[element] == element);
|
| closureData.freeVariableMapping[element] = element;
|
|
|