mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 15:51:33 +00:00
Fixed: #2459 AS1/2 StoreRegister improper declaration position
This commit is contained in:
+2
-1
@@ -103,10 +103,11 @@ public class ActionDefineFunctionPushRegisterCleanerTest extends ActionScript2Te
|
||||
+ "function testReturns()\r\n"
|
||||
+ "{\r\n"
|
||||
+ "var _loc2_ = 10;\r\n"
|
||||
+ "var _loc1_;\r\n"
|
||||
+ "if(_loc2_ > 2)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "_loc2_ = _loc2_ + 1;\r\n"
|
||||
+ "var _loc1_ = 0;\r\n"
|
||||
+ "_loc1_ = 0;\r\n"
|
||||
+ "while(_loc1_ < 100)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "if(_loc2_ + _loc1_ == 27)\r\n"
|
||||
|
||||
@@ -167,7 +167,7 @@ public class ActionScript2AssemblerTest extends ActionScript2TestBase {
|
||||
res = cleanPCode(res);
|
||||
assertEquals(res, "function test(p)\n"
|
||||
+ "{\n"
|
||||
+ "var _loc0_ = null;\n"
|
||||
+ "var _loc0_;\n"
|
||||
+ "if((_loc0_ = p.type) === 1)\n"
|
||||
+ "{\n"
|
||||
+ "trace(\"Hello\");\n"
|
||||
@@ -323,7 +323,7 @@ public class ActionScript2AssemblerTest extends ActionScript2TestBase {
|
||||
+ "Push \"after\"\n"
|
||||
+ "Trace");
|
||||
res = cleanPCode(res);
|
||||
assertEquals(res, "var _loc1_ = null;\n"
|
||||
assertEquals(res, "var _loc1_;\n"
|
||||
+ "x = _loc1_ = new Object();\n"
|
||||
+ "var _loc2_ = _global.x;\n"
|
||||
+ "for(var _loc0_ in _loc2_)\n"
|
||||
|
||||
@@ -1989,9 +1989,10 @@ public class ActionScript2Test extends ActionScript2TestBase {
|
||||
+ "{\r\n"
|
||||
+ "var _loc3_ = {};\r\n"
|
||||
+ "var _loc2_ = {};\r\n"
|
||||
+ "var _loc1_;\r\n"
|
||||
+ "for(var _loc4_ in _loc3_)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "var _loc1_ = _loc2_[_loc4_];\r\n"
|
||||
+ "_loc1_ = _loc2_[_loc4_];\r\n"
|
||||
+ "switch(_loc1_)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "case \"A\":\r\n"
|
||||
@@ -2495,4 +2496,23 @@ public class ActionScript2Test extends ActionScript2TestBase {
|
||||
+ "fscommand(\"test\" + r,\"xx\");\r\n"
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void frame92_Test() {
|
||||
compareSrc(92, "function f(tst)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "var _loc1_;\r\n"
|
||||
+ "if(tst)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "_loc1_ = 1;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "else\r\n"
|
||||
+ "{\r\n"
|
||||
+ "_loc1_ = 2;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"testVarDefineInFunc\");\r\n"
|
||||
+ "f(tst);\r\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user