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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart

Issue 2956883002: Handle continue and break in for-in and while loops (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
index 6e8bcd296de4d642905ce877fb610a42f13f11b2..3df0af277150b8dcc3f7fbe825f74e10647d2594 100644
--- a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
@@ -371,13 +371,13 @@ class KernelToLocalsMapImpl implements KernelToLocalsMap {
@override
JumpTarget getJumpTargetForForIn(ir.ForInStatement node) {
_ensureJumpMap(node);
- return _jumpTargetMap[node.parent];
+ return _jumpTargetMap[node];
}
@override
JumpTarget getJumpTargetForWhile(ir.WhileStatement node) {
_ensureJumpMap(node);
- return _jumpTargetMap[node.parent];
+ return _jumpTargetMap[node];
}
@override
@@ -414,12 +414,16 @@ class JumpVisitor extends ir.Visitor {
bool _canBeBreakTarget(ir.TreeNode node) {
// TODO(johnniwinther): Add more.
- return node is ir.ForStatement;
+ return node is ir.ForStatement ||
+ node is ir.ForInStatement ||
+ node is ir.WhileStatement;
}
bool _canBeContinueTarget(ir.TreeNode node) {
// TODO(johnniwinther): Add more.
- return node is ir.ForStatement;
+ return node is ir.ForStatement ||
+ node is ir.ForInStatement ||
+ node is ir.WhileStatement;
}
@override
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698