Fixed: #2323 AS3 direct editation - Number class traits are duplicated in constructor

This commit is contained in:
Jindra Petřík
2024-09-24 22:55:13 +02:00
parent 6c57d790b2
commit 042fa4e441
2 changed files with 9 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- [#2272] Filters strength attribute caps at 100%
- [#2322] AS3 Construct property name formatting
- [#2322] AS3 Assigment position when using dup
- [#2323] AS3 direct editation - Number class traits are duplicated in constructor
## [21.1.0] - 2024-09-23
### Added
@@ -3585,6 +3586,7 @@ Major version of SWF to XML export changed to 2.
[#2320]: https://www.free-decompiler.com/flash/issues/2320
[#2272]: https://www.free-decompiler.com/flash/issues/2272
[#2322]: https://www.free-decompiler.com/flash/issues/2322
[#2323]: https://www.free-decompiler.com/flash/issues/2323
[#943]: https://www.free-decompiler.com/flash/issues/943
[#1812]: https://www.free-decompiler.com/flash/issues/1812
[#2287]: https://www.free-decompiler.com/flash/issues/2287

View File

@@ -842,7 +842,13 @@ public class AVM2SourceGenerator implements SourceGenerator {
*/
if (!isStatic && val != null) {
//do not init basic values, that can be stored in trait
if (!(val instanceof IntegerValueAVM2Item) && !(val instanceof StringAVM2Item) && !(val instanceof BooleanAVM2Item) && !(val instanceof NullAVM2Item) && !(val instanceof UndefinedAVM2Item)) {
if (!(val instanceof IntegerValueAVM2Item)
&& !(val instanceof DoubleValueAVM2Item)
&& !(val instanceof StringAVM2Item)
&& !(val instanceof BooleanAVM2Item)
&& !(val instanceof NullAVM2Item)
&& !(val instanceof UndefinedAVM2Item)
) {
initcode.add(ins(AVM2Instructions.GetLocal0));
localData.isStatic = false;
initcode.addAll(toInsList(val.toSource(localData, this)));