Index: pkg/compiler/lib/src/kernel/closure.dart |
diff --git a/pkg/compiler/lib/src/kernel/closure.dart b/pkg/compiler/lib/src/kernel/closure.dart |
index f441d7fbc02cae60edeeb2deb4d3a6833ba96c02..9354ae3c29280f351abcde25a64792e1cb9b5ab2 100644 |
--- a/pkg/compiler/lib/src/kernel/closure.dart |
+++ b/pkg/compiler/lib/src/kernel/closure.dart |
@@ -47,6 +47,14 @@ class KernelClosureDataBuilder extends ir.Visitor { |
info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable)); |
} |
} |
+ |
+ @override |
+ visitVariableSet(ir.VariableSet node) { |
+ if (_inTry) { |
+ info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable)); |
+ } |
+ node.visitChildren(this); |
+ } |
} |
/// Closure conversion code using our new Entity model. Closure conversion is |
@@ -131,4 +139,11 @@ class KernelClosureRepresentationInfo extends ClosureRepresentationInfo { |
bool variableIsUsedInTryOrSync(Local variable) => |
_localsUsedInTryOrSync.contains(variable); |
+ |
+ String toString() { |
+ StringBuffer sb = new StringBuffer(); |
+ sb.write('this=$thisLocal,'); |
+ sb.write('localsUsedInTryOrSync={${_localsUsedInTryOrSync.join(', ')}}'); |
+ return sb.toString(); |
+ } |
} |