mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-26 20:47:11 +00:00
new for loop continues detection
This commit is contained in:
@@ -2008,8 +2008,6 @@ public class ActionScript2Test extends ActionScript2TestBase {
|
||||
+ "case \"C\":\r\n"
|
||||
+ "trace(\"Ret 5\");\r\n"
|
||||
+ "return 5;\r\n"
|
||||
+ "default:\r\n"
|
||||
+ "continue;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"Final\");\r\n"
|
||||
|
||||
@@ -251,10 +251,8 @@ public class ActionScript3Test extends ActionScriptTestBase {
|
||||
+ "for(d = 0; d < 25; d++)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "e = 0;\r\n"
|
||||
+ "if(e >= 50)\r\n"
|
||||
+ "if(e < 50)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "continue;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "if(e == 9)\r\n"
|
||||
+ "{\r\n"
|
||||
+ "break;\r\n"
|
||||
@@ -269,6 +267,7 @@ public class ActionScript3Test extends ActionScriptTestBase {
|
||||
+ "}\r\n"
|
||||
+ "break loop1;\r\n"
|
||||
+ "}\r\n"
|
||||
+ "}\r\n"
|
||||
+ "trace(\"hello\");\r\n"
|
||||
+ "}\r\n",
|
||||
false);
|
||||
@@ -1658,6 +1657,27 @@ public class ActionScript3Test extends ActionScriptTestBase {
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssembledSwitch() {
|
||||
decompileMethod("assembled", "testSwitch", "switch(int(somevar))\r\n"
|
||||
+ "{\r\n"
|
||||
+ "case 0:\r\n"
|
||||
+ "var _loc2_:String = \"X\";\r\n"
|
||||
+ "return;\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "case 1:\r\n"
|
||||
+ "_loc2_ = \"A\";\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "case 3:\r\n"
|
||||
+ "_loc2_ = \"B\";\r\n"
|
||||
+ "break;\r\n"
|
||||
+ "case 4:\r\n"
|
||||
+ "_loc2_ = \"C\";\r\n"
|
||||
+ "}\r\n"
|
||||
+ "_loc2_ = \"after\";\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssembledSwitchDefault() {
|
||||
decompileMethod("assembled", "testSwitchDefault", "switch(5)\r\n"
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.generators;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
@@ -90,12 +91,10 @@ public class AS2Generator {
|
||||
s.append("}");
|
||||
doa = null;
|
||||
}
|
||||
}
|
||||
/*try (PrintWriter pw = new PrintWriter("as2_teststub.java")) {
|
||||
pw.println(s.toString());
|
||||
}*/
|
||||
try (FileOutputStream fos = new FileOutputStream("as2_teststub.java")) {
|
||||
fos.write(Utf8Helper.getBytes(s.toString()));
|
||||
}
|
||||
try (FileOutputStream fos = new FileOutputStream("as2_teststub.java")) {
|
||||
fos.write(Utf8Helper.getBytes(s.toString()));
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user