mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 09:54:50 +00:00
AS3 additional Vector test
This commit is contained in:
@@ -209,6 +209,7 @@ public class ActionScript3Test {
|
||||
+ "trace(\"new line \\r\\n hello!\");\r\n", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testContinueLevels() {
|
||||
decompileMethod("testContinueLevels", "var b:* = undefined;\r\n"
|
||||
+ "var c:* = undefined;\r\n"
|
||||
@@ -808,7 +809,7 @@ public class ActionScript3Test {
|
||||
public void testStringConcat() {
|
||||
decompileMethod("testStringConcat", "var k:* = 8;\r\n"
|
||||
+ "this.traceIt(\"hello\" + 5 * 6);\r\n"
|
||||
+ "this.traceIt(\"hello\" + (k-1));\r\n"
|
||||
+ "this.traceIt(\"hello\" + (k - 1));\r\n"
|
||||
+ "this.traceIt(\"hello\" + 5 + 6);\r\n", false);
|
||||
}
|
||||
|
||||
@@ -889,6 +890,12 @@ public class ActionScript3Test {
|
||||
+ "return 4;\r\n", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVector2() {
|
||||
decompileMethod("testVector2", "var a:Vector.<Vector.<int>> = new Vector.<Vector.<int>>();\r\n"
|
||||
+ "var b:Vector.<int> = new <int>[10,20,30];\r\n", false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOptionalParameters() {
|
||||
String methodName = "testOptionalParameters";
|
||||
|
||||
@@ -131,12 +131,11 @@ public class RecompileTest {
|
||||
for (int s = 0; s < abc.script_info.size(); s++) {
|
||||
HilightedTextWriter htw = new HilightedTextWriter(new CodeFormatting(), false);
|
||||
MyEntry<ClassPath, ScriptPack> en = abc.script_info.get(s).getPacks(abc, s).get(0);
|
||||
System.out.print("Recompiling:"+en.key.toString()+"...");
|
||||
System.out.println("Recompiling:"+en.key.toString()+"...");
|
||||
en.value.toSource(htw, swf.abcList, abc.script_info.get(s).traits.traits, ScriptExportMode.AS, false);
|
||||
String original = htw.toString();
|
||||
ABC nabc = new ABC(swf);
|
||||
com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser.compile(original, nabc,allAbcs, false, en.key.className + ".as");
|
||||
System.out.println("OK");
|
||||
com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser.compile(original, nabc,allAbcs, false, en.key.className + ".as");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
BIN
trunk/testdata/as3/as3.swf
vendored
BIN
trunk/testdata/as3/as3.swf
vendored
Binary file not shown.
6
trunk/testdata/as3/classes/Test.as
vendored
6
trunk/testdata/as3/classes/Test.as
vendored
@@ -881,5 +881,11 @@
|
||||
public function testOptionalParameters(p1:Event=null, p2:Number=1, p3:Number=-1, p4:Number=-1.1, p5:Number=-1.1, p6:String="a")
|
||||
{
|
||||
}
|
||||
|
||||
public function testVector2()
|
||||
{
|
||||
var a:Vector.<Vector.<int>> = new Vector.<Vector.<int>>();
|
||||
var b:Vector.<int> = new <int>[10,20,30];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user