mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-16 12:11:55 +00:00
Fixed AS3 Metadata values order
This commit is contained in:
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
||||
- AS3 direct editation - Allow comma operator in XML filter operation
|
||||
- AS3 direct editation - Allow comma operator in switch expressions
|
||||
- AS3 XML embedded variables display and direct edit
|
||||
- AS3 Metadata values order
|
||||
|
||||
## [18.3.6] - 2023-02-25
|
||||
### Fixed
|
||||
|
||||
@@ -45,6 +45,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@@ -102,7 +103,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
for (int m : metadata) {
|
||||
if (m >= 0 && m < abc.metadata_info.size()) {
|
||||
String name = abc.constants.getString(abc.metadata_info.get(m).name_index);
|
||||
Map<String, String> data = new HashMap<>();
|
||||
Map<String, String> data = new LinkedHashMap<>();
|
||||
for (int i = 0; i < abc.metadata_info.get(m).keys.length; i++) {
|
||||
data.put(abc.constants.getString(abc.metadata_info.get(m).keys[i]),
|
||||
abc.constants.getString(abc.metadata_info.get(m).values[i]));
|
||||
|
||||
@@ -1383,6 +1383,12 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetadata() {
|
||||
decompileMethod("classic_air", "testMetadata", "trace(\"hello\");\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMissingDefault() {
|
||||
decompileMethod("classic_air", "testMissingDefault", "var jj:int = 1;\r\n"
|
||||
|
||||
@@ -1379,6 +1379,12 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetadata() {
|
||||
decompileMethod("classic", "testMetadata", "trace(\"hello\");\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMissingDefault() {
|
||||
decompileMethod("classic", "testMissingDefault", "var jj:int = 1;\r\n"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -83,6 +83,7 @@ package
|
||||
TestInnerTry;
|
||||
TestLogicalComputing;
|
||||
TestManualConvert;
|
||||
TestMetadata;
|
||||
TestMissingDefault;
|
||||
TestMultipleCondition;
|
||||
TestNamedAnonFunctions;
|
||||
|
||||
14
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestMetadata.as
vendored
Normal file
14
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestMetadata.as
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package tests
|
||||
{
|
||||
[MyClassTag(cls1 = "class 1", cls2 = "class 2")]
|
||||
public class TestMetadata
|
||||
{
|
||||
[MyVarTag(var1 = "var 1", var2 = "var 2")]
|
||||
public var v:int = 5;
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
trace("hello");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user