| Index: frog/leg/ssa/closure.dart
|
| diff --git a/frog/leg/ssa/closure.dart b/frog/leg/ssa/closure.dart
|
| index 456803d80e4f1f6169ec9b9aad24464a9e36139a..1d7e3e62679f14c3896974b0f54d0e45ae8f2a65 100644
|
| --- a/frog/leg/ssa/closure.dart
|
| +++ b/frog/leg/ssa/closure.dart
|
| @@ -143,7 +143,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;
|
|
|