diff --git a/CHANGELOG.md b/CHANGELOG.md index ec5b6e349..cb17b1249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Close action on SWF inside DefineBinaryData - [#2093] AS3 Unnecessary use of fully qualified names for classes in same package - [#1678] Shapes - Miter clip join style +- [#2094] AS3 do not show body trait variables as FQN ## [19.0.0] - 2023-10-01 ### Added @@ -3129,6 +3130,8 @@ Major version of SWF to XML export changed to 2. [#2090]: https://www.free-decompiler.com/flash/issues/2090 [#2079]: https://www.free-decompiler.com/flash/issues/2079 [#2093]: https://www.free-decompiler.com/flash/issues/2093 +[#1678]: https://www.free-decompiler.com/flash/issues/1678 +[#2094]: https://www.free-decompiler.com/flash/issues/2094 [#1449]: https://www.free-decompiler.com/flash/issues/1449 [#2070]: https://www.free-decompiler.com/flash/issues/2070 [#2073]: https://www.free-decompiler.com/flash/issues/2073 @@ -3289,7 +3292,6 @@ Major version of SWF to XML export changed to 2. [#1863]: https://www.free-decompiler.com/flash/issues/1863 [#1865]: https://www.free-decompiler.com/flash/issues/1865 [#1846]: https://www.free-decompiler.com/flash/issues/1846 -[#1678]: https://www.free-decompiler.com/flash/issues/1678 [#1414]: https://www.free-decompiler.com/flash/issues/1414 [#1755]: https://www.free-decompiler.com/flash/issues/1755 [#1465]: https://www.free-decompiler.com/flash/issues/1465 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 06ce22ce0..370bdfd1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -368,7 +368,13 @@ public final class MethodBody implements Cloneable { writer.appendNoHilight(this.method_info); writer.newLine(); } - Graph.graphToString(convertedItems, writer, LocalData.create(callStack, abcIndex, abc, localRegNames, fullyQualifiedNames, seenMethods)); + List fullyQualifiedNames2 = new ArrayList<>(fullyQualifiedNames); + for (Trait t:traits.traits) { + DottedChain tname = DottedChain.parseWithSuffix(t.getName(abc).getName(abc.constants, new ArrayList<>(), false, true)); + fullyQualifiedNames2.remove(tname); + } + + Graph.graphToString(convertedItems, writer, LocalData.create(callStack, abcIndex, abc, localRegNames, fullyQualifiedNames2, seenMethods)); //writer.endMethod(); } else if (convertException instanceof TimeoutException) { // exception was logged in convert method diff --git a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf index edfed799c..01a61a6e5 100644 Binary files a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf and b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf differ diff --git a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf index 55e17a586..fc261c681 100644 Binary files a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf and b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf differ diff --git a/libsrc/ffdec_lib/testdata/as3_new/src/Main.as b/libsrc/ffdec_lib/testdata/as3_new/src/Main.as index 8f47063bc..6509d4ba4 100644 --- a/libsrc/ffdec_lib/testdata/as3_new/src/Main.as +++ b/libsrc/ffdec_lib/testdata/as3_new/src/Main.as @@ -119,6 +119,7 @@ package TestTryReturn2; TestUndefined; TestUsagesTry; + TestVarFqn; TestVector; TestVector2; TestWhileAnd; diff --git a/libsrc/ffdec_lib/testdata/as3_new/src/tests/TestVarFqn.as b/libsrc/ffdec_lib/testdata/as3_new/src/tests/TestVarFqn.as new file mode 100644 index 000000000..bd1e62c33 --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as3_new/src/tests/TestVarFqn.as @@ -0,0 +1,19 @@ +package tests +{ + import tests_classes.mypackage1.TestClass; + import tests_classes.mypackage2.TestClass; + + public class TestVarFqn + { + private var c1:tests_classes.mypackage1.TestClass; + private var c2:tests_classes.mypackage2.TestClass; + + public function run(TestClass:int):* + { + var b:int = TestClass + 5; //TestClass here is variable name (body trait name), should not be displayed as FQN + var f:Function = function(x:int, y:int):int { //This triggers body traits generation + return x + y + TestClass; + }; + } + } +}