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

Unified Diff: pkg/compiler/lib/src/js_model/locals.dart

Issue 2965763002: Support break in switch and break/continue in do statements (Closed)
Patch Set: 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_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_model/locals.dart
diff --git a/pkg/compiler/lib/src/js_model/locals.dart b/pkg/compiler/lib/src/js_model/locals.dart
index a79037a6dafd542530dc1c04c95a039af44e85f7..538fe733e889cd1708e2e135c7c63ff6506734fd 100644
--- a/pkg/compiler/lib/src/js_model/locals.dart
+++ b/pkg/compiler/lib/src/js_model/locals.dart
@@ -91,7 +91,7 @@ class KernelToLocalsMapImpl implements KernelToLocalsMap {
@override
JumpTarget getJumpTargetForDo(ir.DoStatement node) {
_ensureJumpMap(node);
- return _jumpTargetMap[node.parent];
+ return _jumpTargetMap[node];
}
@override
@@ -103,8 +103,7 @@ class KernelToLocalsMapImpl implements KernelToLocalsMap {
@override
JumpTarget getJumpTargetForSwitch(ir.SwitchStatement node) {
_ensureJumpMap(node);
- throw new UnimplementedError(
- 'KernelToLocalsMapImpl.getJumpTargetForSwitch');
+ return _jumpTargetMap[node];
}
@override
@@ -161,14 +160,17 @@ class JumpVisitor extends ir.Visitor {
// TODO(johnniwinther): Add more.
Siggi Cherem (dart-lang) 2017/06/30 18:16:21 anything more to add for break?
Johnni Winther 2017/06/30 19:16:55 No. Removed.
return node is ir.ForStatement ||
node is ir.ForInStatement ||
- node is ir.WhileStatement;
+ node is ir.WhileStatement ||
+ node is ir.DoStatement ||
Siggi Cherem (dart-lang) 2017/06/30 18:16:21 I thought you said there was more to this than jus
Johnni Winther 2017/06/30 19:16:55 The problem was that continue in do requires a lab
+ node is ir.SwitchStatement;
}
bool _canBeContinueTarget(ir.TreeNode node) {
// TODO(johnniwinther): Add more.
Siggi Cherem (dart-lang) 2017/06/30 18:16:21 here we are missing continue to switch-case, corre
Johnni Winther 2017/06/30 19:16:55 That's the only one.
return node is ir.ForStatement ||
node is ir.ForInStatement ||
- node is ir.WhileStatement;
+ node is ir.WhileStatement ||
+ node is ir.DoStatement;
}
@override
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698