mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-10 18:52:31 +00:00
Fixed AS3 - direct editation - bit not
This commit is contained in:
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#1762] AS - switch detection (mostcommon pathpart)
|
||||
- [#1763] AS3 - initialization of activation object in some cases
|
||||
- AS3 - direct editation - arguments object on method with activation
|
||||
- AS3 - direct editation - bit not
|
||||
|
||||
## [15.0.0] - 2021-11-29
|
||||
### Added
|
||||
|
||||
@@ -58,6 +58,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.clauses.TryAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.AsTypeAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitAndAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitNotAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitOrAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitXorAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.operations.DeletePropertyAVM2Item;
|
||||
@@ -2252,7 +2253,7 @@ public class ActionScript3Parser {
|
||||
break;
|
||||
case NEGATE:
|
||||
ret = expressionPrimary(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, false, registerVars, inFunction, inMethod, false, variables);
|
||||
ret = new NegAVM2Item(null, null, ret);
|
||||
ret = new BitNotAVM2Item(null, null, ret);
|
||||
|
||||
break;
|
||||
case MINUS:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,7 @@
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::timeStamp</name>
|
||||
<value>'02.12.2021'</value>
|
||||
<value>'04.12.2021'</value>
|
||||
</define>
|
||||
<define append="true">
|
||||
<name>CONFIG::air</name>
|
||||
|
||||
@@ -77,6 +77,7 @@ package
|
||||
TestMultipleCondition;
|
||||
TestNamedAnonFunctions;
|
||||
TestNames;
|
||||
TestNegate;
|
||||
TestNumberCall;
|
||||
TestOptionalParameters;
|
||||
TestParamNames;
|
||||
|
||||
12
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestNegate.as
vendored
Normal file
12
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestNegate.as
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestNegate
|
||||
{
|
||||
public function run():void
|
||||
{
|
||||
var a:int = 5;
|
||||
var b:int = ~a;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user