| Index: sdk/lib/_internal/compiler/implementation/closure.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/closure.dart b/sdk/lib/_internal/compiler/implementation/closure.dart
|
| index a7ae252e14c1252f748d6829fdff09c558013f59..388eb2c14ccba45d7620db35e61a053779132ced 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/closure.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/closure.dart
|
| @@ -454,9 +454,11 @@ class ClosureTranslator extends Visitor {
|
| closureData.freeVariableMapping[element] == element);
|
| closureData.freeVariableMapping[element] = element;
|
| } else if (inTryStatement) {
|
| - // Don't mark the this-element. This would complicate things in the
|
| - // builder.
|
| - if (element != closureData.thisElement) {
|
| + // Don't mark the this-element or a self-reference. This would complicate
|
| + // things in the builder.
|
| + // Note that nested (named) functions are immutable.
|
| + if (element != closureData.thisElement &&
|
| + element != closureData.closureElement) {
|
| // TODO(ngeoffray): only do this if the variable is mutated.
|
| closureData.usedVariablesInTry.add(element);
|
| }
|
|
|