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

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

Issue 16043007: Create a new scope when analyzing then and else of an if. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 statementScope = oldStatementScope; 1946 statementScope = oldStatementScope;
1947 1947
1948 scope = oldScope; 1948 scope = oldScope;
1949 enclosingElement = previousEnclosingElement; 1949 enclosingElement = previousEnclosingElement;
1950 1950
1951 world.registerInstantiatedClass(compiler.functionClass, mapping); 1951 world.registerInstantiatedClass(compiler.functionClass, mapping);
1952 } 1952 }
1953 1953
1954 visitIf(If node) { 1954 visitIf(If node) {
1955 visit(node.condition); 1955 visit(node.condition);
1956 visit(node.thenPart); 1956 visitIn(node.thenPart, new BlockScope(scope));
1957 visit(node.elsePart); 1957 visitIn(node.elsePart, new BlockScope(scope));
1958 } 1958 }
1959 1959
1960 static bool isLogicalOperator(Identifier op) { 1960 static bool isLogicalOperator(Identifier op) {
1961 String str = op.source.stringValue; 1961 String str = op.source.stringValue;
1962 return (identical(str, '&&') || str == '||' || str == '!'); 1962 return (identical(str, '&&') || str == '||' || str == '!');
1963 } 1963 }
1964 1964
1965 Element resolveSend(Send node) { 1965 Element resolveSend(Send node) {
1966 Selector selector = resolveSelector(node, null); 1966 Selector selector = resolveSelector(node, null);
1967 if (node.isSuperCall) mapping.superUses.add(node); 1967 if (node.isSuperCall) mapping.superUses.add(node);
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 return e; 3938 return e;
3939 } 3939 }
3940 3940
3941 /// Assumed to be called by [resolveRedirectingFactory]. 3941 /// Assumed to be called by [resolveRedirectingFactory].
3942 Element visitReturn(Return node) { 3942 Element visitReturn(Return node) {
3943 Node expression = node.expression; 3943 Node expression = node.expression;
3944 return finishConstructorReference(visit(expression), 3944 return finishConstructorReference(visit(expression),
3945 expression, expression); 3945 expression, expression);
3946 } 3946 }
3947 } 3947 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698