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

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

Issue 304153014: Remove element from DynamicType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix infinite loop. Created 6 years, 7 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 | sdk/lib/_internal/compiler/implementation/compile_time_constants.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/closure.dart
diff --git a/sdk/lib/_internal/compiler/implementation/closure.dart b/sdk/lib/_internal/compiler/implementation/closure.dart
index a7ae252e14c1252f748d6829fdff09c558013f59..b85551bb02b599eb2b552982aebfe973b4153b75 100644
--- a/sdk/lib/_internal/compiler/implementation/closure.dart
+++ b/sdk/lib/_internal/compiler/implementation/closure.dart
@@ -43,8 +43,7 @@ class ClosureTask extends CompilerTask {
if (node is FunctionExpression) {
translator.translateFunction(element, node);
} else if (element.isSynthesized) {
- return new ClosureClassMap(null, null, null,
- new ThisElement(element, compiler.types.dynamicType));
+ return new ClosureClassMap(null, null, null, new ThisElement(element));
} else {
assert(element.isField);
VariableElement field = element;
@@ -54,8 +53,7 @@ class ClosureTask extends CompilerTask {
} else {
assert(element.isInstanceMember);
closureMappingCache[node] =
- new ClosureClassMap(null, null, null,
- new ThisElement(element, compiler.types.dynamicType));
+ new ClosureClassMap(null, null, null, new ThisElement(element));
}
}
assert(closureMappingCache[node] != null);
@@ -171,13 +169,13 @@ class ClosureClassElement extends ClassElementX {
// move these classes to elements/modelx.dart or see if we can find a
// more general solution.
class BoxElement extends ElementX implements TypedElement {
- final DartType type;
-
- BoxElement(String name, Element enclosingElement, this.type)
+ BoxElement(String name, Element enclosingElement)
: super(name, ElementKind.VARIABLE_LIST, enclosingElement);
DartType computeType(Compiler compiler) => type;
+ DartType get type => const DynamicType();
+
accept(ElementVisitor visitor) => visitor.visitBoxElement(this);
}
@@ -203,14 +201,14 @@ class BoxFieldElement extends ElementX implements TypedElement {
// move these classes to elements/modelx.dart or see if we can find a
// more general solution.
class ThisElement extends ElementX implements TypedElement {
- final DartType type;
-
- ThisElement(Element enclosing, this.type)
+ ThisElement(Element enclosing)
: super('this', ElementKind.PARAMETER, enclosing);
bool get isAssignable => false;
- DartType computeType(Compiler compiler) => compiler.types.dynamicType;
+ DartType computeType(Compiler compiler) => type;
+
+ DartType get type => const DynamicType();
// Since there is no declaration corresponding to 'this', use the position of
// the enclosing method.
@@ -637,7 +635,7 @@ class ClosureTranslator extends Visitor {
String boxName =
namer.getClosureVariableName('box', closureFieldCounter++);
box = new BoxElement(
- boxName, currentElement, compiler.types.dynamicType);
+ boxName, currentElement);
}
String elementName = element.name;
String boxedName =
@@ -766,7 +764,7 @@ class ClosureTranslator extends Visitor {
outermostElement = element;
Element thisElement = null;
if (element.isInstanceMember || element.isGenerativeConstructor) {
- thisElement = new ThisElement(element, compiler.types.dynamicType);
+ thisElement = new ThisElement(element);
}
closureData = new ClosureClassMap(null, null, null, thisElement);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698