Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 2956393002: Entity-ify BoxLocal. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 94eb03da53100403fe44cad8437f5caa854c3430..1fb4e5000d4b030cfbc8693d5c7bad91a0ed899d 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -499,15 +499,13 @@ class ClosureClassElement extends ClassElementX {
/// fields.
class BoxLocal extends Local {
final String name;
- final ExecutableElement executableContext;
+ final Entity executableContext;
+ final MemberEntity memberContext;
final int hashCode = _nextHashCode = (_nextHashCode + 10007).toUnsigned(30);
static int _nextHashCode = 0;
- BoxLocal(this.name, this.executableContext);
-
- @override
- MemberElement get memberContext => executableContext.memberContext;
+ BoxLocal(this.name, this.executableContext, this.memberContext);
String toString() => 'BoxLocal($name)';
}
@@ -549,7 +547,7 @@ class BoxFieldElement extends ElementX
}
@override
- MemberElement get memberContext => box.executableContext.memberContext;
+ MemberElement get memberContext => box.memberContext;
@override
List<FunctionElement> get nestedClosures => const <FunctionElement>[];
@@ -1228,7 +1226,8 @@ class ClosureTranslator extends Visitor {
if (box == null) {
// TODO(floitsch): construct better box names.
String boxName = getBoxFieldName(closureFieldCounter++);
- box = new BoxLocal(boxName, executableContext);
+ box = new BoxLocal(
+ boxName, executableContext, executableContext.memberContext);
}
String elementName = variable.name;
String boxedName =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698