AS3 additional Vector test

This commit is contained in:
Jindra Petk
2014-05-08 09:03:37 +02:00
parent 1061aa9900
commit 0ba3ad6e1e
4 changed files with 16 additions and 4 deletions

View File

@@ -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";

View File

@@ -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 {

Binary file not shown.

View File

@@ -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];
}
}
}