| 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..aeb4f593cde33502422d7b2d49ef51a2a1ee4076 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 {
|
| @@ -68,7 +69,6 @@ class ClosureVisitor
|
| extends SemanticVisitor
|
| with TraversalSendMixin,
|
| SemanticSendResolvedMixin,
|
| - SendResolverMixin,
|
| BaseImplementationOfLocalsMixin,
|
| VariableBulkMixin,
|
| ParameterBulkMixin,
|
| @@ -100,7 +100,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 +119,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 +227,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 +259,7 @@ class ClosureVisitor
|
|
|
| void visitThisPropertyGet(
|
| Send node,
|
| - Selector selector,
|
| + Name name,
|
| _) {
|
| markThisUsed();
|
| }
|
| @@ -283,9 +283,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 +468,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 +569,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 +657,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 +746,12 @@ class ClosureVisitor
|
| node, indexFunction, indexSetFunction, index, operator, null);
|
| }
|
|
|
| + @override
|
| + void visitTypeAnnotation(TypeAnnotation node) {
|
| + // This is to avoid the inherited implementation that visits children and
|
| + // throws when encountering anything unresolved.
|
| + }
|
| +
|
| void handleImmutableLocalSet(
|
| SendSet node,
|
| LocalElement element,
|
|
|