Fixed AS3 - direct editation - bit not

This commit is contained in:
Jindra Petřík
2021-12-04 15:15:47 +01:00
parent c1dd430f43
commit 7599ba5dd0
9 changed files with 57 additions and 2 deletions

View File

@@ -16,6 +16,19 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
addSwf("classic_air", "testdata/as3_new/bin/as3_new.air.swf");
}
@Test
public void testActivationArguments() {
decompileMethod("classic_air", "testActivationArguments", "var func:Function = function(a:int, b:int):int\r\n"
+ "{\r\n"
+ "return a + b;\r\n"
+ "};\r\n"
+ "if(arguments.length > 0)\r\n"
+ "{\r\n"
+ "trace(arguments[0]);\r\n"
+ "}\r\n",
false);
}
@Test
public void testArguments() {
decompileMethod("classic_air", "testArguments", "return arguments[0];\r\n",
@@ -1211,6 +1224,13 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
false);
}
@Test
public void testNegate() {
decompileMethod("classic_air", "testNegate", "var a:int = 5;\r\n"
+ "var b:int = ~a;\r\n",
false);
}
@Test
public void testNumberCall() {
decompileMethod("classic_air", "testNumberCall", "var a:String = (5).toString();\r\n"

View File

@@ -16,6 +16,19 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
addSwf("classic", "testdata/as3_new/bin/as3_new.flex.swf");
}
@Test
public void testActivationArguments() {
decompileMethod("classic", "testActivationArguments", "var func:Function = function(a:int, b:int):int\r\n"
+ "{\r\n"
+ "return a + b;\r\n"
+ "};\r\n"
+ "if(arguments.length > 0)\r\n"
+ "{\r\n"
+ "trace(arguments[0]);\r\n"
+ "}\r\n",
false);
}
@Test
public void testArguments() {
decompileMethod("classic", "testArguments", "return arguments[0];\r\n",
@@ -1204,6 +1217,13 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
false);
}
@Test
public void testNegate() {
decompileMethod("classic", "testNegate", "var a:int = 5;\r\n"
+ "var b:int = ~a;\r\n",
false);
}
@Test
public void testNumberCall() {
decompileMethod("classic", "testNumberCall", "var a:String = (5).toString();\r\n"