mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 15:35:34 +00:00
Fixed #1888 Resolving types on XML and XMLList
This commit is contained in:
@@ -244,7 +244,16 @@ public class GetPropertyIns extends InstructionDefinition {
|
||||
//TODO: handle method calls to return proper param type results
|
||||
}
|
||||
}
|
||||
if (receiverType.equals(new TypeItem("XMLList"))) {
|
||||
if (multiname.name != null && multiname.name.returnType().equals(TypeItem.INT)) {
|
||||
type.setVal(new TypeItem("XML"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
localData.abcIndex.findPropertyTypeOrCallType(localData.abc, receiverType, multiname.resolvedMultinameName, localData.abc.constants.getMultiname(multiname.multinameIndex).namespace_index, parentStatic, !parentStatic, false, type, callType);
|
||||
if (receiverType.equals(new TypeItem("XML")) && !type.getVal().equals(new TypeItem("Function"))) {
|
||||
type.setVal(new TypeItem("XMLList"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,17 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
|
||||
+ "i = int(v.join(\"x\"));\r\n"
|
||||
+ "i = int(prot);\r\n"
|
||||
+ "s = prot;\r\n"
|
||||
+ "s = String(getTimer());\r\n",
|
||||
+ "s = String(getTimer());\r\n"
|
||||
+ "var x:XML;\r\n"
|
||||
+ "s = x = <list>\r\n"
|
||||
+ "<item id=\"1\">1</item>\r\n"
|
||||
+ "<item id=\"2\">2</item>\r\n"
|
||||
+ "<item id=\"3\">3</item>\r\n"
|
||||
+ "</list>;\r\n"
|
||||
+ "trace(\"a\");\r\n"
|
||||
+ "var xlist:XMLList = x.item;\r\n"
|
||||
+ "trace(\"b\");\r\n"
|
||||
+ "i = int(xlist[i].@id);\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,17 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
|
||||
+ "i = int(v.join(\"x\"));\r\n"
|
||||
+ "i = int(prot);\r\n"
|
||||
+ "s = prot;\r\n"
|
||||
+ "s = String(getTimer());\r\n",
|
||||
+ "s = String(getTimer());\r\n"
|
||||
+ "var x:XML = <list>\r\n"
|
||||
+ "<item id=\"1\">1</item>\r\n"
|
||||
+ "<item id=\"2\">2</item>\r\n"
|
||||
+ "<item id=\"3\">3</item>\r\n"
|
||||
+ "</list>;\r\n"
|
||||
+ "s = x;\r\n"
|
||||
+ "trace(\"a\");\r\n"
|
||||
+ "var xlist:XMLList = x.item;\r\n"
|
||||
+ "trace(\"b\");\r\n"
|
||||
+ "i = int(xlist[i].@id);\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -53,6 +53,19 @@ package tests
|
||||
s = prot;
|
||||
|
||||
s = String(getTimer());
|
||||
|
||||
|
||||
var x:XML = <list>
|
||||
<item id="1">1</item>
|
||||
<item id="2">2</item>
|
||||
<item id="3">3</item>
|
||||
</list>;
|
||||
s = x;
|
||||
trace("a");
|
||||
var xlist:XMLList = x.item;
|
||||
trace("b");
|
||||
i = int(xlist[i].@id);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user