[FalconJX] resolved TODO TODO calls for braces in switch case blocks, but since the code functions fine without them, I've removed the TODO and added one extra test just to be sure.
Signed-off-by: Erik de Bruin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/fd4dbd9c Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fd4dbd9c Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fd4dbd9c Branch: refs/heads/develop Commit: fd4dbd9c51b85bc79cb28610e361515d05acb832 Parents: 6e05709 Author: Erik de Bruin <[email protected]> Authored: Fri Apr 19 16:28:03 2013 +0200 Committer: Erik de Bruin <[email protected]> Committed: Fri Apr 19 16:28:03 2013 +0200 ---------------------------------------------------------------------- .../internal/codegen/as/TestStatements.java | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd4dbd9c/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/as/TestStatements.java ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/as/TestStatements.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/as/TestStatements.java index d2b6333..6c90f98 100644 --- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/as/TestStatements.java +++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/as/TestStatements.java @@ -376,8 +376,8 @@ public class TestStatements extends ASTestBase ISwitchNode node = (ISwitchNode) getNode( "switch(i){case 1: { break; }}", ISwitchNode.class); asBlockWalker.visitSwitch(node); - // TODO case BLOCK statements are SYNTHESIZED so they will never show BRACES - // without extra help from us + // (erikdebruin) the code is valid without the extra braces, + // i.e. we're good, we "don't care" assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n}"); } @@ -390,6 +390,15 @@ public class TestStatements extends ASTestBase assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n\tdefault:\n\t\treturn;\n}"); } + @Test + public void testVisitSwitch_3() + { + ISwitchNode node = (ISwitchNode) getNode( + "switch(i){case 1: { var x:int = 42; break; }; case 2: { var y:int = 66; break; }}", ISwitchNode.class); + asBlockWalker.visitSwitch(node); + assertOut("switch (i) {\n\tcase 1:\n\t\tvar x:int = 42;\n\t\tbreak;\n\tcase 2:\n\t\tvar y:int = 66;\n\t\tbreak;\n}"); + } + //---------------------------------- // label : for () {} //----------------------------------
