Fixed #2111 AS3 direct editation - access class in class initializer

This commit is contained in:
Jindra Petřík
2023-12-30 18:06:08 +01:00
parent 568301542a
commit 123a740d22
2 changed files with 5 additions and 1 deletions
@@ -2909,7 +2909,9 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
}
}
if (globalSlotId > 0) {
if (localData.isStatic && item.toString().equals(currentFullClassName)) {
return Arrays.asList(ins(AVM2Instructions.GetLocal0));
} else if (globalSlotId > 0) {
return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetGlobalScope), ins(AVM2Instructions.GetSlot, globalSlotId));
} else {
return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetLex, resolveType(localData, item, abcIndex)));