mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-22 11:45:17 +00:00
AS1/2 break statement decompilation in for..in loops fixed
This commit is contained in:
@@ -916,4 +916,114 @@ public class ActionScript2Test extends ActionScript2TestBase {
|
||||
+ "tst.includeTests();\r\n"
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void frame66_forInBreakTest() {
|
||||
compareSrc(66, "function testFunc1()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "for(var _loc1_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(_loc1_);\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "function testFunc2()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "for(var _loc1_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc1_ == \"b\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"found\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "function testFunc3()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "for(var _loc1_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc1_ == \"b\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"hi\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "function testFunc4()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "for(var _loc1_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc1_ == \"b\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"hi\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "else if(_loc1_ == \"c\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"hello\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "else\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"hohoho\");\r\n"
|
||||
+ "continue;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "function testFunc5()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "var _loc1_ = {key1:1,key2:2,key3:3};\r\n"
|
||||
+ "for(var _loc3_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc3_ == \"a\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"loop1_break\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "if(_loc3_ == \"b\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"hello\");\r\n"
|
||||
+ "for(var _loc2_ in _loc1_)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc2_ == \"key1\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"loop2_break\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"loop2_inside\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after_loop2\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"loop1_inside\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after_loop1\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "function testFunc6()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "var _loc1_ = {key1:1,key2:2,key3:3};\r\n"
|
||||
+ "for(var _loc3_ in obj)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc3_ == \"a\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"loop1_break\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"hello\");\r\n"
|
||||
+ "for(var _loc2_ in _loc1_)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc2_ == \"key1\")\r\n"
|
||||
+ "{\r\n"
|
||||
+ "trace(\"loop2_break\");\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"loop2_inside\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after_loop2\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"after_loop1\");\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"forInBreakTest\");\r\n"
|
||||
+ "var obj = {a:5,b:6,c:7};\r\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user