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

Unified Diff: runtime/vm/scopes.cc

Issue 9347032: Fix issue 1246 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | « runtime/vm/scopes.h ('k') | tests/language/src/ContinueTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
===================================================================
--- runtime/vm/scopes.cc (revision 4004)
+++ runtime/vm/scopes.cc (working copy)
@@ -274,15 +274,17 @@
}
-SourceLabel* LocalScope::LookupInnermostLabel() {
+SourceLabel* LocalScope::LookupInnermostLabel(Token::Kind jump_kind) {
+ ASSERT((jump_kind == Token::kCONTINUE) || (jump_kind == Token::kBREAK));
LocalScope* current_scope = this;
while (current_scope != NULL) {
for (intptr_t i = 0; i < current_scope->labels_.length(); i++) {
SourceLabel* label = current_scope->labels_[i];
- if (label->kind() == SourceLabel::kWhile ||
- label->kind() == SourceLabel::kFor ||
- label->kind() == SourceLabel::kDoWhile ||
- label->kind() == SourceLabel::kSwitch) {
+ if ((label->kind() == SourceLabel::kWhile) ||
+ (label->kind() == SourceLabel::kFor) ||
+ (label->kind() == SourceLabel::kDoWhile) ||
+ ((jump_kind == Token::kBREAK) &&
+ (label->kind() == SourceLabel::kSwitch))) {
return label;
}
}
« no previous file with comments | « runtime/vm/scopes.h ('k') | tests/language/src/ContinueTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698