| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 compiler.reportErrorCode(first, MessageKind.INVALID_FOR_IN); | 2728 compiler.reportErrorCode(first, MessageKind.INVALID_FOR_IN); |
| 2729 } else { | 2729 } else { |
| 2730 loopVariableSelector = new Selector.setter(identifier.source, library); | 2730 loopVariableSelector = new Selector.setter(identifier.source, library); |
| 2731 loopVariable = mapping[identifier]; | 2731 loopVariable = mapping[identifier]; |
| 2732 } | 2732 } |
| 2733 } else { | 2733 } else { |
| 2734 compiler.reportErrorCode(declaration, MessageKind.INVALID_FOR_IN); | 2734 compiler.reportErrorCode(declaration, MessageKind.INVALID_FOR_IN); |
| 2735 } | 2735 } |
| 2736 if (loopVariableSelector != null) { | 2736 if (loopVariableSelector != null) { |
| 2737 mapping.setSelector(declaration, loopVariableSelector); | 2737 mapping.setSelector(declaration, loopVariableSelector); |
| 2738 registerSend(loopVariableSelector, loopVariable); |
| 2738 } else { | 2739 } else { |
| 2739 // The selector may only be null if we reported an error. | 2740 // The selector may only be null if we reported an error. |
| 2740 assert(invariant(declaration, compiler.compilationFailed)); | 2741 assert(invariant(declaration, compiler.compilationFailed)); |
| 2741 } | 2742 } |
| 2742 if (loopVariable != null) { | 2743 if (loopVariable != null) { |
| 2743 // loopVariable may be null if it could not be resolved. | 2744 // loopVariable may be null if it could not be resolved. |
| 2744 mapping[declaration] = loopVariable; | 2745 mapping[declaration] = loopVariable; |
| 2745 } | 2746 } |
| 2746 visitLoopBodyIn(node, node.body, blockScope); | 2747 visitLoopBodyIn(node, node.body, blockScope); |
| 2747 } | 2748 } |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3876 return e; | 3877 return e; |
| 3877 } | 3878 } |
| 3878 | 3879 |
| 3879 /// Assumed to be called by [resolveRedirectingFactory]. | 3880 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3880 Element visitReturn(Return node) { | 3881 Element visitReturn(Return node) { |
| 3881 Node expression = node.expression; | 3882 Node expression = node.expression; |
| 3882 return finishConstructorReference(visit(expression), | 3883 return finishConstructorReference(visit(expression), |
| 3883 expression, expression); | 3884 expression, expression); |
| 3884 } | 3885 } |
| 3885 } | 3886 } |
| OLD | NEW |