mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-11 13:08:10 +00:00
Fixed #2231 AS3 coercion to String as convert
This commit is contained in:
@@ -42,6 +42,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#2222] Missing shapes when gradient fillstyle has only two gradrecords with the same ratio
|
||||
- [#2224] Exporting Embed assets - handling DefineBits(+JPEGTables) - convert to DefineBitsJPEG2
|
||||
- [PR191] Saving class name during AS3 P-code class trait editation
|
||||
- [#2231] AS3 coercion to String as convert
|
||||
|
||||
### Changed
|
||||
- [#2185] MochiCrypt no longer offered for auto decrypt, user needs to choose variant from "Use unpacker" menu
|
||||
@@ -3410,6 +3411,7 @@ Major version of SWF to XML export changed to 2.
|
||||
[#2202]: https://www.free-decompiler.com/flash/issues/2202
|
||||
[#2222]: https://www.free-decompiler.com/flash/issues/2222
|
||||
[#2224]: https://www.free-decompiler.com/flash/issues/2224
|
||||
[#2231]: https://www.free-decompiler.com/flash/issues/2231
|
||||
[#2206]: https://www.free-decompiler.com/flash/issues/2206
|
||||
[#2100]: https://www.free-decompiler.com/flash/issues/2100
|
||||
[#2123]: https://www.free-decompiler.com/flash/issues/2123
|
||||
|
||||
@@ -88,11 +88,12 @@ public class CoerceAVM2Item extends AVM2Item {
|
||||
}
|
||||
break;
|
||||
case "String":
|
||||
displayCoerce = !valueReturnType.equals(TypeItem.STRING)
|
||||
/*displayCoerce = !valueReturnType.equals(TypeItem.STRING)
|
||||
&& !valueReturnType.equals(new TypeItem("XML"))
|
||||
&& !valueReturnType.equals(new TypeItem("XMLList"))
|
||||
&& !valueReturnType.equals(new TypeItem("null"))
|
||||
&& !valueReturnType.equals(TypeItem.UNBOUNDED);
|
||||
&& !valueReturnType.equals(TypeItem.UNBOUNDED);*/
|
||||
displayCoerce = false;
|
||||
break;
|
||||
default:
|
||||
displayCoerce = false;
|
||||
|
||||
@@ -1770,6 +1770,13 @@ public class ActionScript3ClassicAirDecompileTest extends ActionScript3Decompile
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringCoerce() {
|
||||
decompileMethod("classic_air", "testStringCoerce", "var text1:String = this.a[\"test\"];\r\n"
|
||||
+ "var text2:String = String(this.a[\"test\"]);\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringConcat() {
|
||||
decompileMethod("classic_air", "testStringConcat", "var k:int = 8;\r\n"
|
||||
|
||||
@@ -1757,6 +1757,13 @@ public class ActionScript3ClassicDecompileTest extends ActionScript3DecompileTes
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringCoerce() {
|
||||
decompileMethod("classic", "testStringCoerce", "var text1:String = this.a[\"test\"];\r\n"
|
||||
+ "var text2:String = String(this.a[\"test\"]);\r\n",
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringConcat() {
|
||||
decompileMethod("classic", "testStringConcat", "var k:int = 8;\r\n"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -107,6 +107,7 @@ package
|
||||
TestSlots;
|
||||
TestSlots2;
|
||||
TestStrictEquals;
|
||||
TestStringCoerce;
|
||||
TestStringConcat;
|
||||
TestStrings;
|
||||
TestSwitch;
|
||||
|
||||
14
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestStringCoerce.as
vendored
Normal file
14
libsrc/ffdec_lib/testdata/as3_new/src/tests/TestStringCoerce.as
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package tests
|
||||
{
|
||||
|
||||
public class TestStringCoerce
|
||||
{
|
||||
var a:Object = null;
|
||||
|
||||
public function run():*
|
||||
{
|
||||
var text1:String = this.a["test"];
|
||||
var text2:String = String(this.a["test"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user