Index: pkg/fletchc/lib/src/closure_environment.dart |
diff --git a/pkg/fletchc/lib/src/closure_environment.dart b/pkg/fletchc/lib/src/closure_environment.dart |
index f96131edec4b7bf477c98ac5a02db2126e57d675..4b1ab5653438d8d919d1851949262af35934deff 100644 |
--- a/pkg/fletchc/lib/src/closure_environment.dart |
+++ b/pkg/fletchc/lib/src/closure_environment.dart |
@@ -4,9 +4,6 @@ |
library fletchc.closure_environment; |
-import 'package:compiler/src/util/util.dart' show |
- SpannableAssertionFailure; |
- |
import 'package:compiler/src/resolution/semantic_visitor.dart'; |
import 'package:compiler/src/resolution/operators.dart' show |
@@ -16,10 +13,14 @@ import 'package:compiler/src/resolution/operators.dart' show |
UnaryOperator; |
import 'package:compiler/src/elements/elements.dart'; |
-import 'package:compiler/src/resolution/resolution.dart'; |
+import 'package:compiler/src/resolution/tree_elements.dart'; |
+import 'package:compiler/src/resolution/send_resolver.dart'; |
import 'package:compiler/src/tree/tree.dart'; |
-import 'package:compiler/src/universe/universe.dart'; |
-import 'package:compiler/src/util/util.dart' show Spannable; |
+import 'package:compiler/src/universe/selector.dart'; |
+import 'package:compiler/src/universe/call_structure.dart'; |
+import 'package:compiler/src/diagnostics/spannable.dart' show |
+ Spannable, |
+ SpannableAssertionFailure; |
import 'package:compiler/src/dart_types.dart'; |
enum CaptureMode { |
@@ -100,7 +101,7 @@ class ClosureVisitor |
assert(element.memberContext == element); |
assert(currentElement == null); |
currentElement = element; |
- if (element.node != null) element.node.accept(this); |
+ if (element.node != null) element.resolvedAst.node.accept(this); |
assert(currentElement == element); |
return closureEnvironment; |
} |
@@ -119,7 +120,7 @@ class ClosureVisitor |
void visitFunctionExpression(FunctionExpression node) { |
ExecutableElement oldElement = currentElement; |
- currentElement = elements[node]; |
+ currentElement = elements.getFunctionDefinition(node); |
if (currentElement != element) { |
ClosureInfo info = new ClosureInfo(); |
closureEnvironment.closures[currentElement] = info; |
@@ -227,9 +228,9 @@ class ClosureVisitor |
arguments.accept(this); |
} |
- void visitThisPropertySet(Send node, Selector selector, Node rhs, _) { |
+ void visitThisPropertySet(Send node, Name name, Node rhs, _) { |
markThisUsed(); |
- super.visitThisPropertySet(node, selector, rhs, null); |
+ super.visitThisPropertySet(node, name, rhs, null); |
} |
void visitLocalVariablePrefix( |
@@ -259,7 +260,7 @@ class ClosureVisitor |
void visitThisPropertyGet( |
Send node, |
- Selector selector, |
+ Name name, |
_) { |
markThisUsed(); |
} |
@@ -283,9 +284,10 @@ class ClosureVisitor |
expression.accept(this); |
} |
- void visitAssert(Send node, Node expression, _) { |
+ void visitAssert(Assert node) { |
// TODO(ajohnsen): Only visit in checked mode. |
- expression.accept(this); |
+ node.condition.accept(this); |
+ node.message?.accept(this); |
} |
void visitLocalVariableCompound( |
@@ -467,14 +469,13 @@ class ClosureVisitor |
void visitThisPropertyCompound( |
Send node, |
+ Name name, |
AssignmentOperator operator, |
Node rhs, |
- Selector getterSelector, |
- Selector setterSelector, |
_) { |
markThisUsed(); |
super.visitThisPropertyCompound( |
- node, operator, rhs, getterSelector, setterSelector, null); |
+ node, name, operator, rhs, null); |
} |
void visitParameterCompound( |
@@ -569,13 +570,12 @@ class ClosureVisitor |
void visitThisPropertyPrefix( |
Send node, |
+ Name name, |
IncDecOperator operator, |
- Selector getterSelector, |
- Selector setterSelector, |
_) { |
markThisUsed(); |
super.visitThisPropertyPrefix( |
- node, operator, getterSelector, setterSelector, null); |
+ node, name, operator, null); |
} |
void visitSuperFieldPrefix( |
@@ -658,13 +658,12 @@ class ClosureVisitor |
void visitThisPropertyPostfix( |
Send node, |
+ Name name, |
IncDecOperator operator, |
- Selector getterSelector, |
- Selector setterSelector, |
_) { |
markThisUsed(); |
super.visitThisPropertyPostfix( |
- node, operator, getterSelector, setterSelector, null); |
+ node, name, operator, null); |
} |
void visitSuperFieldPostfix( |
@@ -748,6 +747,10 @@ class ClosureVisitor |
node, indexFunction, indexSetFunction, index, operator, null); |
} |
+ @override |
+ void visitTypeAnnotation(TypeAnnotation node) { |
Johnni Winther
2015/11/19 10:17:26
Add a comment about why this is needed.
sigurdm
2015/11/19 14:33:46
Done.
|
+ } |
+ |
void handleImmutableLocalSet( |
SendSet node, |
LocalElement element, |