AS3 Fix and/or in try clause

This commit is contained in:
Jindra Petřík
2021-02-05 18:30:26 +01:00
parent 34b69e83c3
commit 0e813bd896
9 changed files with 85 additions and 133 deletions

View File

@@ -1150,6 +1150,24 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
false);
}
@Test
public void testTryIf() {
decompileMethod("classic_air", "testTryIf", "var a:int = Math.random();\r\n"
+ "try\r\n"
+ "{\r\n"
+ "if(a > 5 && a < 50)\r\n"
+ "{\r\n"
+ "trace(\"in limits\");\r\n"
+ "}\r\n"
+ "trace(\"next\");\r\n"
+ "}\r\n"
+ "catch(e:Error)\r\n"
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "}\r\n",
false);
}
@Test
public void testTryReturn() {
decompileMethod("classic_air", "testTryReturn", "var i:int = 0;\r\n"

View File

@@ -1139,6 +1139,24 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
false);
}
@Test
public void testTryIf() {
decompileMethod("classic", "testTryIf", "var a:int = Math.random();\r\n"
+ "try\r\n"
+ "{\r\n"
+ "if(a > 5 && a < 50)\r\n"
+ "{\r\n"
+ "trace(\"in limits\");\r\n"
+ "}\r\n"
+ "trace(\"next\");\r\n"
+ "}\r\n"
+ "catch(e:Error)\r\n"
+ "{\r\n"
+ "trace(\"in catch\");\r\n"
+ "}\r\n",
false);
}
@Test
public void testTryReturn() {
decompileMethod("classic", "testTryReturn", "var i:int = 0;\r\n"