| Index: sdk/lib/_internal/compiler/implementation/closure.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/closure.dart (revision 19427)
|
| +++ sdk/lib/_internal/compiler/implementation/closure.dart (working copy)
|
| @@ -193,9 +193,11 @@
|
|
|
| bool isClosure() => closureElement != null;
|
|
|
| - bool captures(Element element) => freeVariableMapping.containsKey(element);
|
| + bool isVariableCaptured(Element element) {
|
| + freeVariableMapping.containsKey(element);
|
| + }
|
|
|
| - bool mutates(Element element) {
|
| + bool isVariableBoxed(Element element) {
|
| Element copy = freeVariableMapping[element];
|
| return copy != null && !copy.isMember();
|
| }
|
| @@ -206,6 +208,21 @@
|
| f(variable);
|
| });
|
| }
|
| +
|
| + void forEachBoxedVariable(void f(Element element)) {
|
| + freeVariableMapping.forEach((variable, copy) {
|
| + if (!isVariableBoxed(variable)) return;
|
| + f(variable);
|
| + });
|
| + }
|
| +
|
| + void forEachNonBoxedCapturedVariable(void f(Element element)) {
|
| + freeVariableMapping.forEach((variable, copy) {
|
| + if (variable is BoxElement) return;
|
| + if (isVariableBoxed(variable)) return;
|
| + f(variable);
|
| + });
|
| + }
|
| }
|
|
|
| class ClosureTranslator extends Visitor {
|
|
|