mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-22 14:46:30 +00:00
AS1/2 Try..catch with error types support - decompilation and direct editation
This commit is contained in:
@@ -1873,4 +1873,66 @@ public class ActionScript2Test extends ActionScript2TestBase {
|
||||
+ "trace(\"switchVariantsTest\");\r\n"
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void frame68_tryTypeTest() {
|
||||
compareSrc(68, "trace(\"tryTypeTest\");\r\n"
|
||||
+ "var a = 5;\r\n"
|
||||
+ "try\r\n"
|
||||
+ "{\r\n"
|
||||
+ "a = a / 0;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "try\r\n"
|
||||
+ "{\r\n"
|
||||
+ "a = a / 0;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(a == 0)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "throw e;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "else\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "try\r\n"
|
||||
+ "{\r\n"
|
||||
+ "a = a / 0;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e:MyError)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "try\r\n"
|
||||
+ "{\r\n"
|
||||
+ "a = a / 0;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e1:MyError)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e1);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e2)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e2);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "try\r\n"
|
||||
+ "{\r\n"
|
||||
+ "a = a / 0;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e:MyError)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "catch(e2:Error)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"err:\" + e2);\r\n"
|
||||
+ "}\r\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user