Support for comma operator in switch case statements

This commit is contained in:
Jindra Petřík
2021-01-23 14:16:11 +01:00
parent 3f2e075ee9
commit 0a60be9246
6 changed files with 116 additions and 20 deletions

View File

@@ -1162,6 +1162,22 @@ public class ActionScript3Test extends ActionScriptTestBase {
false);
}
@Test
public void testSwitchComma() {
decompileMethod("testSwitchComma", "var a:String = \"A\";\r\n"
+ "switch(a)\r\n"
+ "{\r\n"
+ "case \"A\":\r\n"
+ "trace(\"is A\");\r\n"
+ "break;\r\n"
+ "case \"B\":\r\n"
+ "trace(\"is B\");\r\n"
+ "case TestSwitchComma.X, \"C\":\r\n"
+ "trace(\"is C\");\r\n"
+ "}\r\n",
false);
}
@Test
public void testSwitchDefault() {
decompileMethod("testSwitchDefault", "var a:* = 5;\r\n"