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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/closure.dart

Issue 19676002: Implement top-level getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r25274 Created 7 years, 5 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 | « dart/pkg/pkg.status ('k') | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/closure.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/closure.dart b/dart/sdk/lib/_internal/compiler/implementation/closure.dart
index a10ccbdf821b2f4ac4e77bcc5aae835ec7b7405d..b0061d90dbc3690e801f991b81337856ab7690ee 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/closure.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/closure.dart
@@ -18,7 +18,6 @@ class ClosureNamer {
}
}
-
class ClosureTask extends CompilerTask {
Map<Node, ClosureClassMap> closureMappingCache;
ClosureNamer namer;
@@ -68,12 +67,26 @@ class ClosureTask extends CompilerTask {
// TODO(ahe): These classes continuously cause problems. We need to
// move these classes to elements/modelx.dart or see if we can find a
// more general solution.
-class ClosureFieldElement extends ElementX {
+class ClosureFieldElement extends ElementX implements VariableElement {
+ /// The source variable this element refers to.
+ final Element variableElement;
+
ClosureFieldElement(SourceString name,
this.variableElement,
ClassElement enclosing)
: super(name, ElementKind.FIELD, enclosing);
+ VariableListElement get variables {
+ throw new SpannableAssertionFailure(
+ variableElement, 'Should not access variables of ClosureFieldElement.');
+ }
+
+ Expression get cachedNode {
+ throw new SpannableAssertionFailure(
+ variableElement,
+ 'Should not access cachedNode of ClosureFieldElement.');
+ }
+
bool isInstanceMember() => true;
bool isAssignable() => false;
// The names of closure variables don't need renaming, since their use is very
@@ -86,11 +99,6 @@ class ClosureFieldElement extends ElementX {
}
String toString() => "ClosureFieldElement($name)";
-
- /**
- * The source variable this element refers to.
- */
- final Element variableElement;
}
// TODO(ahe): These classes continuously cause problems. We need to
« no previous file with comments | « dart/pkg/pkg.status ('k') | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698