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

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

Issue 1062913003: Extract CallStructure from Selector. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix expentancy in unittest Created 5 years, 8 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 | « pkg/analyzer2dart/lib/src/modely.dart ('k') | pkg/compiler/lib/src/common.dart » ('j') | 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 175ca25b47159c2eae98fc7ab29d5e3ce236362f..4aaa293a517a487019f9f1d0da5edbc01a2695fe 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -93,7 +93,7 @@ abstract class CapturedVariable {}
// TODO(ahe): These classes continuously cause problems. We need to
// find a more general solution.
class ClosureFieldElement extends ElementX
- implements VariableElement, CapturedVariable {
+ implements FieldElement, CapturedVariable {
/// The [BoxLocal] or [LocalElement] being accessed through the field.
final Local local;
@@ -146,6 +146,9 @@ class ClosureFieldElement extends ElementX
accept(ElementVisitor visitor) => visitor.visitClosureFieldElement(this);
Element get analyzableElement => closureClass.methodElement.analyzableElement;
+
+ @override
+ List<FunctionElement> get nestedClosures => const <FunctionElement>[];
}
// TODO(ahe): These classes continuously cause problems. We need to find
@@ -226,7 +229,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 {
+ implements TypedElement, CapturedVariable, FieldElement {
final BoxLocal box;
BoxFieldElement(String name, this.variableElement, BoxLocal box)
@@ -240,6 +243,33 @@ class BoxFieldElement extends ElementX
final VariableElement variableElement;
accept(ElementVisitor visitor) => visitor.visitBoxFieldElement(this);
+
+ @override
+ bool get hasNode => false;
+
+ @override
+ bool get hasResolvedAst => false;
+
+ @override
+ Expression get initializer {
+ throw new UnsupportedError("BoxFieldElement.initializer");
+ }
+
+ @override
+ MemberElement get memberContext => box.executableContext.memberContext;
+
+ @override
+ List<FunctionElement> get nestedClosures => const <FunctionElement>[];
+
+ @override
+ Node get node {
+ throw new UnsupportedError("BoxFieldElement.node");
+ }
+
+ @override
+ ResolvedAst get resolvedAst {
+ throw new UnsupportedError("BoxFieldElement.resolvedAst");
+ }
}
/// A local variable used encode the direct (uncaptured) references to [this].
@@ -254,7 +284,8 @@ class ThisLocal extends Local {
}
/// Call method of a closure class.
-class SynthesizedCallMethodElementX extends BaseFunctionElementX {
+class SynthesizedCallMethodElementX extends BaseFunctionElementX
+ implements MethodElement {
final LocalFunctionElement expression;
SynthesizedCallMethodElementX(String name,
« no previous file with comments | « pkg/analyzer2dart/lib/src/modely.dart ('k') | pkg/compiler/lib/src/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698