Chromium Code Reviews| Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java |
| diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java |
| index ea7012e7cf00e7118200f4b1f790af480423ac7d..94270c25eef9d29c6e2eb1c5a12aa33770855e8b 100644 |
| --- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java |
| +++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java |
| @@ -531,4 +531,22 @@ public class SyntaxTest extends AbstractParserTest { |
| ParserErrorCode.SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND, 13, 14, |
| ParserErrorCode.SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND, 15, 13); |
| } |
| + |
| + public void testBreakOutsideLoop() throws Exception { |
| + parseUnit("phony_lone_super_expression1.dart", |
| + Joiner.on("\n").join( |
| + "class A {", |
| + " method() {", |
| + " while (true) { break; }", // ok |
| + " break;", // bad |
| + " L: break L;", // ok |
| + " while (true) { continue; }", // ok |
| + " continue;", // bad |
| + " C: continue C;", // bad |
|
Brian Wilkerson
2012/06/08 18:49:05
Perhaps add a nested use, such as
L2: while (tr
zundel
2012/06/08 20:15:08
that case should be taken care of by the resolver.
|
| + " }", |
| + "}"), |
| + ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, 4, 10, |
| + ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, 7, 13, |
| + ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, 8, 17); |
| + } |
| } |