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

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

Issue 14969004: Implement continue for switch. (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 7e1beaa95326184c87cde3d991cae127e5122ab5..26a0f760e49f077814a62394a33b6769f73c1b3d 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2715,10 +2715,6 @@ class ResolverVisitor extends MappingVisitor<Element> {
if (!target.statement.isValidContinueTarget()) {
error(node.target, MessageKind.INVALID_CONTINUE);
}
- // TODO(lrn): Handle continues to switch cases.
- if (target.statement is SwitchCase) {
- unimplemented(node, "continue to switch case");
- }
label.setContinueTarget();
mapping[node.target] = label;
}
@@ -2898,19 +2894,8 @@ class ResolverVisitor extends MappingVisitor<Element> {
}
}
- TargetElement targetElement =
- new TargetElementX(switchCase,
- statementScope.nestingLevel,
- enclosingElement);
- if (mapping[switchCase] != null) {
- // TODO(ahe): Talk to Lasse about this.
- mapping.remove(switchCase);
- }
- mapping[switchCase] = targetElement;
-
- LabelElement labelElement =
- new LabelElementX(label, labelName,
- targetElement, enclosingElement);
+ TargetElement targetElement = getOrCreateTargetElement(switchCase);
+ LabelElement labelElement = targetElement.addLabel(label, labelName);
mapping[label] = labelElement;
continueLabels[labelName] = labelElement;
}

Powered by Google App Engine
This is Rietveld 408576698