| Index: pkg/compiler/lib/src/closure.dart
|
| diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
|
| index 6dacea63154b7b81b3c29e4ce148533d4e327ae1..50d827a2591f2d66ab902ce7b82d1d2653ecf4fa 100644
|
| --- a/pkg/compiler/lib/src/closure.dart
|
| +++ b/pkg/compiler/lib/src/closure.dart
|
| @@ -130,15 +130,10 @@ class ClosureTask extends CompilerTask implements ClosureClassMaps {
|
| }
|
| }
|
|
|
| -/// Common interface for [BoxFieldElement] and [ClosureFieldElement] as
|
| -/// non-elements.
|
| -// TODO(johnniwinther): Remove `implements Element`.
|
| -abstract class CapturedVariable implements Element {}
|
| -
|
| // TODO(ahe): These classes continuously cause problems. We need to
|
| // find a more general solution.
|
| class ClosureFieldElement extends ElementX
|
| - implements FieldElement, CapturedVariable, PrivatelyNamedJSEntity {
|
| + implements FieldElement, PrivatelyNamedJSEntity {
|
| /// The [BoxLocal] or [LocalElement] being accessed through the field.
|
| final Local local;
|
|
|
| @@ -295,11 +290,7 @@ class BoxLocal extends Local {
|
| // TODO(ngeoffray, ahe): These classes continuously cause problems. We need to
|
| // find a more general solution.
|
| class BoxFieldElement extends ElementX
|
| - implements
|
| - TypedElement,
|
| - CapturedVariable,
|
| - FieldElement,
|
| - PrivatelyNamedJSEntity {
|
| + implements TypedElement, FieldElement, PrivatelyNamedJSEntity {
|
| final BoxLocal box;
|
|
|
| BoxFieldElement(String name, this.variableElement, BoxLocal box)
|
| @@ -422,7 +413,7 @@ class ClosureScope {
|
| // If the scope is attached to a [For] contains the variables that are
|
| // declared in the initializer of the [For] and that need to be boxed.
|
| // Otherwise contains the empty List.
|
| - List<VariableElement> boxedLoopVariables = const <VariableElement>[];
|
| + List<Local> boxedLoopVariables = const <Local>[];
|
|
|
| ClosureScope(this.boxElement, this.capturedVariables);
|
|
|
| @@ -482,8 +473,7 @@ class ClosureClassMap {
|
|
|
| /// Maps free locals, arguments, function elements, and box locals to
|
| /// their locations.
|
| - final Map<Local, CapturedVariable> freeVariableMap =
|
| - new Map<Local, CapturedVariable>();
|
| + final Map<Local, FieldEntity> freeVariableMap = new Map<Local, FieldEntity>();
|
|
|
| /// Maps [Loop] and [FunctionExpression] nodes to their [ClosureScope] which
|
| /// contains their box and the captured variables that are stored in the box.
|
| @@ -513,7 +503,7 @@ class ClosureClassMap {
|
| return freeVariableMap.containsKey(element);
|
| }
|
|
|
| - void forEachFreeVariable(f(Local variable, CapturedVariable field)) {
|
| + void forEachFreeVariable(f(Local variable, FieldEntity field)) {
|
| freeVariableMap.forEach(f);
|
| }
|
|
|
| @@ -530,14 +520,14 @@ class ClosureClassMap {
|
| }
|
|
|
| bool isVariableBoxed(Local variable) {
|
| - CapturedVariable copy = freeVariableMap[variable];
|
| + FieldEntity copy = freeVariableMap[variable];
|
| if (copy is BoxFieldElement) {
|
| return true;
|
| }
|
| return capturingScopesBox(variable);
|
| }
|
|
|
| - void forEachCapturedVariable(void f(Local variable, CapturedVariable field)) {
|
| + void forEachCapturedVariable(void f(Local variable, FieldEntity field)) {
|
| freeVariableMap.forEach((variable, copy) {
|
| if (variable is BoxLocal) return;
|
| f(variable, copy);
|
|
|