From 37595a041094e320d38abec34ec6c629971d42d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 10 Nov 2023 19:32:35 +0100 Subject: [PATCH] Fixed AS3 direct editation - namespaces were initialized in class initializers --- CHANGELOG.md | 1 + .../flash/abc/avm2/parser/script/AVM2SourceGenerator.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ecc44db7..967f13189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - [#2116] Apply colortransform after filters - [#2116] Limit maximum number of box blur pixels - [#2122] `-header` command did not support negative integers for displayrect +- AS3 direct editation - namespaces were initialized in class initializers ## [20.0.0] - 2023-11-05 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 61e4da188..f8f89ed70 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -668,6 +668,9 @@ public class AVM2SourceGenerator implements SourceGenerator { ns = genNs(importedClasses, pkg, ((ConstAVM2Item) ti).pkg, openedNamespaces, localData, ((ConstAVM2Item) ti).line); tname = ((ConstAVM2Item) ti).var; isConst = true; + if (((ConstAVM2Item) ti).type.toString().equals("Namespace")) { + continue; + } } if (isStatic && val != null) { sinitcode.add(ins(AVM2Instructions.FindProperty, traitName(ns, tname)));