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

Side by Side Diff: pkg/fasta/lib/src/kernel/body_builder.dart

Issue 2642713002: Implement correct scope of for-in expression. (Closed)
Patch Set: Add comment to status files. Created 3 years, 11 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
« no previous file with comments | « pkg/dart_parser/lib/src/parser.dart ('k') | pkg/fasta/test/compile.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import 'package:dart_parser/src/parser.dart' show 7 import 'package:dart_parser/src/parser.dart' show
8 FormalParameterType, 8 FormalParameterType,
9 optional; 9 optional;
10 10
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 continueTarget.resolveContinues(body); 1671 continueTarget.resolveContinues(body);
1672 } 1672 }
1673 Statement result = new DoStatement(body, condition); 1673 Statement result = new DoStatement(body, condition);
1674 if (breakTarget.hasUsers) { 1674 if (breakTarget.hasUsers) {
1675 result = new LabeledStatement(result); 1675 result = new LabeledStatement(result);
1676 breakTarget.resolveBreaks(result); 1676 breakTarget.resolveBreaks(result);
1677 } 1677 }
1678 exitLoopOrSwitch(result); 1678 exitLoopOrSwitch(result);
1679 } 1679 }
1680 1680
1681 void beginForInExpression(Token token) {
1682 enterLocalScope(scope.parent);
1683 }
1684
1685 void endForInExpression(Token token) {
1686 debugEvent("ForInExpression");
1687 Expression expression = popForValue();
1688 exitLocalScope();
1689 push(expression ?? NullValue.Expression);
1690 }
1691
1681 void endForIn( 1692 void endForIn(
1682 Token awaitToken, Token forToken, Token inKeyword, Token endToken) { 1693 Token awaitToken, Token forToken, Token inKeyword, Token endToken) {
1683 debugEvent("ForIn"); 1694 debugEvent("ForIn");
1684 Statement body = popStatement(); 1695 Statement body = popStatement();
1685 Expression expression = popForValue(); 1696 Expression expression = popForValue();
1686 var lvalue = pop(); 1697 var lvalue = pop();
1687 exitLocalScope(); 1698 exitLocalScope();
1688 JumpTarget continueTarget = exitContinueTarget(); 1699 JumpTarget continueTarget = exitContinueTarget();
1689 JumpTarget breakTarget = exitBreakTarget(); 1700 JumpTarget breakTarget = exitBreakTarget();
1690 if (continueTarget.hasUsers) { 1701 if (continueTarget.hasUsers) {
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 } else if (node is TypeDeclarationBuilder) { 2516 } else if (node is TypeDeclarationBuilder) {
2506 return node.name; 2517 return node.name;
2507 } else if (node is PrefixBuilder) { 2518 } else if (node is PrefixBuilder) {
2508 return node.name; 2519 return node.name;
2509 } else if (node is ThisPropertyAccessor) { 2520 } else if (node is ThisPropertyAccessor) {
2510 return node.name.name; 2521 return node.name.name;
2511 } else { 2522 } else {
2512 return internalError("Unhandled: ${node.runtimeType}"); 2523 return internalError("Unhandled: ${node.runtimeType}");
2513 } 2524 }
2514 } 2525 }
OLDNEW
« no previous file with comments | « pkg/dart_parser/lib/src/parser.dart ('k') | pkg/fasta/test/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698