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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 13865004: Fix issue https://code.google.com/p/dart/issues/detail?id=9251, by compiling for/in correctly. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698